r255993 - Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry().
Yaron Keren via cfe-commits
cfe-commits at lists.llvm.org
Fri Dec 18 02:30:12 PST 2015
Author: yrnkrn
Date: Fri Dec 18 04:30:12 2015
New Revision: 255993
URL: http://llvm.org/viewvc/llvm-project?rev=255993&view=rev
Log:
Replace SM.getFileEntryForID(Lexer->getFileID()) with Lexer->getFileEntry().
Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp
cfe/trunk/lib/Lex/PPLexerChange.cpp
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=255993&r1=255992&r2=255993&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Fri Dec 18 04:30:12 2015
@@ -650,8 +650,7 @@ const FileEntry *Preprocessor::LookupFil
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::LookupFil
// 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::LookupFil
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))) {
Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=255993&r1=255992&r2=255993&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Fri Dec 18 04:30:12 2015
@@ -301,8 +301,7 @@ bool Preprocessor::HandleEndOfFile(Token
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<IdentifierInfo*>(ControllingMacro))) {
More information about the cfe-commits
mailing list