diff options
author | Jan Svoboda <jan_svoboda@apple.com> | 2025-09-18 11:07:40 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-18 11:07:40 -0700 |
commit | cda542dd21eb550c58b398f1a47216ed55edf72d (patch) | |
tree | c9399fc7a04b54656bbf5c2f202ff6dc8c99f761 /clang/lib/Frontend/ASTUnit.cpp | |
parent | b59af5cc9c7f6794a51db189521cad22d97a1605 (diff) | |
download | llvm-cda542dd21eb550c58b398f1a47216ed55edf72d.zip llvm-cda542dd21eb550c58b398f1a47216ed55edf72d.tar.gz llvm-cda542dd21eb550c58b398f1a47216ed55edf72d.tar.bz2 |
[clang] Pass VFS into `ASTUnit::LoadFromASTFile()` (#159166)
This PR makes the `VFS` parameter to `ASTUnit::LoadFromASTFile()`
required and explicit, rather than silently defaulting to the real file
system. This makes it easy to correctly propagate the fully-configured
VFS and load any input files like the rest of the compiler does.
Diffstat (limited to 'clang/lib/Frontend/ASTUnit.cpp')
-rw-r--r-- | clang/lib/Frontend/ASTUnit.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Frontend/ASTUnit.cpp b/clang/lib/Frontend/ASTUnit.cpp index 8b35af1..cb44568 100644 --- a/clang/lib/Frontend/ASTUnit.cpp +++ b/clang/lib/Frontend/ASTUnit.cpp @@ -808,12 +808,13 @@ void ASTUnit::ConfigureDiags(IntrusiveRefCntPtr<DiagnosticsEngine> Diags, std::unique_ptr<ASTUnit> ASTUnit::LoadFromASTFile( StringRef Filename, const PCHContainerReader &PCHContainerRdr, - WhatToLoad ToLoad, std::shared_ptr<DiagnosticOptions> DiagOpts, + WhatToLoad ToLoad, IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS, + std::shared_ptr<DiagnosticOptions> DiagOpts, IntrusiveRefCntPtr<DiagnosticsEngine> Diags, const FileSystemOptions &FileSystemOpts, const HeaderSearchOptions &HSOpts, const LangOptions *LangOpts, bool OnlyLocalDecls, CaptureDiagsKind CaptureDiagnostics, bool AllowASTWithCompilerErrors, - bool UserFilesAreVolatile, IntrusiveRefCntPtr<llvm::vfs::FileSystem> VFS) { + bool UserFilesAreVolatile) { std::unique_ptr<ASTUnit> AST(new ASTUnit(true)); // Recover resources if we crash before exiting this method. |