summaryrefslogtreecommitdiffstats
path: root/clang/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-11-15 19:07:47 +0000
committerChris Lattner <sabre@nondot.org>2007-11-15 19:07:47 +0000
commit609d41336348772d348de88561c24cb06bb5beb8 (patch)
treea920a4520f2fc64328a83b243c73f0cd8fc20814 /clang/Lex/Preprocessor.cpp
parent6a7ddfdb8fc7e0fc3a9a2800bd37c2089140d7d5 (diff)
downloadbcm5719-llvm-609d41336348772d348de88561c24cb06bb5beb8.tar.gz
bcm5719-llvm-609d41336348772d348de88561c24cb06bb5beb8.zip
fix a bug Steve noticed, where a #import of the main file itself would fail.
llvm-svn: 44178
Diffstat (limited to 'clang/Lex/Preprocessor.cpp')
-rw-r--r--clang/Lex/Preprocessor.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/clang/Lex/Preprocessor.cpp b/clang/Lex/Preprocessor.cpp
index 718b47693ae..0970590afe9 100644
--- a/clang/Lex/Preprocessor.cpp
+++ b/clang/Lex/Preprocessor.cpp
@@ -416,7 +416,12 @@ void Preprocessor::EnterMainSourceFile(unsigned MainFileID) {
// 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);
OpenPOWER on IntegriCloud