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 | a53337f731a6138aeb722c6cab1f4faa3131dfd5 (patch) | |
tree | 284771783b2619027df2f68d285c251f06a8b281 /llvm/tools/bugpoint/ExecutionDriver.cpp | |
parent | 7fcfc4fc31709d11fa5603c7f17b885c2b1e9d90 (diff) | |
download | bcm5719-llvm-a53337f731a6138aeb722c6cab1f4faa3131dfd5.tar.gz bcm5719-llvm-a53337f731a6138aeb722c6cab1f4faa3131dfd5.zip |
Add -output-prefix option to bugpoint (to change the default output name).
llvm-svn: 81154
Diffstat (limited to 'llvm/tools/bugpoint/ExecutionDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/ExecutionDriver.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/tools/bugpoint/ExecutionDriver.cpp b/llvm/tools/bugpoint/ExecutionDriver.cpp index 72b97176419..feda331177b 100644 --- a/llvm/tools/bugpoint/ExecutionDriver.cpp +++ b/llvm/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); |