forked from OSchip/llvm-project
fix a bug Steve noticed, where a #import of the main file itself would fail.
llvm-svn: 44178
This commit is contained in:
parent
6a7ddfdb8f
commit
609d413363
|
@ -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);
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: clang -E -I. %s | grep BODY_OF_FILE | wc -l | grep 1
|
||||
|
||||
// This #import should have no effect, as we're importing the current file.
|
||||
#import <import_self.c>
|
||||
|
||||
BODY_OF_FILE
|
||||
|
Loading…
Reference in New Issue