[llvm-commits] CVS: llvm/include/llvm/Support/ToolRunner.h

Brian Gaeke gaeke at cs.uiuc.edu
Tue May 4 16:09:01 PDT 2004


Changes in directory llvm/include/llvm/Support:

ToolRunner.h updated: 1.11 -> 1.12

---
Log message:

Add "Args" optional argument to AbstractInterpreter factory methods, which
fills in a ToolArgs vector in the AbstractInterpreter if it is set. This
ToolArgs vector is used to pass additional arguments to LLI and/or LLC.
This is intended to address Bug 40: http://llvm.cs.uiuc.edu/PR40 .

Also, make -debug-only=toolrunner work for the LLC and CBE
AbstractInterpreters.


---
Diffs of the changes:  (+20 -8)

Index: llvm/include/llvm/Support/ToolRunner.h
diff -u llvm/include/llvm/Support/ToolRunner.h:1.11 llvm/include/llvm/Support/ToolRunner.h:1.12
--- llvm/include/llvm/Support/ToolRunner.h:1.11	Thu Feb 19 01:39:26 2004
+++ llvm/include/llvm/Support/ToolRunner.h	Tue May  4 16:09:01 2004
@@ -80,14 +80,18 @@
 /// complexity behind a simple interface.
 ///
 struct AbstractInterpreter {
-  static CBE* createCBE(const std::string &ProgramPath, std::string &Message);
-  static LLC *createLLC(const std::string &ProgramPath, std::string &Message);
+  static CBE *createCBE(const std::string &ProgramPath, std::string &Message,
+                        const std::vector<std::string> *Args = 0);
+  static LLC *createLLC(const std::string &ProgramPath, std::string &Message,
+                        const std::vector<std::string> *Args = 0);
 
   static AbstractInterpreter* createLLI(const std::string &ProgramPath,
-                                        std::string &Message);
+                                        std::string &Message,
+                                        const std::vector<std::string> *Args=0);
 
   static AbstractInterpreter* createJIT(const std::string &ProgramPath,
-                                        std::string &Message);
+                                        std::string &Message,
+                                        const std::vector<std::string> *Args=0);
 
 
   virtual ~AbstractInterpreter() {}
@@ -114,9 +118,14 @@
 //
 class CBE : public AbstractInterpreter {
   std::string LLCPath;          // The path to the `llc' executable
+  std::vector<std::string> ToolArgs; // Extra args to pass to LLC
   GCC *gcc;
 public:
-  CBE(const std::string &llcPath, GCC *Gcc) : LLCPath(llcPath), gcc(Gcc) { }
+  CBE(const std::string &llcPath, GCC *Gcc,
+      const std::vector<std::string> *Args) : LLCPath(llcPath), gcc(Gcc) {
+    ToolArgs.clear ();
+    if (Args) { ToolArgs.assign (Args->begin (), Args->end ()); }
+  }
   ~CBE() { delete gcc; }
 
   /// compileProgram - Compile the specified program from bytecode to executable
@@ -145,12 +154,15 @@
 //
 class LLC : public AbstractInterpreter {
   std::string LLCPath;          // The path to the LLC executable
+  std::vector<std::string> ToolArgs; // Extra args to pass to LLC
   GCC *gcc;
 public:
-  LLC(const std::string &llcPath, GCC *Gcc)
-    : LLCPath(llcPath), gcc(Gcc) { }
+  LLC(const std::string &llcPath, GCC *Gcc,
+    const std::vector<std::string> *Args) : LLCPath(llcPath), gcc(Gcc) {
+    ToolArgs.clear ();
+    if (Args) { ToolArgs.assign (Args->begin (), Args->end ()); }
+  }
   ~LLC() { delete gcc; }
-
 
   /// compileProgram - Compile the specified program from bytecode to executable
   /// code.  This does not produce any output, it is only used when debugging





More information about the llvm-commits mailing list