================
@@ -458,14 +458,12 @@ SourceManager::AllocateLoadedSLocEntries(unsigned 
NumSLocEntries,
       CurrentLoadedOffset - TotalSize < NextLocalOffset) {
     return std::make_pair(0, 0);
   }
-
-  unsigned NewTableSize = LoadedSLocEntryTable.size() + NumSLocEntries;
-  LoadedSLocEntryTableSegments.push_back(NewTableSize);
-  LoadedSLocEntryTable.resize(NewTableSize);
-  SLocEntryLoaded.resize(NewTableSize);
-
+  LoadedSLocEntryTable.resize(LoadedSLocEntryTable.size() + NumSLocEntries);
+  SLocEntryLoaded.resize(LoadedSLocEntryTable.size());
   CurrentLoadedOffset -= TotalSize;
-  return std::make_pair(-NewTableSize - 1, CurrentLoadedOffset);
+  int ID = LoadedSLocEntryTable.size();
+  LoadedSLocEntryAllocBegin.push_back(FileID::get(-ID - 2));
----------------
benlangmuir wrote:

To clarify (from `LoadedSLocEntryAllocBegin`):
> we keep the first FileID

but `AllocateLoadedSLocEntries` says
> The lowest ID ... of the entries will be returned.

So it's odd that one is -ID-2 and the other is -ID-1. Based on the comments I 
would have expected they'd either be the same or one would be offset from the 
other by the number of entries allocated.

https://github.com/llvm/llvm-project/pull/66962
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to