================ @@ -2221,33 +2222,45 @@ class ASTReader return Sema::AlignPackInfo::getFromRawEncoding(Raw); } + using RawLocEncoding = SourceLocationEncoding::RawLocEncoding; + /// Read a source location from raw form and return it in its /// originating module file's source location space. - SourceLocation ReadUntranslatedSourceLocation(SourceLocation::UIntTy Raw, - LocSeq *Seq = nullptr) const { + std::pair<SourceLocation, unsigned> + ReadUntranslatedSourceLocation(RawLocEncoding Raw, + LocSeq *Seq = nullptr) const { return SourceLocationEncoding::decode(Raw, Seq); } /// Read a source location from raw form. - SourceLocation ReadSourceLocation(ModuleFile &ModuleFile, - SourceLocation::UIntTy Raw, - LocSeq *Seq = nullptr) const { - SourceLocation Loc = ReadUntranslatedSourceLocation(Raw, Seq); - return TranslateSourceLocation(ModuleFile, Loc); + SourceLocation ReadSourceLocation(ModuleFile &MF, RawLocEncoding Raw, + LocSeq *Seq = nullptr) const { + if (!MF.ModuleOffsetMap.empty()) + ReadModuleOffsetMap(MF); + + auto [Loc, ModuleFileIndex] = ReadUntranslatedSourceLocation(Raw, Seq); + ModuleFile *OwningModuleFile = + ModuleFileIndex == 0 ? &MF : MF.DependentModules[ModuleFileIndex - 1]; + + assert(!SourceMgr.isLoadedSourceLocation(Loc) && "Run out source location space"); ---------------- jansvoboda11 wrote:
What does `Loc` being invalid has to do with this? https://github.com/llvm/llvm-project/pull/86912 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits