[llvm-commits] [llvm] r51750 - in /llvm/trunk: test/LLVMC/sink.c utils/TableGen/LLVMCConfigurationEmitter.cpp

Mikhail Glushenkov foldr at codedgers.com
Thu May 29 23:23:29 PDT 2008


Author: foldr
Date: Fri May 30 01:23:29 2008
New Revision: 51750

URL: http://llvm.org/viewvc/llvm-project?rev=51750&view=rev
Log:
Fix: 'sink' handling was broken.

Added:
    llvm/trunk/test/LLVMC/sink.c
Modified:
    llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp

Added: llvm/trunk/test/LLVMC/sink.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LLVMC/sink.c?rev=51750&view=auto

==============================================================================
--- llvm/trunk/test/LLVMC/sink.c (added)
+++ llvm/trunk/test/LLVMC/sink.c Fri May 30 01:23:29 2008
@@ -0,0 +1,12 @@
+/*
+ * Check that the 'sink' options work.
+ * RUN: llvmc2 -v -Wall %s -o %t |& grep "Wall"
+ * RUN: ./%t | grep hello
+ */
+
+#include <stdio.h>
+
+int main() {
+    printf("hello\n");
+    return 0;
+}

Modified: llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp?rev=51750&r1=51749&r2=51750&view=diff

==============================================================================
--- llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/LLVMCConfigurationEmitter.cpp Fri May 30 01:23:29 2008
@@ -1015,10 +1015,10 @@
       O << "vec.push_back(\"" << cmd << "\");\n";
     }
   }
-  O << IndentLevel << "ret = Action("
+  O << IndentLevel << "cmd = "
     << ((StrVec[0][0] == '$') ? SubstituteSpecialCommands(StrVec[0])
         : "\"" + StrVec[0] + "\"")
-    << ", vec);\n";
+    << ";\n";
 }
 
 /// EmitCmdLineVecFillCallback - A function object wrapper around
@@ -1052,7 +1052,7 @@
   O << Indent2 << "const sys::Path& outFile,\n"
     << Indent2 << "const InputLanguagesSet& InLangs) const\n"
     << Indent1 << "{\n"
-    << Indent2 << "Action ret;\n"
+    << Indent2 << "std::string cmd;\n"
     << Indent2 << "std::vector<std::string> vec;\n";
 
   // cmd_line is either a string or a 'case' construct.
@@ -1078,7 +1078,7 @@
       << Indent2 << "}\n";
   }
 
-  O << Indent2 << "return ret;\n"
+  O << Indent2 << "return Action(cmd, vec);\n"
     << Indent1 << "}\n\n";
 }
 
@@ -1214,7 +1214,7 @@
 {
   std::vector<GlobalOptionDescription> Aliases;
 
-  // Emit static cl::Option variables
+  // Emit static cl::Option variables.
   for (GlobalOptionDescriptions::const_iterator B = descs.begin(),
          E = descs.end(); B!=E; ++B) {
     const GlobalOptionDescription& val = B->second;





More information about the llvm-commits mailing list