diff options
Diffstat (limited to 'clang/unittests/Support/TimeProfilerTest.cpp')
-rw-r--r-- | clang/unittests/Support/TimeProfilerTest.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/unittests/Support/TimeProfilerTest.cpp b/clang/unittests/Support/TimeProfilerTest.cpp index 85d36b5..871c59f 100644 --- a/clang/unittests/Support/TimeProfilerTest.cpp +++ b/clang/unittests/Support/TimeProfilerTest.cpp @@ -46,15 +46,13 @@ std::string teardownProfiler() { bool compileFromString(StringRef Code, StringRef Standard, StringRef File, llvm::StringMap<std::string> Headers = {}) { - llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> FS( - new llvm::vfs::InMemoryFileSystem()); + auto FS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>(); FS->addFile(File, 0, MemoryBuffer::getMemBuffer(Code)); for (const auto &Header : Headers) { FS->addFile(Header.getKey(), 0, MemoryBuffer::getMemBuffer(Header.getValue())); } - llvm::IntrusiveRefCntPtr<FileManager> Files( - new FileManager(FileSystemOptions(), FS)); + auto Files = llvm::makeIntrusiveRefCnt<FileManager>(FileSystemOptions(), FS); auto Invocation = std::make_shared<CompilerInvocation>(); std::vector<const char *> Args = {Standard.data(), File.data()}; @@ -65,7 +63,7 @@ bool compileFromString(StringRef Code, StringRef Standard, StringRef File, CompilerInstance Compiler(std::move(Invocation)); Compiler.createDiagnostics(Files->getVirtualFileSystem()); - Compiler.setFileManager(Files.get()); + Compiler.setFileManager(Files); class TestFrontendAction : public ASTFrontendAction { private: |