[clang] Introduce paged vector (PR #66430)

Vassil Vassilev via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 26 07:45:36 PDT 2023


================
@@ -699,7 +700,7 @@ class SourceManager : public RefCountedBase<SourceManager> {
   ///
   /// Negative FileIDs are indexes into this table. To get from ID to an index,
   /// use (-ID - 2).
-  SmallVector<SrcMgr::SLocEntry, 0> LoadedSLocEntryTable;
+  llvm::PagedVector<SrcMgr::SLocEntry> LoadedSLocEntryTable;
----------------
vgvassilev wrote:

I am wondering if, outside of this PR, we merge the `llvm::BitVector SLocEntryLoaded` into `SLocEntry` to make more consistent the behavior of is a given source location loaded. That might allow us to get rid of `LoadedSLocEntryTable.size` bits in favor of the paged vector.

https://github.com/llvm/llvm-project/blob/0b3f9d8561226e3771db7f49dfb43d1301efc3c3/clang/lib/Basic/SourceManager.cpp#L462C3-L462C3

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


More information about the cfe-commits mailing list