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

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 4 15:02:27 PDT 2023


================
@@ -1444,6 +1444,74 @@ llvm::Error ASTReader::ReadSourceManagerBlock(ModuleFile &F) {
   }
 }
 
+llvm::Expected<SourceLocation::UIntTy>
+ASTReader::readSLocOffset(ModuleFile *F, unsigned Index) {
+  BitstreamCursor &Cursor = F->SLocEntryCursor;
+  SavedStreamPosition SavedPosition(Cursor);
+  if (llvm::Error Err = Cursor.JumpToBit(F->SLocEntryOffsetsBase +
+                                         F->SLocEntryOffsets[Index]))
+    return Err;
----------------
jansvoboda11 wrote:

Thanks for the heads-up, I'll keep that in mind if bots start failing. I think we recently bumped compiler requirements, so we might get away with this.

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


More information about the cfe-commits mailing list