Remove access to the DataLayout in the TargetMachine
[oota-llvm.git] / examples / Kaleidoscope / Orc / lazy_codegen / toy.cpp
index 4b4c191171b48a7549cff880ccce15ee8ab925b0..17f9dbb6dfa81184276ebb45dccac9e0fdd5c141 100644 (file)
@@ -716,7 +716,7 @@ public:
       M(new Module(GenerateUniqueName("jit_module_"),
                    Session.getLLVMContext())),
       Builder(Session.getLLVMContext()) {
-    M->setDataLayout(*Session.getTarget().getDataLayout());
+    M->setDataLayout(Session.getTarget().createDataLayout());
   }
 
   SessionContext& getSession() { return Session; }
@@ -1162,7 +1162,7 @@ public:
   typedef LazyEmitLayerT::ModuleSetHandleT ModuleHandleT;
 
   KaleidoscopeJIT(SessionContext &Session)
-      : DL(*Session.getTarget().getDataLayout()),
+      : DL(Session.getTarget().createDataLayout()),
         CompileLayer(ObjectLayer, SimpleCompiler(Session.getTarget())),
         LazyEmitLayer(CompileLayer) {}
 
@@ -1204,7 +1204,7 @@ public:
   }
 
 private:
-  const DataLayout &DL;
+  const DataLayout DL;
   ObjLayerT ObjectLayer;
   CompileLayerT CompileLayer;
   LazyEmitLayerT LazyEmitLayer;