Implement -emit-llvm-bc option

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45339 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/clang.cpp b/Driver/clang.cpp
index 91bd117..ddfa8ef4 100644
--- a/Driver/clang.cpp
+++ b/Driver/clang.cpp
@@ -55,6 +55,7 @@
 enum ProgActions {
   RewriteTest,                  // Rewriter testing stuff.
   EmitLLVM,                     // Emit a .ll file.
+  EmitBC,                       // Emit a .bc file.
   SerializeAST,                 // Emit a .ast file.
   ASTPrint,                     // Parse ASTs and print them.
   ASTDump,                      // Parse ASTs and dump them.
@@ -110,6 +111,8 @@
                         "Run prototype serializtion code."),
              clEnumValN(EmitLLVM, "emit-llvm",
                         "Build ASTs then convert to LLVM, emit .ll file"),
+             clEnumValN(EmitBC, "emit-llvm-bc",
+                        "Build ASTs then convert to LLVM, emit .bc file"),
              clEnumValN(SerializeAST, "serialize",
                         "Build ASTs and emit .ast file"),
              clEnumValN(RewriteTest, "rewrite-test",
@@ -925,7 +928,10 @@
       
     case EmitLLVM:
       return CreateLLVMEmitter(Diag, LangOpts);
-      
+
+    case EmitBC:
+      return CreateBCWriter(InFile, OutputFile, Diag, LangOpts);
+
     case SerializeAST:
       // FIXME: Allow user to tailor where the file is written.
       return CreateASTSerializer(InFile, OutputFile, Diag, LangOpts);