| 40 | } |
| 41 | |
| 42 | ProjectInfo* ProjectManager::projectForFile(llvm::StringRef filename) |
| 43 | { |
| 44 | unsigned int match_length = 0; |
| 45 | ProjectInfo *result = nullptr; |
| 46 | |
| 47 | for (auto &it : projects) { |
| 48 | const std::string &source_path = it.source_path; |
| 49 | if (source_path.size() < match_length) |
| 50 | continue; |
| 51 | if (filename.startswith(source_path)) { |
| 52 | result = ⁢ |
| 53 | match_length = source_path.size(); |
| 54 | } |
| 55 | } |
| 56 | return result; |
| 57 | } |
| 58 | |
| 59 | bool ProjectManager::shouldProcess(llvm::StringRef filename, ProjectInfo* project) |
| 60 | { |
no test coverage detected