aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/ASTUnitTest.cpp
diff options
context:
space:
mode:
authorSylvestre Ledru <sylvestre@debian.org>2024-11-21 13:04:30 +0100
committerSylvestre Ledru <sylvestre@debian.org>2024-11-21 13:04:30 +0100
commita1153cd6fedd4c906a9840987934ca4712e34cb2 (patch)
tree5b267500546cc06032b49c0153f6aa1e92cbb74c /clang/unittests/Frontend/ASTUnitTest.cpp
parent0b06301a1d839eb5f73559f6c3daf9049c34f3af (diff)
downloadllvm-a1153cd6fedd4c906a9840987934ca4712e34cb2.zip
llvm-a1153cd6fedd4c906a9840987934ca4712e34cb2.tar.gz
llvm-a1153cd6fedd4c906a9840987934ca4712e34cb2.tar.bz2
Revert "[NFC] Explicitly pass a VFS when creating DiagnosticsEngine (#115852)"
Reverted for causing: https://github.com/llvm/llvm-project/issues/117145 This reverts commit bdd10d9d249bd1c2a45e3de56a5accd97e953458.
Diffstat (limited to 'clang/unittests/Frontend/ASTUnitTest.cpp')
-rw-r--r--clang/unittests/Frontend/ASTUnitTest.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/clang/unittests/Frontend/ASTUnitTest.cpp b/clang/unittests/Frontend/ASTUnitTest.cpp
index e6524a0..bd5d5d0 100644
--- a/clang/unittests/Frontend/ASTUnitTest.cpp
+++ b/clang/unittests/Frontend/ASTUnitTest.cpp
@@ -17,7 +17,6 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ToolOutputFile.h"
-#include "llvm/Support/VirtualFileSystem.h"
#include "gtest/gtest.h"
using namespace llvm;
@@ -42,18 +41,17 @@ protected:
const char *Args[] = {"clang", "-xc++", InputFileName.c_str()};
- auto VFS = llvm::vfs::getRealFileSystem();
- Diags = CompilerInstance::createDiagnostics(*VFS, new DiagnosticOptions());
+ Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions());
CreateInvocationOptions CIOpts;
CIOpts.Diags = Diags;
- CIOpts.VFS = VFS;
CInvok = createInvocation(Args, std::move(CIOpts));
if (!CInvok)
return nullptr;
- FileManager *FileMgr = new FileManager(FileSystemOptions(), VFS);
+ FileManager *FileMgr =
+ new FileManager(FileSystemOptions(), vfs::getRealFileSystem());
PCHContainerOps = std::make_shared<PCHContainerOperations>();
return ASTUnit::LoadFromCompilerInvocation(
@@ -136,8 +134,7 @@ TEST_F(ASTUnitTest, ModuleTextualHeader) {
const char *Args[] = {"clang", "test.cpp", "-fmodule-map-file=m.modulemap",
"-fmodule-name=M"};
- Diags =
- CompilerInstance::createDiagnostics(*InMemoryFs, new DiagnosticOptions());
+ Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions());
CreateInvocationOptions CIOpts;
CIOpts.Diags = Diags;
CInvok = createInvocation(Args, std::move(CIOpts));
@@ -165,8 +162,7 @@ TEST_F(ASTUnitTest, LoadFromCommandLineEarlyError) {
const char *Args[] = {"clang", "-target", "foobar", InputFileName.c_str()};
- auto Diags = CompilerInstance::createDiagnostics(
- *llvm::vfs::getRealFileSystem(), new DiagnosticOptions());
+ auto Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions());
auto PCHContainerOps = std::make_shared<PCHContainerOperations>();
std::unique_ptr<clang::ASTUnit> ErrUnit;
@@ -193,8 +189,7 @@ TEST_F(ASTUnitTest, LoadFromCommandLineWorkingDirectory) {
const char *Args[] = {"clang", "-working-directory", WorkingDir.c_str(),
InputFileName.c_str()};
- auto Diags = CompilerInstance::createDiagnostics(
- *llvm::vfs::getRealFileSystem(), new DiagnosticOptions());
+ auto Diags = CompilerInstance::createDiagnostics(new DiagnosticOptions());
auto PCHContainerOps = std::make_shared<PCHContainerOperations>();
std::unique_ptr<clang::ASTUnit> ErrUnit;