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

Ben Langmuir via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 09:55:40 PDT 2023


================
@@ -1444,6 +1444,77 @@ llvm::Error ASTReader::ReadSourceManagerBlock(ModuleFile &F) {
   }
 }
 
+std::optional<SourceLocation::UIntTy>
+ASTReader::readSLocOffset(ModuleFile *F, unsigned Index) {
----------------
benlangmuir wrote:

Does every path that returns `std::nullopt` report an error? If so I would recommend returning `Expected<...>` instead of `optional` and then report the error in the caller.

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


More information about the llvm-commits mailing list