[clang] [clang][modules] Remove preloaded SLocEntries from PCM files (PR #66962)
Ben Langmuir via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 4 11:07:18 PDT 2023
================
@@ -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:
🤣 okay, maybe drop a FIXME on the return statement for good measure, but SGTM.
https://github.com/llvm/llvm-project/pull/66962
More information about the cfe-commits
mailing list