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

Method HandlePPCond

generator/preprocessorcallback.cpp:348–368  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void PreprocessorCallback::HandlePPCond(clang::SourceLocation Loc, clang::SourceLocation IfLoc)
349{
350 if (!Loc.isValid() || !Loc.isFileID())
351 return;
352
353 clang::SourceManager &SM = annotator.getSourceMgr();
354 clang::FileID FID = SM.getFileID(Loc);
355 if (!annotator.shouldProcess(FID))
356 return;
357
358 while(ElifMapping.count(IfLoc)) {
359 IfLoc = Loc;
360 }
361
362 if (SM.getFileID(IfLoc) != FID) {
363 return;
364 }
365
366 annotator.generator(FID).addTag("span", ("data-ppcond=\"" + clang::Twine(SM.getExpansionLineNumber(IfLoc)) + "\"").str(),
367 SM.getFileOffset(Loc), clang::Lexer::MeasureTokenLength(Loc, SM, PP.getLangOpts()));
368}

Callers

nothing calls this directly

Calls 3

TwineClass · 0.85
addTagMethod · 0.80
shouldProcessMethod · 0.45

Tested by

no test coverage detected