================ @@ -1911,6 +1911,20 @@ SourceManager::getDecomposedIncludedLoc(FileID FID) const { return DecompLoc; } +FileID SourceManager::getFirstFIDOfLoadedAST(SourceLocation Loc) const { + assert(isLoadedSourceLocation(Loc) && + "Must be a source location in a loaded PCH/Module file"); + + auto [FID, Ignore] = getDecomposedLoc(Loc); + const FileID *FirstFID = + llvm::lower_bound(LoadedSLocEntryAllocBegin, FID, std::greater<FileID>{}); ---------------- haoNoQ wrote:
This is quite magical to me because I don't understand how FileIDs are assigned and in what order they show up in the `LoadedSLocEntryAllocBegin` list. But that's probably ok, this looks like completely normal `SourceManager` code to me. https://github.com/llvm/llvm-project/pull/92031 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits