summaryrefslogtreecommitdiffstats
path: root/llvm/tools/bugpoint
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/bugpoint')
-rw-r--r--llvm/tools/bugpoint/OptimizerDriver.cpp10
-rw-r--r--llvm/tools/bugpoint/bugpoint.cpp5
2 files changed, 7 insertions, 8 deletions
diff --git a/llvm/tools/bugpoint/OptimizerDriver.cpp b/llvm/tools/bugpoint/OptimizerDriver.cpp
index 3ac263c6de9..344e7b588fb 100644
--- a/llvm/tools/bugpoint/OptimizerDriver.cpp
+++ b/llvm/tools/bugpoint/OptimizerDriver.cpp
@@ -20,7 +20,6 @@
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
-#include "llvm/IR/UseListOrder.h"
#include "llvm/IR/Verifier.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
@@ -43,6 +42,11 @@ namespace llvm {
extern cl::opt<std::string> OutputPrefix;
}
+static cl::opt<bool> PreserveBitcodeUseListOrder(
+ "preserve-bc-uselistorder",
+ cl::desc("Preserve use-list order when writing LLVM bitcode."),
+ cl::init(true), cl::Hidden);
+
namespace {
// ChildOutput - This option captures the name of the child output file that
// is set up by the parent bugpoint process
@@ -56,7 +60,7 @@ namespace {
/// file. If an error occurs, true is returned.
///
static bool writeProgramToFileAux(tool_output_file &Out, const Module *M) {
- WriteBitcodeToFile(M, Out.os(), shouldPreserveBitcodeUseListOrder());
+ WriteBitcodeToFile(M, Out.os(), PreserveBitcodeUseListOrder);
Out.os().close();
if (!Out.os().has_error()) {
Out.keep();
@@ -152,7 +156,7 @@ bool BugDriver::runPasses(Module *Program,
tool_output_file InFile(InputFilename, InputFD);
- WriteBitcodeToFile(Program, InFile.os(), shouldPreserveBitcodeUseListOrder());
+ WriteBitcodeToFile(Program, InFile.os(), PreserveBitcodeUseListOrder);
InFile.os().close();
if (InFile.os().has_error()) {
errs() << "Error writing bitcode file: " << InputFilename << "\n";
diff --git a/llvm/tools/bugpoint/bugpoint.cpp b/llvm/tools/bugpoint/bugpoint.cpp
index bb790675d75..0ee3784660a 100644
--- a/llvm/tools/bugpoint/bugpoint.cpp
+++ b/llvm/tools/bugpoint/bugpoint.cpp
@@ -18,7 +18,6 @@
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/LegacyPassNameParser.h"
-#include "llvm/IR/UseListOrder.h"
#include "llvm/LinkAllIR.h"
#include "llvm/LinkAllPasses.h"
#include "llvm/Support/CommandLine.h"
@@ -137,10 +136,6 @@ int main(int argc, char **argv) {
polly::initializePollyPasses(Registry);
#endif
- // Turn on -preserve-bc-uselistorder by default, but let the command-line
- // override it.
- setPreserveBitcodeUseListOrder(true);
-
cl::ParseCommandLineOptions(argc, argv,
"LLVM automatic testcase reducer. See\nhttp://"
"llvm.org/cmds/bugpoint.html"
OpenPOWER on IntegriCloud