diff options
author | Bill Wendling <isanbard@gmail.com> | 2009-03-02 23:13:18 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2009-03-02 23:13:18 +0000 |
commit | 38efa38c864f6d29892d92102c0232b234b526ed (patch) | |
tree | d121f75ee3af7dcfdceb4695f4a3c1e8ac445909 /tools/bugpoint/ToolRunner.h | |
parent | 0b82f77e662790ab3c230932f5309c5105812c26 (diff) |
Add a "-gcc-tool-args" option. This option acts like the "-tool-args" option,
but passes the arguments to the "gcc" invocation instead of to the "llc"
invocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65896 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ToolRunner.h')
-rw-r--r-- | tools/bugpoint/ToolRunner.h | 44 |
1 files changed, 28 insertions, 16 deletions
diff --git a/tools/bugpoint/ToolRunner.h b/tools/bugpoint/ToolRunner.h index c7ec1c5da6..721f66c126 100644 --- a/tools/bugpoint/ToolRunner.h +++ b/tools/bugpoint/ToolRunner.h @@ -43,14 +43,19 @@ public: // GCC abstraction // class GCC { - sys::Path GCCPath; // The path to the gcc executable - sys::Path RemoteClientPath; // The path to the rsh / ssh executable - GCC(const sys::Path &gccPath, const sys::Path &RemotePath) - : GCCPath(gccPath), RemoteClientPath(RemotePath) { } + sys::Path GCCPath; // The path to the gcc executable. + sys::Path RemoteClientPath; // The path to the rsh / ssh executable. + std::vector<std::string> gccArgs; // GCC-specific arguments. + GCC(const sys::Path &gccPath, const sys::Path &RemotePath, + const std::vector<std::string> *GCCArgs) + : GCCPath(gccPath), RemoteClientPath(RemotePath) { + if (GCCArgs) gccArgs = *GCCArgs; + } public: enum FileType { AsmFile, CFile }; - static GCC *create(const std::string &ProgramPath, std::string &Message); + static GCC *create(const std::string &ProgramPath, std::string &Message, + const std::vector<std::string> *Args); /// ExecuteProgram - Execute the program specified by "ProgramFile" (which is /// either a .s file, or a .c file, specified by FileType), with the specified @@ -86,9 +91,11 @@ public: class AbstractInterpreter { public: static CBE *createCBE(const std::string &ProgramPath, std::string &Message, - const std::vector<std::string> *Args = 0); + const std::vector<std::string> *Args = 0, + const std::vector<std::string> *GCCArgs = 0); static LLC *createLLC(const std::string &ProgramPath, std::string &Message, - const std::vector<std::string> *Args = 0); + const std::vector<std::string> *Args = 0, + const std::vector<std::string> *GCCArgs = 0); static AbstractInterpreter* createLLI(const std::string &ProgramPath, std::string &Message, @@ -139,14 +146,15 @@ public: // CBE Implementation of AbstractIntepreter interface // class CBE : public AbstractInterpreter { - sys::Path LLCPath; // The path to the `llc' executable - std::vector<std::string> ToolArgs; // Extra args to pass to LLC + sys::Path LLCPath; // The path to the `llc' executable. + std::vector<std::string> ToolArgs; // Extra args to pass to LLC. GCC *gcc; public: CBE(const sys::Path &llcPath, GCC *Gcc, - const std::vector<std::string> *Args) : LLCPath(llcPath), gcc(Gcc) { + const std::vector<std::string> *Args) + : LLCPath(llcPath), gcc(Gcc) { ToolArgs.clear (); - if (Args) { ToolArgs = *Args; } + if (Args) ToolArgs = *Args; } ~CBE() { delete gcc; } @@ -180,14 +188,18 @@ public: // LLC Implementation of AbstractIntepreter interface // class LLC : public AbstractInterpreter { - std::string LLCPath; // The path to the LLC executable - std::vector<std::string> ToolArgs; // Extra args to pass to LLC + std::string LLCPath; // The path to the LLC executable. + std::vector<std::string> ToolArgs; // Extra args to pass to LLC. + std::vector<std::string> gccArgs; // Extra args to pass to GCC. GCC *gcc; public: LLC(const std::string &llcPath, GCC *Gcc, - const std::vector<std::string> *Args) : LLCPath(llcPath), gcc(Gcc) { - ToolArgs.clear (); - if (Args) { ToolArgs = *Args; } + const std::vector<std::string> *Args, + const std::vector<std::string> *GCCArgs) + : LLCPath(llcPath), gcc(Gcc) { + ToolArgs.clear(); + if (Args) ToolArgs = *Args; + if (GCCArgs) gccArgs = *GCCArgs; } ~LLC() { delete gcc; } |