summaryrefslogtreecommitdiff
path: root/examples/Kaleidoscope/Chapter5/toy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/Kaleidoscope/Chapter5/toy.cpp')
-rw-r--r--examples/Kaleidoscope/Chapter5/toy.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/Kaleidoscope/Chapter5/toy.cpp b/examples/Kaleidoscope/Chapter5/toy.cpp
index 3f3f0a019c..a31b5b4792 100644
--- a/examples/Kaleidoscope/Chapter5/toy.cpp
+++ b/examples/Kaleidoscope/Chapter5/toy.cpp
@@ -831,7 +831,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());
// Do simple "peephole" optimizations and bit-twiddling optzns.