summaryrefslogtreecommitdiffstats
path: root/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/examples/Kaleidoscope/Chapter7/toy.cpp')
-rw-r--r--llvm/examples/Kaleidoscope/Chapter7/toy.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
index 48d24c0508d..c2c337c9008 100644
--- a/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter7/toy.cpp
@@ -1113,7 +1113,8 @@ int main() {
// Set up the optimizer pipeline. Start with registering info about how the
// target lays out data structures.
- OurFPM.add(new DataLayoutPass(*TheExecutionEngine->getDataLayout()));
+ TheModule->setDataLayout(TheExecutionEngine->getDataLayout());
+ OurFPM.add(new DataLayoutPass(TheModule));
// Provide basic AliasAnalysis support for GVN.
OurFPM.add(createBasicAliasAnalysisPass());
// Promote allocas to registers.
OpenPOWER on IntegriCloud