================
@@ -701,6 +701,10 @@ class SourceManager : public RefCountedBase<SourceManager> 
{
   /// use (-ID - 2).
   SmallVector<SrcMgr::SLocEntry, 0> LoadedSLocEntryTable;
 
+  /// For each allocation in LoadedSLocEntryTable, we keep the new size. This
+  /// can be used to determine whether two FileIDs come from the same AST file.
+  SmallVector<size_t, 0> LoadedSLocEntryTableSegments;
----------------
jansvoboda11 wrote:

Or this?

```c++
SmallVector<FileID, 0> LoadedSLocEntryTableSegments{
  FileID(-1),   // represents FileIDs from -10 to -2
  FileID(-10),  // represents FileIDs from -50 to -11
  FileID(-50)}; // represents FileIDs from -90 to -51

llvm::upper_bound(llvm::reverse(LoadedSLocEntryTableSegments), FID);
```

The stored `FileIDs` have pretty weird values, though...

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