diff options
Diffstat (limited to 'clang/unittests/Frontend')
-rw-r--r-- | clang/unittests/Frontend/ASTUnitTest.cpp | 6 | ||||
-rw-r--r-- | clang/unittests/Frontend/FrontendActionTest.cpp | 3 | ||||
-rw-r--r-- | clang/unittests/Frontend/PCHPreambleTest.cpp | 2 | ||||
-rw-r--r-- | clang/unittests/Frontend/ReparseWorkingDirTest.cpp | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/clang/unittests/Frontend/ASTUnitTest.cpp b/clang/unittests/Frontend/ASTUnitTest.cpp index 7148ca0..7160453 100644 --- a/clang/unittests/Frontend/ASTUnitTest.cpp +++ b/clang/unittests/Frontend/ASTUnitTest.cpp @@ -55,7 +55,8 @@ protected: if (!CInvok) return nullptr; - FileManager *FileMgr = new FileManager(FileSystemOptions(), VFS); + auto FileMgr = + llvm::makeIntrusiveRefCnt<FileManager>(FileSystemOptions(), VFS); PCHContainerOps = std::make_shared<PCHContainerOperations>(); return ASTUnit::LoadFromCompilerInvocation( @@ -143,7 +144,8 @@ TEST_F(ASTUnitTest, ModuleTextualHeader) { CInvok = createInvocation(Args, std::move(CIOpts)); ASSERT_TRUE(CInvok); - FileManager *FileMgr = new FileManager(FileSystemOptions(), InMemoryFs); + auto FileMgr = + llvm::makeIntrusiveRefCnt<FileManager>(FileSystemOptions(), InMemoryFs); PCHContainerOps = std::make_shared<PCHContainerOperations>(); auto AU = ASTUnit::LoadFromCompilerInvocation( diff --git a/clang/unittests/Frontend/FrontendActionTest.cpp b/clang/unittests/Frontend/FrontendActionTest.cpp index 4e04078..48c0cfd 100644 --- a/clang/unittests/Frontend/FrontendActionTest.cpp +++ b/clang/unittests/Frontend/FrontendActionTest.cpp @@ -244,7 +244,8 @@ TEST(ASTFrontendAction, ExternalSemaSource) { auto *TDC = new TypoDiagnosticConsumer; Compiler.createDiagnostics(*llvm::vfs::getRealFileSystem(), TDC, /*ShouldOwnClient=*/true); - Compiler.setExternalSemaSource(new TypoExternalSemaSource(Compiler)); + Compiler.setExternalSemaSource( + llvm::makeIntrusiveRefCnt<TypoExternalSemaSource>(Compiler)); SyntaxOnlyAction TestAction; ASSERT_TRUE(Compiler.ExecuteAction(TestAction)); diff --git a/clang/unittests/Frontend/PCHPreambleTest.cpp b/clang/unittests/Frontend/PCHPreambleTest.cpp index d27f793..9991838 100644 --- a/clang/unittests/Frontend/PCHPreambleTest.cpp +++ b/clang/unittests/Frontend/PCHPreambleTest.cpp @@ -100,7 +100,7 @@ public: CompilerInstance::createDiagnostics(*VFS, *DiagOpts, new DiagnosticConsumer)); - FileManager *FileMgr = new FileManager(FSOpts, VFS); + auto FileMgr = llvm::makeIntrusiveRefCnt<FileManager>(FSOpts, VFS); std::unique_ptr<ASTUnit> AST = ASTUnit::LoadFromCompilerInvocation( CI, PCHContainerOpts, DiagOpts, Diags, FileMgr, false, diff --git a/clang/unittests/Frontend/ReparseWorkingDirTest.cpp b/clang/unittests/Frontend/ReparseWorkingDirTest.cpp index 38ef468..6b34b96 100644 --- a/clang/unittests/Frontend/ReparseWorkingDirTest.cpp +++ b/clang/unittests/Frontend/ReparseWorkingDirTest.cpp @@ -64,7 +64,8 @@ public: CompilerInstance::createDiagnostics(*VFS, *DiagOpts, new DiagnosticConsumer)); - FileManager *FileMgr = new FileManager(CI->getFileSystemOpts(), VFS); + auto FileMgr = + llvm::makeIntrusiveRefCnt<FileManager>(CI->getFileSystemOpts(), VFS); std::unique_ptr<ASTUnit> AST = ASTUnit::LoadFromCompilerInvocation( CI, PCHContainerOpts, DiagOpts, Diags, FileMgr, false, |