[PATCH] D11110: Make ExecutionEngine owning a DataLayout

Eric Christopher echristo at gmail.com
Fri Jul 10 18:13:45 PDT 2015


echristo accepted this revision.
echristo added a reviewer: echristo.
echristo added a comment.
This revision is now accepted and ready to land.

Some inline comments here. Can be fixed up and then committed.

-eric


================
Comment at: lib/ExecutionEngine/MCJIT/MCJIT.cpp:71
@@ -70,4 +70,3 @@
              std::shared_ptr<RuntimeDyld::SymbolResolver> Resolver)
-    : ExecutionEngine(std::move(M)), TM(std::move(tm)), Ctx(nullptr),
-      MemMgr(std::move(MemMgr)), Resolver(*this, std::move(Resolver)),
-      Dyld(*this->MemMgr, this->Resolver), ObjCache(nullptr) {
+    : ExecutionEngine(*TM->getDataLayout(), std::move(M)), TM(std::move(TM)),
+      Ctx(nullptr), MemMgr(std::move(MemMgr)),
----------------
Grab the DataLayout off the Module here?

================
Comment at: lib/ExecutionEngine/MCJIT/MCJIT.cpp:196-200
@@ -195,3 +195,7 @@
 
-  M->setDataLayout(*TM->getDataLayout());
+  if (M->getDataLayout().isDefault()) {
+    M->setDataLayout(getDataLayout());
+  } else {
+    assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");
+  }
 
----------------
No braces, could also use a comment.

================
Comment at: lib/ExecutionEngine/Orc/OrcMCJITReplacement.h:155-159
@@ -155,5 +154,7 @@
     // default.
-    if (M->getDataLayout().isDefault())
-      M->setDataLayout(*getDataLayout());
-
+    if (M->getDataLayout().isDefault()) {
+      M->setDataLayout(getDataLayout());
+    } else {
+      assert(M->getDataLayout() == getDataLayout() && "DataLayout Mismatch");
+    }
     Modules.push_back(std::move(M));
----------------
No braces here. 


http://reviews.llvm.org/D11110







More information about the llvm-commits mailing list