[clang] [clang][modules] Move `SLocEntry` search into `ASTReader` (PR #66966)

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 16:17:17 PDT 2023


================
@@ -288,10 +288,12 @@ class ModuleFile {
   /// for the entry is SLocEntryOffsetsBase + SLocEntryOffsets[i].
   uint64_t SLocEntryOffsetsBase = 0;
 
-  /// Offsets for all of the source location entries in the
-  /// AST file.
+  /// Stream bit offsets for all of the source location entries in the AST file.
   const uint32_t *SLocEntryOffsets = nullptr;
 
+  /// SLocEntry offsets that have been loaded from the AST file.
+  std::vector<SourceLocation::UIntTy> SLocEntryOffsetLoaded;
----------------
jansvoboda11 wrote:

This ends up being ~10MB for single TU using 37 modules from the Darwin SDK. I'm not thrilled about that, what do you think? We could store these offsets in `SourceManager::LoadedSLocEntryTable` and mark the fact that the entry has not been fully deserialized in a counterpart to `llvm::BitVector SLocEntryLoaded`.

https://github.com/llvm/llvm-project/pull/66966


More information about the cfe-commits mailing list