diff options
author | Chris Lattner <sabre@nondot.org> | 2008-02-01 05:34:02 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-02-01 05:34:02 +0000 |
commit | 9415a0cc93117b69add4e1dc0f11146f3479ee1a (patch) | |
tree | 6fbb814cc29574c3e58ae8acf161afb8751db3b4 /Lex/Preprocessor.cpp | |
parent | f7682b039609e1394f0f711de11ab3fb640289f2 (diff) |
Fix PR1969. stdin has no FileEntry.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Lex/Preprocessor.cpp')
-rw-r--r-- | Lex/Preprocessor.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp index 34b5fe2183..a73757f1b5 100644 --- a/Lex/Preprocessor.cpp +++ b/Lex/Preprocessor.cpp @@ -500,19 +500,20 @@ const FileEntry *Preprocessor::LookupFile(const char *FilenameStart, // 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 (CurLexer && !CurLexer->Is_PragmaLexer) { - CurFileEnt = SourceMgr.getFileEntryForLoc(CurLexer->getFileLoc()); - if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart, FilenameEnd, - CurFileEnt))) - return FE; + if ((CurFileEnt = SourceMgr.getFileEntryForLoc(CurLexer->getFileLoc()))) + if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart, FilenameEnd, + CurFileEnt))) + return FE; } for (unsigned i = 0, e = IncludeMacroStack.size(); i != e; ++i) { IncludeStackInfo &ISEntry = IncludeMacroStack[e-i-1]; if (ISEntry.TheLexer && !ISEntry.TheLexer->Is_PragmaLexer) { - CurFileEnt = SourceMgr.getFileEntryForLoc(ISEntry.TheLexer->getFileLoc()); - if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart, FilenameEnd, - CurFileEnt))) - return FE; + if ((CurFileEnt = + SourceMgr.getFileEntryForLoc(ISEntry.TheLexer->getFileLoc()))) + if ((FE = HeaderInfo.LookupSubframeworkHeader(FilenameStart, + FilenameEnd, CurFileEnt))) + return FE; } } |