From 652246108005857512e1b9b38b752ea564e97811 Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Fri, 18 Dec 2015 10:30:12 +0000 Subject: [PATCH] Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry(). llvm-svn: 255993 --- clang/lib/Lex/PPDirectives.cpp | 8 +++----- clang/lib/Lex/PPLexerChange.cpp | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp index 298543e2e95f..4a0332855794 100644 --- a/clang/lib/Lex/PPDirectives.cpp +++ b/clang/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/clang/lib/Lex/PPLexerChange.cpp b/clang/lib/Lex/PPLexerChange.cpp index d43db1c34cb4..7c0d55e1f036 100644 --- a/clang/lib/Lex/PPLexerChange.cpp +++ b/clang/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))) {