]> granicus.if.org Git - clang/commitdiff
In SourceManager::createFileID missed setting ContentCache's FirstFID in another...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 23 Jun 2009 00:42:06 +0000 (00:42 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Tue, 23 Jun 2009 00:42:06 +0000 (00:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73931 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/SourceManager.cpp

index 8dfc5d100e8590674b45e26c779ab6ba09791152..23a01c953a46c804e1aae1e881d8b6c247a5022b 100644 (file)
@@ -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