| 268 | |
| 269 | |
| 270 | void PreprocessorCallback::InclusionDirective(clang::SourceLocation HashLoc, const clang::Token& IncludeTok, |
| 271 | llvm::StringRef FileName, bool IsAngled, |
| 272 | clang::CharSourceRange FilenameRange, const clang::FileEntry* File, |
| 273 | llvm::StringRef SearchPath, llvm::StringRef RelativePath, |
| 274 | const clang::Module* Imported) |
| 275 | { |
| 276 | if (!HashLoc.isValid() || !HashLoc.isFileID() || !File) |
| 277 | return; |
| 278 | clang::SourceManager &sm = annotator.getSourceMgr(); |
| 279 | clang::FileID FID = sm.getFileID(HashLoc); |
| 280 | if (!annotator.shouldProcess(FID)) |
| 281 | return; |
| 282 | |
| 283 | std::string link = annotator.pathTo(FID, File); |
| 284 | if (link.empty()) |
| 285 | return; |
| 286 | |
| 287 | auto B = sm.getFileOffset(FilenameRange.getBegin()); |
| 288 | auto E = sm.getFileOffset(FilenameRange.getEnd()); |
| 289 | |
| 290 | annotator.generator(FID).addTag("a", "href=\"" % link % "\"", B, E-B); |
| 291 | } |
| 292 | |
| 293 | void PreprocessorCallback::Defined(const clang::Token& MacroNameTok, MyMacroDefinition MD, |
| 294 | clang::SourceRange Range) |
nothing calls this directly
no test coverage detected