aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Driver/SimpleDiagnosticConsumer.h
diff options
context:
space:
mode:
Diffstat (limited to 'clang/unittests/Driver/SimpleDiagnosticConsumer.h')
-rw-r--r--clang/unittests/Driver/SimpleDiagnosticConsumer.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/unittests/Driver/SimpleDiagnosticConsumer.h b/clang/unittests/Driver/SimpleDiagnosticConsumer.h
index c3772ba..7ab409b 100644
--- a/clang/unittests/Driver/SimpleDiagnosticConsumer.h
+++ b/clang/unittests/Driver/SimpleDiagnosticConsumer.h
@@ -42,13 +42,12 @@ struct SimpleDiagnosticConsumer : public clang::DiagnosticConsumer {
// for testing situations where it will only ever be used for emitting
// diagnostics, such as being passed to `MultilibSet::select`.
inline clang::driver::Driver diagnostic_test_driver() {
- llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs> DiagID(
- new clang::DiagnosticIDs());
- llvm::IntrusiveRefCntPtr<llvm::vfs::InMemoryFileSystem> InMemoryFileSystem(
- new llvm::vfs::InMemoryFileSystem);
+ auto InMemoryFileSystem =
+ llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
auto *DiagConsumer = new SimpleDiagnosticConsumer;
clang::DiagnosticOptions DiagOpts;
- clang::DiagnosticsEngine Diags(DiagID, DiagOpts, DiagConsumer);
+ clang::DiagnosticsEngine Diags(clang::DiagnosticIDs::create(), DiagOpts,
+ DiagConsumer);
return clang::driver::Driver("/bin/clang", "", Diags, "", InMemoryFileSystem);
}