'append_cmd' should split its argument.
authorMikhail Glushenkov <foldr@codedgers.com>
Fri, 27 Feb 2009 06:46:55 +0000 (06:46 +0000)
committerMikhail Glushenkov <foldr@codedgers.com>
Fri, 27 Feb 2009 06:46:55 +0000 (06:46 +0000)
Makes '(append_cmd "-foo a b c")' work.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65623 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/LLVMCConfigurationEmitter.cpp

index fc166ef30934501af858a9ed02962e82bc8f1b8f..bb4321c9b4019831bfce506d65c74f5dbc055207 100644 (file)
@@ -1422,7 +1422,12 @@ class EmitActionHandler {
     if (ActionName == "append_cmd") {
       checkNumberOfArguments(&Dag, 1);
       const std::string& Cmd = InitPtrToString(Dag.getArg(0));
-      O << IndentLevel << "vec.push_back(\"" << Cmd << "\");\n";
+      StrVector Out;
+      llvm::SplitString(Cmd, Out);
+
+      for (StrVector::const_iterator B = Out.begin(), E = Out.end();
+           B != E; ++B)
+        O << IndentLevel << "vec.push_back(\"" << *B << "\");\n";
     }
     else if (ActionName == "error") {
       O << IndentLevel << "throw std::runtime_error(\"" <<