[llvm-commits] [llvm] r81154 - in /llvm/trunk/tools/bugpoint: ExecutionDriver.cpp ExtractFunction.cpp Miscompilation.cpp OptimizerDriver.cpp
Daniel Dunbar
daniel at zuster.org
Mon Sep 7 12:26:11 PDT 2009
Author: ddunbar
Date: Mon Sep 7 14:26:11 2009
New Revision: 81154
URL: http://llvm.org/viewvc/llvm-project?rev=81154&view=rev
Log:
Add -output-prefix option to bugpoint (to change the default output name).
Modified:
llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
llvm/trunk/tools/bugpoint/ExtractFunction.cpp
llvm/trunk/tools/bugpoint/Miscompilation.cpp
llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
Modified: llvm/trunk/tools/bugpoint/ExecutionDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExecutionDriver.cpp?rev=81154&r1=81153&r2=81154&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExecutionDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExecutionDriver.cpp Mon Sep 7 14:26:11 2009
@@ -100,6 +100,10 @@
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 @@
///
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 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 @@
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);
Modified: llvm/trunk/tools/bugpoint/ExtractFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/ExtractFunction.cpp?rev=81154&r1=81153&r2=81154&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/ExtractFunction.cpp (original)
+++ llvm/trunk/tools/bugpoint/ExtractFunction.cpp Mon Sep 7 14:26:11 2009
@@ -37,6 +37,7 @@
namespace llvm {
bool DisableSimplifyCFG = false;
+ extern cl::opt<std::string> OutputPrefix;
} // End llvm namespace
namespace {
@@ -324,7 +325,7 @@
Module *M) {
char *ExtraArg = NULL;
- sys::Path uniqueFilename("bugpoint-extractblocks");
+ sys::Path uniqueFilename(OutputPrefix + "-extractblocks");
std::string ErrMsg;
if (uniqueFilename.createTemporaryFileOnDisk(true, &ErrMsg)) {
outs() << "*** Basic Block extraction failed!\n";
Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=81154&r1=81153&r2=81154&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Mon Sep 7 14:26:11 2009
@@ -30,6 +30,7 @@
using namespace llvm;
namespace llvm {
+ extern cl::opt<std::string> OutputPrefix;
extern cl::list<std::string> InputArgv;
}
@@ -301,12 +302,15 @@
<< " Please report a bug!\n";
errs() << " Continuing on with un-loop-extracted version.\n";
- BD.writeProgramToFile("bugpoint-loop-extract-fail-tno.bc", ToNotOptimize);
- BD.writeProgramToFile("bugpoint-loop-extract-fail-to.bc", ToOptimize);
- BD.writeProgramToFile("bugpoint-loop-extract-fail-to-le.bc",
+ BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-tno.bc",
+ ToNotOptimize);
+ BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to.bc",
+ ToOptimize);
+ BD.writeProgramToFile(OutputPrefix + "-loop-extract-fail-to-le.bc",
ToOptimizeLoopExtracted);
- errs() << "Please submit the bugpoint-loop-extract-fail-*.bc files.\n";
+ errs() << "Please submit the "
+ << OutputPrefix << "-loop-extract-fail-*.bc files.\n";
delete ToOptimize;
delete ToNotOptimize;
delete ToOptimizeLoopExtracted;
Modified: llvm/trunk/tools/bugpoint/OptimizerDriver.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/OptimizerDriver.cpp?rev=81154&r1=81153&r2=81154&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/OptimizerDriver.cpp (original)
+++ llvm/trunk/tools/bugpoint/OptimizerDriver.cpp Mon Sep 7 14:26:11 2009
@@ -37,6 +37,9 @@
#include <fstream>
using namespace llvm;
+namespace llvm {
+ extern cl::opt<std::string> OutputPrefix;
+}
namespace {
// ChildOutput - This option captures the name of the child output file that
@@ -68,7 +71,7 @@
// Output the input to the current pass to a bitcode file, emit a message
// telling the user how to reproduce it: opt -foo blah.bc
//
- std::string Filename = "bugpoint-" + ID + ".bc";
+ std::string Filename = OutputPrefix + "-" + ID + ".bc";
if (writeProgramToFile(Filename)) {
errs() << "Error opening file '" << Filename << "' for writing!\n";
return;
@@ -129,7 +132,7 @@
const char * const *ExtraArgs) const {
// setup the output file name
outs().flush();
- sys::Path uniqueFilename("bugpoint-output.bc");
+ sys::Path uniqueFilename(OutputPrefix + "-output.bc");
std::string ErrMsg;
if (uniqueFilename.makeUnique(true, &ErrMsg)) {
errs() << getToolName() << ": Error making unique filename: "
@@ -139,7 +142,7 @@
OutputFilename = uniqueFilename.str();
// set up the input file name
- sys::Path inputFilename("bugpoint-input.bc");
+ sys::Path inputFilename(OutputPrefix + "-input.bc");
if (inputFilename.makeUnique(true, &ErrMsg)) {
errs() << getToolName() << ": Error making unique filename: "
<< ErrMsg << "\n";
More information about the llvm-commits
mailing list