[llvm-commits] CVS: llvm/tools/bugpoint/ExecutionDriver.cpp

Reid Spencer reid at x10sys.com
Mon Jun 5 17:00:56 PDT 2006



Changes in directory llvm/tools/bugpoint:

ExecutionDriver.cpp updated: 1.58 -> 1.59
---
Log message:

Add the -Xlinker option to bugpoint which allows an option to be passed
through to gcc when its being used as a linker. This allows -L and -l
(and any other) options to be added so that non-complete bytecode files
can be processed with bugpoint. The -Xlinker option can be added as many
times as needed.


---
Diffs of the changes:  (+18 -3)

 ExecutionDriver.cpp |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)


Index: llvm/tools/bugpoint/ExecutionDriver.cpp
diff -u llvm/tools/bugpoint/ExecutionDriver.cpp:1.58 llvm/tools/bugpoint/ExecutionDriver.cpp:1.59
--- llvm/tools/bugpoint/ExecutionDriver.cpp:1.58	Sun Jan 22 16:53:40 2006
+++ llvm/tools/bugpoint/ExecutionDriver.cpp	Mon Jun  5 19:00:42 2006
@@ -20,6 +20,7 @@
 #include "llvm/Support/SystemUtils.h"
 #include <fstream>
 #include <iostream>
+
 using namespace llvm;
 
 namespace {
@@ -66,6 +67,10 @@
   TimeoutValue("timeout", cl::init(300), cl::value_desc("seconds"),
                cl::desc("Number of seconds program is allowed to run before it "
                         "is killed (default is 300s), 0 disables timeout"));
+
+  cl::list<std::string>
+    AdditionalLinkerArgs("Xlinker", 
+      cl::desc("Additional arguments to pass to the linker"));
 }
 
 namespace llvm {
@@ -218,9 +223,19 @@
   if (!SharedObj.empty())
     SharedObjs.push_back(SharedObj);
 
-  // Actually execute the program!
-  int RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile,
-                                  OutputFile, SharedObjs, TimeoutValue);
+  
+  // If this is an LLC or CBE run, then the GCC compiler might get run to 
+  // compile the program. If so, we should pass the user's -Xlinker options
+  // as the GCCArgs.
+  int RetVal = 0;
+  if (InterpreterSel == RunLLC || InterpreterSel == RunCBE)
+    RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile,
+                                OutputFile, AdditionalLinkerArgs, SharedObjs, 
+                                TimeoutValue);
+  else 
+    RetVal = AI->ExecuteProgram(BytecodeFile, InputArgv, InputFile,
+                                OutputFile, std::vector<std::string>(), 
+                                SharedObjs, TimeoutValue);
 
   if (RetVal == -1) {
     std::cerr << "<timeout>";






More information about the llvm-commits mailing list