diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-15 03:14:06 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-15 03:14:06 +0000 |
commit | 8a7b84b4d042ea68342cf6cec87c35aeff7bf106 (patch) | |
tree | 955f1a28b9cfd361335f2abb80687920e692f91d /llvm/tools/bugpoint/OptimizerDriver.cpp | |
parent | fda02091e615ef5bfd24b96894aef72d674cfaaf (diff) | |
download | bcm5719-llvm-8a7b84b4d042ea68342cf6cec87c35aeff7bf106.tar.gz bcm5719-llvm-8a7b84b4d042ea68342cf6cec87c35aeff7bf106.zip |
uselistorder: Remove the global bits
Remove all the global bits to do with preserving use-list order by
moving the `cl::opt`s to the individual tools that want them. There's a
minor functionality change to `libLTO`, in that you can't send in
`-preserve-bc-uselistorder=false`, but making that bit settable (if it's
worth doing) should be through explicit LTO API.
As a drive-by fix, I removed some includes of `UseListOrder.h` that were
made unnecessary by recent commits.
llvm-svn: 234973
Diffstat (limited to 'llvm/tools/bugpoint/OptimizerDriver.cpp')
-rw-r--r-- | llvm/tools/bugpoint/OptimizerDriver.cpp | 10 |
1 files changed, 7 insertions, 3 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"; |