зеркало из https://github.com/microsoft/clang-1.git
Fix PR1969. stdin has no FileEntry.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46629 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
f7682b0396
Коммит
9415a0cc93
|
@ -293,6 +293,8 @@ const FileEntry *HeaderSearch::
|
|||
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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче