Revert "Remove access to the DataLayout in the TargetMachine"
[oota-llvm.git] / examples / Kaleidoscope / Orc / lazy_irgen / toy.cpp
index 7373c99d543170c6df71b9cef3b7e4e5b3dec143..ca34de7e22449044c8c83a827468d12a8a55fece 100644 (file)
@@ -716,7 +716,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; }
@@ -1170,7 +1170,7 @@ public:
     {
       raw_string_ostream MangledNameStream(MangledName);
       Mangler::getNameWithPrefix(MangledNameStream, Name,
-                                 Session.getTarget().createDataLayout());
+                                 *Session.getTarget().getDataLayout());
     }
     return MangledName;
   }