MCPcopy Create free account
hub / github.com/KDAB/codebrowser / InclusionDirective

Method InclusionDirective

generator/preprocessorcallback.cpp:270–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268
269
270void 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
293void PreprocessorCallback::Defined(const clang::Token& MacroNameTok, MyMacroDefinition MD,
294 clang::SourceRange Range)

Callers

nothing calls this directly

Calls 3

pathToMethod · 0.80
addTagMethod · 0.80
shouldProcessMethod · 0.45

Tested by

no test coverage detected