switch the llvm emitter to ASTConsumer interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42013 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 7301354..4051806 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -870,9 +870,11 @@
     ParseAST(PP, MainFileID, *C.get(), Stats);
     break;
   }
-  case EmitLLVM:
-    EmitLLVMFromASTs(PP, MainFileID, Stats);
+  case EmitLLVM: {
+    std::auto_ptr<ASTConsumer> C(CreateLLVMEmitter(PP.getDiagnostics()));
+    ParseAST(PP, MainFileID, *C.get(), Stats);
     break;
+  }
   case ParseASTCheck:
     exit(CheckDiagnostics(PP, MainFileID));
     break;