Lines Matching refs:SM
56 SourceManager &SM; member in __anonf93b4a080111::VerifyFileTracker
59 VerifyFileTracker(VerifyDiagnosticConsumer &Verify, SourceManager &SM) in VerifyFileTracker() argument
60 : Verify(Verify), SM(SM) { } in VerifyFileTracker()
67 Verify.UpdateParsedFileStatus(SM, SM.getFileID(Loc), in FileChanged()
313 static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM, in ParseDirective() argument
316 DiagnosticsEngine &Diags = PP ? PP->getDiagnostics() : SM.getDiagnostics(); in ParseDirective()
388 unsigned ExpectedLine = SM.getSpellingLineNumber(Pos, &Invalid); in ParseDirective()
392 ExpectedLoc = SM.translateLineCol(SM.getFileID(Pos), ExpectedLine, 1); in ParseDirective()
397 ExpectedLoc = SM.translateLineCol(SM.getFileID(Pos), Line, 1); in ParseDirective()
413 if (SM.translateFile(FE).isInvalid()) in ParseDirective()
414 SM.createFileID(FE, Pos, SrcMgr::C_User); in ParseDirective()
417 ExpectedLoc = SM.translateFileLineCol(FE, Line, 1); in ParseDirective()
420 ExpectedLoc = SM.translateFileLineCol(FE, 1, 1); in ParseDirective()
527 SourceManager &SM = PP.getSourceManager(); in HandleComment() local
530 if (SrcManager && &SM != SrcManager) in HandleComment()
535 const char *CommentRaw = SM.getCharacterData(CommentBegin); in HandleComment()
536 StringRef C(CommentRaw, SM.getCharacterData(Comment.getEnd()) - CommentRaw); in HandleComment()
544 ParseDirective(C, &ED, SM, &PP, CommentBegin, Status); in HandleComment()
574 ParseDirective(C2, &ED, SM, &PP, CommentBegin, Status); in HandleComment()
584 static bool findDirectives(SourceManager &SM, FileID FID, in findDirectives() argument
591 const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID); in findDirectives()
592 Lexer RawLex(FID, FromFile, SM, LangOpts); in findDirectives()
605 std::string Comment = RawLex.getSpelling(Tok, SM, LangOpts); in findDirectives()
609 if (ParseDirective(Comment, nullptr, SM, nullptr, Tok.getLocation(), in findDirectives()
674 static bool IsFromSameFile(SourceManager &SM, SourceLocation DirectiveLoc, in IsFromSameFile() argument
677 DiagnosticLoc = SM.getImmediateMacroCallerLoc(DiagnosticLoc); in IsFromSameFile()
679 if (SM.isWrittenInSameFile(DirectiveLoc, DiagnosticLoc)) in IsFromSameFile()
682 const FileEntry *DiagFile = SM.getFileEntryForID(SM.getFileID(DiagnosticLoc)); in IsFromSameFile()
683 if (!DiagFile && SM.isWrittenInMainFile(DirectiveLoc)) in IsFromSameFile()
686 return (DiagFile == SM.getFileEntryForID(SM.getFileID(DirectiveLoc))); in IsFromSameFile()
769 void VerifyDiagnosticConsumer::UpdateParsedFileStatus(SourceManager &SM, in UpdateParsedFileStatus() argument
773 setSourceManager(SM); in UpdateParsedFileStatus()
779 const FileEntry *FE = SM.getFileEntryForID(FID); in UpdateParsedFileStatus()
793 FoundDirectives = !LangOpts || findDirectives(SM, FID, *LangOpts); in UpdateParsedFileStatus()