Simplify the ownership model for DiagnosticClients, which was really
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111437 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/tools/driver/cc1as_main.cpp b/tools/driver/cc1as_main.cpp
index 4620b60..b8f2b68 100644
--- a/tools/driver/cc1as_main.cpp
+++ b/tools/driver/cc1as_main.cpp
@@ -321,9 +321,10 @@
   InitializeAllAsmParsers();
 
   // Construct our diagnostic client.
-  TextDiagnosticPrinter DiagClient(errs(), DiagnosticOptions());
-  DiagClient.setPrefix("clang -cc1as");
-  Diagnostic Diags(&DiagClient);
+  TextDiagnosticPrinter *DiagClient
+    = new TextDiagnosticPrinter(errs(), DiagnosticOptions());
+  DiagClient->setPrefix("clang -cc1as");
+  Diagnostic Diags(DiagClient);
 
   // Set an error handler, so that any LLVM backend diagnostics go through our
   // error handler.