Lines Matching refs:SM
53 SourceManager &SM; member in __anone9f7e9310111::VerifyFileTracker
56 VerifyFileTracker(VerifyDiagnosticConsumer &Verify, SourceManager &SM) in VerifyFileTracker() argument
57 : Verify(Verify), SM(SM) { } in VerifyFileTracker()
64 Verify.UpdateParsedFileStatus(SM, SM.getFileID(Loc), in FileChanged()
310 static bool ParseDirective(StringRef S, ExpectedData *ED, SourceManager &SM, in ParseDirective() argument
313 DiagnosticsEngine &Diags = PP ? PP->getDiagnostics() : SM.getDiagnostics(); in ParseDirective()
385 unsigned ExpectedLine = SM.getSpellingLineNumber(Pos, &Invalid); in ParseDirective()
389 ExpectedLoc = SM.translateLineCol(SM.getFileID(Pos), ExpectedLine, 1); in ParseDirective()
394 ExpectedLoc = SM.translateLineCol(SM.getFileID(Pos), Line, 1); in ParseDirective()
411 if (SM.translateFile(FE).isInvalid()) in ParseDirective()
412 SM.createFileID(FE, Pos, SrcMgr::C_User); in ParseDirective()
415 ExpectedLoc = SM.translateFileLineCol(FE, Line, 1); in ParseDirective()
418 ExpectedLoc = SM.translateFileLineCol(FE, 1, 1); in ParseDirective()
524 SourceManager &SM = PP.getSourceManager(); in HandleComment() local
527 if (SrcManager && &SM != SrcManager) in HandleComment()
532 const char *CommentRaw = SM.getCharacterData(CommentBegin); in HandleComment()
533 StringRef C(CommentRaw, SM.getCharacterData(Comment.getEnd()) - CommentRaw); in HandleComment()
541 ParseDirective(C, &ED, SM, &PP, CommentBegin, Status); in HandleComment()
571 ParseDirective(C2, &ED, SM, &PP, CommentBegin, Status); in HandleComment()
581 static bool findDirectives(SourceManager &SM, FileID FID, in findDirectives() argument
588 const llvm::MemoryBuffer *FromFile = SM.getBuffer(FID); in findDirectives()
589 Lexer RawLex(FID, FromFile, SM, LangOpts); in findDirectives()
602 std::string Comment = RawLex.getSpelling(Tok, SM, LangOpts); in findDirectives()
606 if (ParseDirective(Comment, nullptr, SM, nullptr, Tok.getLocation(), in findDirectives()
672 static bool IsFromSameFile(SourceManager &SM, SourceLocation DirectiveLoc, in IsFromSameFile() argument
675 DiagnosticLoc = SM.getImmediateMacroCallerLoc(DiagnosticLoc); in IsFromSameFile()
677 if (SM.isWrittenInSameFile(DirectiveLoc, DiagnosticLoc)) in IsFromSameFile()
680 const FileEntry *DiagFile = SM.getFileEntryForID(SM.getFileID(DiagnosticLoc)); in IsFromSameFile()
681 if (!DiagFile && SM.isWrittenInMainFile(DirectiveLoc)) in IsFromSameFile()
684 return (DiagFile == SM.getFileEntryForID(SM.getFileID(DirectiveLoc))); in IsFromSameFile()
776 void VerifyDiagnosticConsumer::UpdateParsedFileStatus(SourceManager &SM, in UpdateParsedFileStatus() argument
780 setSourceManager(SM); in UpdateParsedFileStatus()
786 const FileEntry *FE = SM.getFileEntryForID(FID); in UpdateParsedFileStatus()
800 FoundDirectives = !LangOpts || findDirectives(SM, FID, *LangOpts); in UpdateParsedFileStatus()