diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2025-10-15 09:24:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-15 09:24:36 -0700 |
commit | 9deba01c1d5db607da5b943bd5a6185384608605 (patch) | |
tree | 09bf4de993552d23cb93127acbdf71c87daf26b1 /llvm/tools/llvm-ml/llvm-ml.cpp | |
parent | 097f1e7625966673b881df63a241f755317b0bb9 (diff) | |
download | llvm-9deba01c1d5db607da5b943bd5a6185384608605.zip llvm-9deba01c1d5db607da5b943bd5a6185384608605.tar.gz llvm-9deba01c1d5db607da5b943bd5a6185384608605.tar.bz2 |
[support] Use VFS in `SourceMgr` for loading includes (#162903)
Most `SourceMgr` clients don't make use of include files, but those that
do might want to specify the file system to use. This patch enables that
by making it possible to pass a `vfs::FileSystem` instance into
`SourceMgr`.
Diffstat (limited to 'llvm/tools/llvm-ml/llvm-ml.cpp')
-rw-r--r-- | llvm/tools/llvm-ml/llvm-ml.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/tools/llvm-ml/llvm-ml.cpp b/llvm/tools/llvm-ml/llvm-ml.cpp index cda86e7..7b88576 100644 --- a/llvm/tools/llvm-ml/llvm-ml.cpp +++ b/llvm/tools/llvm-ml/llvm-ml.cpp @@ -41,6 +41,7 @@ #include "llvm/Support/SourceMgr.h" #include "llvm/Support/TargetSelect.h" #include "llvm/Support/ToolOutputFile.h" +#include "llvm/Support/VirtualFileSystem.h" #include "llvm/Support/WithColor.h" #include "llvm/TargetParser/Host.h" #include <ctime> @@ -313,6 +314,7 @@ int llvm_ml_main(int Argc, char **Argv, const llvm::ToolContext &) { } } SrcMgr.setIncludeDirs(IncludeDirs); + SrcMgr.setVirtualFileSystem(vfs::getRealFileSystem()); std::unique_ptr<MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TheTriple)); assert(MRI && "Unable to create target register info!"); |