Fix the build of the gold-plugin and examples.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 4 Mar 2015 19:15:29 +0000 (19:15 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 4 Mar 2015 19:15:29 +0000 (19:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@231279 91177308-0d34-0410-b5e6-96231b3b80d8

examples/ExceptionDemo/ExceptionDemo.cpp
examples/Kaleidoscope/Chapter4/toy.cpp
examples/Kaleidoscope/Chapter5/toy.cpp
examples/Kaleidoscope/Chapter6/toy.cpp
examples/Kaleidoscope/Chapter7/toy.cpp
examples/Kaleidoscope/Chapter8/toy.cpp
tools/gold/gold-plugin.cpp

index f6fc03de912f2960a7c48f7213adadf2d821d79b..d68c05f1222979ca5e4f9619021b2d37dc07a912 100644 (file)
@@ -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
index 22e6856784fdaa05e978ae926fa6933b801583ff..329c3bed3ebc3b110da5de7b3384e8b417f2b8bc 100644 (file)
@@ -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.
index e7cab0597d0e6fc3e490469bc2446fe4787ab4b1..8ebc2bc12b22b3e11fe6810d534b084978b16c52 100644 (file)
@@ -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.
index eda39e1b290435a7a21e5d739026a81fc4bfd0a8..eb7e8e1f98254f60f76cc9ca7b28c8649dcd6940 100644 (file)
@@ -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.
index 932290dc596e6ab5b4c99a6d548b5694495200e5..ce5e1ddceb1b83f136e46d069824ce43c7a6e5fb 100644 (file)
@@ -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.
index 3a582e9d1c2fc8eab6dc10465c6f0524459d0555..39b6a6541504a1fbf56dc1095e4e88997297596f 100644 (file)
@@ -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());
index faf2a6b956531184cb01d89878a7da55057fa8c7..f7379ea314abd600b634a22ef82412d8faaae691 100644 (file)
@@ -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;