summaryrefslogtreecommitdiffstats
path: root/llvm/tools/opt
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-15 00:34:24 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-04-15 00:34:24 +0000
commit679db3345ce642749cd5fc7181a508982b353022 (patch)
treee96f9726b74843c685c21db1faf88030091a5a85 /llvm/tools/opt
parente406c84e3004530c0fd008f4b1121dcce034f82d (diff)
downloadbcm5719-llvm-679db3345ce642749cd5fc7181a508982b353022.tar.gz
bcm5719-llvm-679db3345ce642749cd5fc7181a508982b353022.zip
uselistorder: Pull bit through BitcodeWriterPass
Now the callers of `BitcodeWriterPass` decide whether or not to preserve bitcode use-list order. llvm-svn: 234959
Diffstat (limited to 'llvm/tools/opt')
-rw-r--r--llvm/tools/opt/NewPMDriver.cpp6
-rw-r--r--llvm/tools/opt/NewPMDriver.h3
-rw-r--r--llvm/tools/opt/opt.cpp6
3 files changed, 10 insertions, 5 deletions
diff --git a/llvm/tools/opt/NewPMDriver.cpp b/llvm/tools/opt/NewPMDriver.cpp
index 9216d5c939a..8d4b279c6f7 100644
--- a/llvm/tools/opt/NewPMDriver.cpp
+++ b/llvm/tools/opt/NewPMDriver.cpp
@@ -39,7 +39,8 @@ static cl::opt<bool>
bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
TargetMachine *TM, tool_output_file *Out,
StringRef PassPipeline, OutputKind OK,
- VerifierKind VK) {
+ VerifierKind VK,
+ bool ShouldPreserveBitcodeUseListOrder) {
PassBuilder PB(TM);
FunctionAnalysisManager FAM(DebugPM);
@@ -80,7 +81,8 @@ bool llvm::runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
MPM.addPass(PrintModulePass(Out->os()));
break;
case OK_OutputBitcode:
- MPM.addPass(BitcodeWriterPass(Out->os()));
+ MPM.addPass(
+ BitcodeWriterPass(Out->os(), ShouldPreserveBitcodeUseListOrder));
break;
}
diff --git a/llvm/tools/opt/NewPMDriver.h b/llvm/tools/opt/NewPMDriver.h
index 5384fe295e1..e9a751da250 100644
--- a/llvm/tools/opt/NewPMDriver.h
+++ b/llvm/tools/opt/NewPMDriver.h
@@ -51,7 +51,8 @@ enum VerifierKind {
bool runPassPipeline(StringRef Arg0, LLVMContext &Context, Module &M,
TargetMachine *TM, tool_output_file *Out,
StringRef PassPipeline, opt_tool::OutputKind OK,
- opt_tool::VerifierKind VK);
+ opt_tool::VerifierKind VK,
+ bool ShouldPreserveBitcodeUseListOrder);
}
#endif
diff --git a/llvm/tools/opt/opt.cpp b/llvm/tools/opt/opt.cpp
index b0951a4887e..8946558d219 100644
--- a/llvm/tools/opt/opt.cpp
+++ b/llvm/tools/opt/opt.cpp
@@ -431,7 +431,8 @@ int main(int argc, char **argv) {
// string. Hand off the rest of the functionality to the new code for that
// layer.
return runPassPipeline(argv[0], Context, *M, TM.get(), Out.get(),
- PassPipeline, OK, VK)
+ PassPipeline, OK, VK,
+ shouldPreserveBitcodeUseListOrder())
? 0
: 1;
}
@@ -594,7 +595,8 @@ int main(int argc, char **argv) {
if (OutputAssembly)
Passes.add(createPrintModulePass(Out->os()));
else
- Passes.add(createBitcodeWriterPass(Out->os()));
+ Passes.add(createBitcodeWriterPass(Out->os(),
+ shouldPreserveBitcodeUseListOrder()));
}
// Before executing passes, print the final values of the LLVM options.
OpenPOWER on IntegriCloud