[PATCH] D11103: Remove access to the DataLayout in the TargetMachine

Lang Hames lhames at gmail.com
Thu Jul 16 13:19:42 PDT 2015


lhames added inline comments.

================
Comment at: lib/LTO/LTOCodeGenerator.cpp:524
@@ -523,3 +523,3 @@
   // Add an appropriate DataLayout instance for this module...
-  mergedModule->setDataLayout(*TargetMach->getDataLayout());
+  mergedModule->setDataLayout(TargetMach->createDataLayout());
 
----------------
joker.eph wrote:
> rafael wrote:
> > I think this is from the days when we supported the module not having a DL. We should probably try to remove it in another patch.
> I'm not very familiar with the JIT use case, but how is the client creating the module? And how can he makes sure that the DL on the module that he will give to the JIT is the one the TargetMachine expects? 
> Is he supposed to keep a reference to the TargetMachine when creating the JIT?
This is LTO code, and the LTO and JIT cases may be different.

Historically the JIT hasn't required a data layout. That seems like a reasonable restriction for us to add, but we'd have to give clients a heads-up first. For now, the JIT code should still set the data layout if there isn't one present.


http://reviews.llvm.org/D11103







More information about the llvm-commits mailing list