fix a bug Steve noticed, where a #import of the main file itself would fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44178 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index 718b476..0970590 100644
--- a/Lex/Preprocessor.cpp
+++ b/Lex/Preprocessor.cpp
@@ -416,7 +416,12 @@
// Enter the main file source buffer.
EnterSourceFile(MainFileID, 0);
-
+ // Tell the header info that the main file was entered. If the file is later
+ // #imported, it won't be re-entered.
+ if (const FileEntry *FE =
+ SourceMgr.getFileEntryForLoc(SourceLocation::getFileLoc(MainFileID, 0)))
+ HeaderInfo.IncrementIncludeCount(FE);
+
std::vector<char> PrologFile;
PrologFile.reserve(4080);