From: Yaron Keren Date: Fri, 18 Dec 2015 10:30:12 +0000 (+0000) Subject: Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb70f4e9cc9a4dc3dd57b032fb858d56b4b64a0e;p=clang Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255993 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 298543e2e9..4a03328557 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -650,8 +650,7 @@ const FileEntry *Preprocessor::LookupFile( for (unsigned i = 0, e = IncludeMacroStack.size(); i != e; ++i) { IncludeStackInfo &ISEntry = IncludeMacroStack[e - i - 1]; if (IsFileLexer(ISEntry)) - if ((FileEnt = SourceMgr.getFileEntryForID( - ISEntry.ThePPLexer->getFileID()))) + if ((FileEnt = ISEntry.ThePPLexer->getFileEntry())) Includers.push_back(std::make_pair(FileEnt, FileEnt->getDir())); } } @@ -696,7 +695,7 @@ const FileEntry *Preprocessor::LookupFile( // to one of the headers on the #include stack. Walk the list of the current // headers on the #include stack and pass them to HeaderInfo. if (IsFileLexer()) { - if ((CurFileEnt = SourceMgr.getFileEntryForID(CurPPLexer->getFileID()))) { + if ((CurFileEnt = CurPPLexer->getFileEntry())) { if ((FE = HeaderInfo.LookupSubframeworkHeader(Filename, CurFileEnt, SearchPath, RelativePath, RequestingModule, @@ -712,8 +711,7 @@ const FileEntry *Preprocessor::LookupFile( for (unsigned i = 0, e = IncludeMacroStack.size(); i != e; ++i) { IncludeStackInfo &ISEntry = IncludeMacroStack[e-i-1]; if (IsFileLexer(ISEntry)) { - if ((CurFileEnt = - SourceMgr.getFileEntryForID(ISEntry.ThePPLexer->getFileID()))) { + if ((CurFileEnt = ISEntry.ThePPLexer->getFileEntry())) { if ((FE = HeaderInfo.LookupSubframeworkHeader( Filename, CurFileEnt, SearchPath, RelativePath, RequestingModule, SuggestedModule))) { diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp index d43db1c34c..7c0d55e1f0 100644 --- a/lib/Lex/PPLexerChange.cpp +++ b/lib/Lex/PPLexerChange.cpp @@ -301,8 +301,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) { if (const IdentifierInfo *ControllingMacro = CurPPLexer->MIOpt.GetControllingMacroAtEndOfFile()) { // Okay, this has a controlling macro, remember in HeaderFileInfo. - if (const FileEntry *FE = - SourceMgr.getFileEntryForID(CurPPLexer->getFileID())) { + if (const FileEntry *FE = CurPPLexer->getFileEntry()) { HeaderInfo.SetFileControllingMacro(FE, ControllingMacro); if (MacroInfo *MI = getMacroInfo(const_cast(ControllingMacro))) {