Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
 - Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101354 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
index 990371b..f51bad2 100644
--- a/lib/Frontend/CompilerInvocation.cpp
+++ b/lib/Frontend/CompilerInvocation.cpp
@@ -383,6 +383,10 @@
     Res.push_back("-ast-merge");
     Res.push_back(Opts.ASTMergeFiles[i]);
   }
+  for (unsigned i = 0, e = Opts.LLVMArgs.size(); i != e; ++i) {
+    Res.push_back("-mllvm");
+    Res.push_back(Opts.LLVMArgs[i]);
+  }
 }
 
 static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts,
@@ -955,6 +959,7 @@
   Opts.ShowVersion = Args.hasArg(OPT_version);
   Opts.ViewClassInheritance = getLastArgValue(Args, OPT_cxx_inheritance_view);
   Opts.ASTMergeFiles = getAllArgValues(Args, OPT_ast_merge);
+  Opts.LLVMArgs = getAllArgValues(Args, OPT_mllvm);
 
   FrontendOptions::InputKind DashX = FrontendOptions::IK_None;
   if (const Arg *A = Args.getLastArg(OPT_x)) {