diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-09-07 19:26:11 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-09-07 19:26:11 +0000 |
commit | 68ccdaa84909108c42417a8091c771598e26456e (patch) | |
tree | adac575e8da48fbf52512ad9079cba7580225a24 /tools/bugpoint/ExecutionDriver.cpp | |
parent | 59e8efdd5938172e4907afc60d45dbd9cd67c6e1 (diff) | |
download | llvm-68ccdaa84909108c42417a8091c771598e26456e.tar.gz llvm-68ccdaa84909108c42417a8091c771598e26456e.tar.bz2 llvm-68ccdaa84909108c42417a8091c771598e26456e.tar.xz |
Add -output-prefix option to bugpoint (to change the default output name).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81154 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r-- | tools/bugpoint/ExecutionDriver.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tools/bugpoint/ExecutionDriver.cpp b/tools/bugpoint/ExecutionDriver.cpp index 72b9717641..feda331177 100644 --- a/tools/bugpoint/ExecutionDriver.cpp +++ b/tools/bugpoint/ExecutionDriver.cpp @@ -100,6 +100,10 @@ namespace llvm { cl::list<std::string> InputArgv("args", cl::Positional, cl::desc("<program arguments>..."), cl::ZeroOrMore, cl::PositionalEatsArgs); + + cl::opt<std::string> + OutputPrefix("output-prefix", cl::init("bugpoint"), + cl::desc("Prefix to use for outputs (default: 'bugpoint')")); } namespace { @@ -274,7 +278,7 @@ bool BugDriver::initializeExecutionEnvironment() { /// void BugDriver::compileProgram(Module *M) { // Emit the program to a bitcode file... - sys::Path BitcodeFile ("bugpoint-test-program.bc"); + sys::Path BitcodeFile (OutputPrefix + "-test-program.bc"); std::string ErrMsg; if (BitcodeFile.makeUnique(true,&ErrMsg)) { errs() << ToolName << ": Error making unique filename: " << ErrMsg @@ -310,7 +314,7 @@ std::string BugDriver::executeProgram(std::string OutputFile, std::string ErrMsg; if (BitcodeFile.empty()) { // Emit the program to a bitcode file... - sys::Path uniqueFilename("bugpoint-test-program.bc"); + sys::Path uniqueFilename(OutputPrefix + "-test-program.bc"); if (uniqueFilename.makeUnique(true, &ErrMsg)) { errs() << ToolName << ": Error making unique filename: " << ErrMsg << "!\n"; @@ -330,7 +334,7 @@ std::string BugDriver::executeProgram(std::string OutputFile, sys::Path BitcodePath (BitcodeFile); FileRemover BitcodeFileRemover(BitcodePath, CreatedBitcode && !SaveTemps); - if (OutputFile.empty()) OutputFile = "bugpoint-execution-output"; + if (OutputFile.empty()) OutputFile = OutputPrefix + "-execution-output"; // Check to see if this is a valid output filename... sys::Path uniqueFile(OutputFile); |