diff options
author | Brian Gaeke <gaeke@uiuc.edu> | 2004-05-04 21:09:01 +0000 |
---|---|---|
committer | Brian Gaeke <gaeke@uiuc.edu> | 2004-05-04 21:09:01 +0000 |
commit | d11577b68b442217153ecbcc93b978a5a700a8ed (patch) | |
tree | 10d362f218bf02515b6ef706d9a250df3d8a1a8c /include | |
parent | bbc130d1107aedc3a919f7ec794d9236c09d4bad (diff) | |
download | external_llvm-d11577b68b442217153ecbcc93b978a5a700a8ed.zip external_llvm-d11577b68b442217153ecbcc93b978a5a700a8ed.tar.gz external_llvm-d11577b68b442217153ecbcc93b978a5a700a8ed.tar.bz2 |
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.
Also, make -debug-only=toolrunner work for the LLC and CBE
AbstractInterpreters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13356 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Support/ToolRunner.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/include/llvm/Support/ToolRunner.h b/include/llvm/Support/ToolRunner.h index 9cbbf7f..36cb976 100644 --- a/include/llvm/Support/ToolRunner.h +++ b/include/llvm/Support/ToolRunner.h @@ -80,14 +80,18 @@ public: /// 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 @@ struct AbstractInterpreter { // 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,13 +154,16 @@ public: // 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 /// the code generator. If the code generator fails, an exception should be |