| 346 | } |
| 347 | |
| 348 | void 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 | } |
nothing calls this directly
no test coverage detected