From 671944ff8fc9ca8206964d51586a2f541a441262 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Wed, 4 Mar 2015 19:15:29 +0000 Subject: [PATCH] Fix the build of the gold-plugin and examples. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231279 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/ExceptionDemo/ExceptionDemo.cpp | 2 +- examples/Kaleidoscope/Chapter4/toy.cpp | 2 +- examples/Kaleidoscope/Chapter5/toy.cpp | 2 +- examples/Kaleidoscope/Chapter6/toy.cpp | 2 +- examples/Kaleidoscope/Chapter7/toy.cpp | 2 +- examples/Kaleidoscope/Chapter8/toy.cpp | 2 +- tools/gold/gold-plugin.cpp | 4 +--- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/examples/ExceptionDemo/ExceptionDemo.cpp b/examples/ExceptionDemo/ExceptionDemo.cpp index f6fc03de912..d68c05f1222 100644 --- a/examples/ExceptionDemo/ExceptionDemo.cpp +++ b/examples/ExceptionDemo/ExceptionDemo.cpp @@ -1972,7 +1972,7 @@ int main(int argc, char *argv[]) { // Set up the optimizer pipeline. // Start with registering info about how the // target lays out data structures. - module->setDataLayout(executionEngine->getDataLayout()); + module->setDataLayout(*executionEngine->getDataLayout()); // Optimizations turned on #ifdef ADD_OPT_PASSES diff --git a/examples/Kaleidoscope/Chapter4/toy.cpp b/examples/Kaleidoscope/Chapter4/toy.cpp index 22e6856784f..329c3bed3eb 100644 --- a/examples/Kaleidoscope/Chapter4/toy.cpp +++ b/examples/Kaleidoscope/Chapter4/toy.cpp @@ -560,7 +560,7 @@ void *MCJITHelper::getPointerToFunction(Function *F) { // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. - OpenModule->setDataLayout(NewEngine->getDataLayout()); + OpenModule->setDataLayout(*NewEngine->getDataLayout()); // Provide basic AliasAnalysis support for GVN. FPM->add(createBasicAliasAnalysisPass()); // Promote allocas to registers. diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp index e7cab0597d0..8ebc2bc12b2 100644 --- a/examples/Kaleidoscope/Chapter5/toy.cpp +++ b/examples/Kaleidoscope/Chapter5/toy.cpp @@ -913,7 +913,7 @@ int main() { // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. - TheModule->setDataLayout(TheExecutionEngine->getDataLayout()); + TheModule->setDataLayout(*TheExecutionEngine->getDataLayout()); // Provide basic AliasAnalysis support for GVN. OurFPM.add(createBasicAliasAnalysisPass()); // Do simple "peephole" optimizations and bit-twiddling optzns. diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index eda39e1b290..eb7e8e1f982 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -1034,7 +1034,7 @@ int main() { // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. - TheModule->setDataLayout(TheExecutionEngine->getDataLayout()); + TheModule->setDataLayout(*TheExecutionEngine->getDataLayout()); // Provide basic AliasAnalysis support for GVN. OurFPM.add(createBasicAliasAnalysisPass()); // Do simple "peephole" optimizations and bit-twiddling optzns. diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp index 932290dc596..ce5e1ddceb1 100644 --- a/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/examples/Kaleidoscope/Chapter7/toy.cpp @@ -1208,7 +1208,7 @@ int main() { // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. - TheModule->setDataLayout(TheExecutionEngine->getDataLayout()); + TheModule->setDataLayout(*TheExecutionEngine->getDataLayout()); // Provide basic AliasAnalysis support for GVN. OurFPM.add(createBasicAliasAnalysisPass()); // Promote allocas to registers. diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index 3a582e9d1c2..39b6a654150 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -1459,7 +1459,7 @@ int main() { // Set up the optimizer pipeline. Start with registering info about how the // target lays out data structures. - TheModule->setDataLayout(TheExecutionEngine->getDataLayout()); + TheModule->setDataLayout(*TheExecutionEngine->getDataLayout()); #if 0 // Provide basic AliasAnalysis support for GVN. OurFPM.add(createBasicAliasAnalysisPass()); diff --git a/tools/gold/gold-plugin.cpp b/tools/gold/gold-plugin.cpp index faf2a6b9565..f7379ea314a 100644 --- a/tools/gold/gold-plugin.cpp +++ b/tools/gold/gold-plugin.cpp @@ -711,10 +711,9 @@ getModuleForFile(LLVMContext &Context, claimed_file &F, static void runLTOPasses(Module &M, TargetMachine &TM) { if (const DataLayout *DL = TM.getDataLayout()) - M.setDataLayout(DL); + M.setDataLayout(*DL); legacy::PassManager passes; - passes.add(new DataLayoutPass()); passes.add(createTargetTransformInfoWrapperPass(TM.getTargetIRAnalysis())); PassManagerBuilder PMB; @@ -764,7 +763,6 @@ static void codegen(Module &M) { saveBCFile(output_name + ".opt.bc", M); legacy::PassManager CodeGenPasses; - CodeGenPasses.add(new DataLayoutPass()); SmallString<128> Filename; int FD; -- 2.34.1