diff options
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r-- | clang/lib/Basic/SourceManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index 8dfc5d100e8..23a01c953a4 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -373,7 +373,10 @@ FileID SourceManager::createFileID(const ContentCache *File, // Set LastFileIDLookup to the newly created file. The next getFileID call is // almost guaranteed to be from that file. - return LastFileIDLookup = FileID::get(SLocEntryTable.size()-1); + FileID FID = FileID::get(SLocEntryTable.size()-1); + if (File->FirstFID.isInvalid()) + File->FirstFID = FID; + return LastFileIDLookup = FID; } /// createInstantiationLoc - Return a new SourceLocation that encodes the fact |