Revert "Remove access to the DataLayout in the TargetMachine"
[oota-llvm.git] / examples / Kaleidoscope / Orc / fully_lazy / toy.cpp
index b68f807e3e7af29289e154baf9a565d82fad6dbc..c9b2c6af56588b625f3c2e68fb1579fb71b476e8 100644 (file)
@@ -717,7 +717,7 @@ public:
       M(new Module(GenerateUniqueName("jit_module_"),
                    Session.getLLVMContext())),
       Builder(Session.getLLVMContext()) {
-    M->setDataLayout(Session.getTarget().createDataLayout());
+    M->setDataLayout(*Session.getTarget().getDataLayout());
   }
 
   SessionContext& getSession() { return Session; }
@@ -1179,7 +1179,7 @@ public:
     {
       raw_string_ostream MangledNameStream(MangledName);
       Mangler::getNameWithPrefix(MangledNameStream, Name,
-                                 Session.getTarget().createDataLayout());
+                                 *Session.getTarget().getDataLayout());
     }
     return MangledName;
   }