[clang] [llvm] [mlir] [support] Use VFS in `SourceMgr` for loading includes (PR #162903)
Hideto Ueno via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 21 01:10:56 PDT 2025
================
@@ -378,8 +378,10 @@ struct SourceMgrDiagnosticHandlerImpl {
}
// Otherwise, try to load the source file.
- std::string ignored;
- unsigned id = mgr.AddIncludeFile(std::string(filename), SMLoc(), ignored);
+ auto bufferOrErr = llvm::MemoryBuffer::getFile(filename);
+ if (!bufferOrErr)
+ return 0;
+ unsigned id = mgr.AddNewSourceBuffer(std::move(*bufferOrErr), SMLoc());
filenameToBufId[filename] = id;
----------------
uenoku wrote:
Hello! Is this change intentional? It broke a downstream tool ;) I think a new code doesn't search include directories (and also not using VFS as well?).
https://github.com/llvm/llvm-project/pull/162903
More information about the llvm-commits
mailing list