Make DataLayout Non-Optional in the Module
[oota-llvm.git] / lib / ExecutionEngine / Orc / OrcMCJITReplacement.h
index 1b7b16187c8589e31626c37e2760e2fc7fb78a3c..00e39bb73c13d435fd1c43613c5dee60ca8a9c4f 100644 (file)
@@ -133,8 +133,8 @@ public:
 
     // If this module doesn't have a DataLayout attached then attach the
     // default.
-    if (!M->getDataLayout())
-      M->setDataLayout(getDataLayout());
+    if (M->getDataLayout().isDefault())
+      M->setDataLayout(*getDataLayout());
 
     Modules.push_back(std::move(M));
     std::vector<Module *> Ms;