[cfe-commits] r46629 - in /cfe/trunk/Lex: HeaderSearch.cpp Preprocessor.cpp
Chris Lattner
sabre at nondot.org
Thu Jan 31 21:34:02 PST 2008
Author: lattner
Date: Thu Jan 31 23:34:02 2008
New Revision: 46629
URL: http://llvm.org/viewvc/llvm-project?rev=46629&view=rev
Log:
Fix PR1969. stdin has no FileEntry.
Modified:
cfe/trunk/Lex/HeaderSearch.cpp
cfe/trunk/Lex/Preprocessor.cpp
Modified: cfe/trunk/Lex/HeaderSearch.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/HeaderSearch.cpp?rev=46629&r1=46628&r2=46629&view=diff
==============================================================================
--- cfe/trunk/Lex/HeaderSearch.cpp (original)
+++ cfe/trunk/Lex/HeaderSearch.cpp Thu Jan 31 23:34:02 2008
@@ -293,6 +293,8 @@
LookupSubframeworkHeader(const char *FilenameStart,
const char *FilenameEnd,
const FileEntry *ContextFileEnt) {
+ assert(ContextFileEnt && "No context file?");
+
// Framework names must have a '/' in the filename. Find it.
const char *SlashPos = std::find(FilenameStart, FilenameEnd, '/');
if (SlashPos == FilenameEnd) return 0;
Modified: cfe/trunk/Lex/Preprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Lex/Preprocessor.cpp?rev=46629&r1=46628&r2=46629&view=diff
==============================================================================
--- cfe/trunk/Lex/Preprocessor.cpp (original)
+++ cfe/trunk/Lex/Preprocessor.cpp Thu Jan 31 23:34:02 2008
@@ -500,19 +500,20 @@
// 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;
}
}
More information about the cfe-commits
mailing list