diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-15 00:10:50 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-04-15 00:10:50 +0000 |
commit | 657aad675aaa9a9283809d4e7d357099ead3316a (patch) | |
tree | f50fdefe3b7aa8fd5f076f61f6dda0eb8395b24e /tools | |
parent | d01ee74ffad023328d7fc04c24238605e1935270 (diff) |
uselistorder: Pull the bit through WriteToBitcodFile()
Change the callers of `WriteToBitcodeFile()` to pass `true` or
`shouldPreserveBitcodeUseListOrder()` explicitly. I left the callers
that want to send `false` alone.
I'll keep pushing the bit higher until hopefully I can delete the global
`cl::opt` entirely.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bugpoint/OptimizerDriver.cpp | 5 | ||||
-rw-r--r-- | tools/gold/gold-plugin.cpp | 5 | ||||
-rw-r--r-- | tools/llvm-as/llvm-as.cpp | 2 | ||||
-rw-r--r-- | tools/llvm-link/llvm-link.cpp | 3 | ||||
-rw-r--r-- | tools/verify-uselistorder/verify-uselistorder.cpp | 6 |
5 files changed, 10 insertions, 11 deletions
diff --git a/tools/bugpoint/OptimizerDriver.cpp b/tools/bugpoint/OptimizerDriver.cpp index 481f343c98..3ac263c6de 100644 --- a/tools/bugpoint/OptimizerDriver.cpp +++ b/tools/bugpoint/OptimizerDriver.cpp @@ -20,6 +20,7 @@ #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" @@ -55,7 +56,7 @@ namespace { /// file. If an error occurs, true is returned. /// static bool writeProgramToFileAux(tool_output_file &Out, const Module *M) { - WriteBitcodeToFile(M, Out.os()); + WriteBitcodeToFile(M, Out.os(), shouldPreserveBitcodeUseListOrder()); Out.os().close(); if (!Out.os().has_error()) { Out.keep(); @@ -151,7 +152,7 @@ bool BugDriver::runPasses(Module *Program, tool_output_file InFile(InputFilename, InputFD); - WriteBitcodeToFile(Program, InFile.os()); + WriteBitcodeToFile(Program, InFile.os(), shouldPreserveBitcodeUseListOrder()); InFile.os().close(); if (InFile.os().has_error()) { errs() << "Error writing bitcode file: " << InputFilename << "\n"; diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index 2c7bf5a64e..31a9b950ce 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -734,12 +734,13 @@ static void runLTOPasses(Module &M, TargetMachine &TM) { passes.run(M); } -static void saveBCFile(StringRef Path, Module &M) { +static void saveBCFile(StringRef Path, Module &M, + bool ShouldPreserveUseListOrder) { std::error_code EC; raw_fd_ostream OS(Path, EC, sys::fs::OpenFlags::F_None); if (EC) message(LDPL_FATAL, "Failed to write the output file."); - WriteBitcodeToFile(&M, OS); + WriteBitcodeToFile(&M, OS, /* ShouldPreserveUseListOrder */ true); } static void codegen(Module &M) { diff --git a/tools/llvm-as/llvm-as.cpp b/tools/llvm-as/llvm-as.cpp index ae8ca569fd..1d48596a24 100644 --- a/tools/llvm-as/llvm-as.cpp +++ b/tools/llvm-as/llvm-as.cpp @@ -79,7 +79,7 @@ static void WriteOutputFile(const Module *M) { } if (Force || !CheckBitcodeOutputToConsole(Out->os(), true)) - WriteBitcodeToFile(M, Out->os()); + WriteBitcodeToFile(M, Out->os(), shouldPreserveBitcodeUseListOrder()); // Declare success. Out->keep(); diff --git a/tools/llvm-link/llvm-link.cpp b/tools/llvm-link/llvm-link.cpp index 5f1dccb378..daffec9371 100644 --- a/tools/llvm-link/llvm-link.cpp +++ b/tools/llvm-link/llvm-link.cpp @@ -152,7 +152,8 @@ int main(int argc, char **argv) { if (OutputAssembly) { Out.os() << *Composite; } else if (Force || !CheckBitcodeOutputToConsole(Out.os(), true)) - WriteBitcodeToFile(Composite.get(), Out.os()); + WriteBitcodeToFile(Composite.get(), Out.os(), + shouldPreserveBitcodeUseListOrder()); // Declare success. Out.keep(); diff --git a/tools/verify-uselistorder/verify-uselistorder.cpp b/tools/verify-uselistorder/verify-uselistorder.cpp index c88df1c666..9d297fa030 100644 --- a/tools/verify-uselistorder/verify-uselistorder.cpp +++ b/tools/verify-uselistorder/verify-uselistorder.cpp @@ -131,7 +131,7 @@ bool TempFile::writeBitcode(const Module &M) const { return true; } - WriteBitcodeToFile(&M, OS); + WriteBitcodeToFile(&M, OS, /* ShouldPreserveUseListOrder */ true); return false; } @@ -542,10 +542,6 @@ int main(int argc, char **argv) { outs() << "*** verify-uselistorder ***\n"; // Can't verify if order isn't preserved. - if (!shouldPreserveBitcodeUseListOrder()) { - errs() << "warning: forcing -preserve-bc-uselistorder\n"; - setPreserveBitcodeUseListOrder(true); - } if (!shouldPreserveAssemblyUseListOrder()) { errs() << "warning: forcing -preserve-ll-uselistorder\n"; setPreserveAssemblyUseListOrder(true); |