| 186 | |
| 187 | |
| 188 | std::string Annotator::htmlNameForFile(clang::FileID id) |
| 189 | { |
| 190 | { |
| 191 | auto it = cache.find(id); |
| 192 | if (it != cache.end()) { |
| 193 | return it->second.second; |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | const clang::FileEntry* entry = getSourceMgr().getFileEntryForID(id); |
| 198 | if (!entry || llvm::StringRef(entry->getName()).empty()) { |
| 199 | cache[id] = {false, {} }; |
| 200 | return {}; |
| 201 | } |
| 202 | llvm::SmallString<256> filename; |
| 203 | canonicalize(entry->getName(), filename); |
| 204 | |
| 205 | ProjectInfo *project = projectManager.projectForFile(filename); |
| 206 | if (project) { |
| 207 | bool should_process = projectManager.shouldProcess(filename, project); |
| 208 | project_cache[id] = project; |
| 209 | std::string fn = project->name % "/" % filename.substr(project->source_path.size()); |
| 210 | cache[id] = { should_process , fn}; |
| 211 | return fn; |
| 212 | } |
| 213 | |
| 214 | cache[id] = {false, {} }; |
| 215 | return {}; |
| 216 | } |
| 217 | |
| 218 | static char normalizeForfnIndex(char c) { |
| 219 | if (c >= 'A' && c <= 'Z') |
nothing calls this directly
no test coverage detected