aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Tooling/Syntax/TokensTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Tooling/Syntax/TokensTest.cpp')
-rw-r--r--clang/unittests/Tooling/Syntax/TokensTest.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/clang/unittests/Tooling/Syntax/TokensTest.cpp b/clang/unittests/Tooling/Syntax/TokensTest.cpp
index b5f4445..6094177 100644
--- a/clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ b/clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -133,9 +133,9 @@ public:
CI->getPreprocessorOpts().addRemappedFile(
FileName, llvm::MemoryBuffer::getMemBufferCopy(Code).release());
CompilerInstance Compiler(std::move(CI));
- Compiler.setDiagnostics(Diags.get());
- Compiler.setFileManager(FileMgr.get());
- Compiler.setSourceManager(SourceMgr.get());
+ Compiler.setDiagnostics(Diags);
+ Compiler.setFileManager(FileMgr);
+ Compiler.setSourceManager(SourceMgr);
this->Buffer = TokenBuffer(*SourceMgr);
RecordTokens Recorder(this->Buffer);
@@ -250,13 +250,14 @@ public:
// Data fields.
DiagnosticOptions DiagOpts;
llvm::IntrusiveRefCntPtr<DiagnosticsEngine> Diags =
- new DiagnosticsEngine(new DiagnosticIDs, DiagOpts);
+ llvm::makeIntrusiveRefCnt<DiagnosticsEngine>(DiagnosticIDs::create(),
+ DiagOpts);
IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> FS =
- new llvm::vfs::InMemoryFileSystem;
+ llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
llvm::IntrusiveRefCntPtr<FileManager> FileMgr =
- new FileManager(FileSystemOptions(), FS);
+ llvm::makeIntrusiveRefCnt<FileManager>(FileSystemOptions(), FS);
llvm::IntrusiveRefCntPtr<SourceManager> SourceMgr =
- new SourceManager(*Diags, *FileMgr);
+ llvm::makeIntrusiveRefCnt<SourceManager>(*Diags, *FileMgr);
/// Contains last result of calling recordTokens().
TokenBuffer Buffer = TokenBuffer(*SourceMgr);
};