This is an archive of the discontinued LLVM Phabricator instance.

Make ExecutionEngine owning a DataLayout
ClosedPublic

Authored by mehdi_amini on Jul 10 2015, 3:13 PM.

Details

Summary

This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

The ExecutionEngine is a bit of an exception because it needs a
DataLayout for the purpose of name mangling based on string. Since
no type or other pointer to LLVM internal is involved, it is safe
for it to be reused here across multiple modules.

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to Make ExecutionEngine owning a DataLayout.
mehdi_amini updated this object.
mehdi_amini added a reviewer: lhames.

Update the comment: it is *not* safe to reuse an ExecutionEngine across
context.

echristo accepted this revision.Jul 10 2015, 6:13 PM
echristo added a reviewer: echristo.

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

-eric

lib/ExecutionEngine/MCJIT/MCJIT.cpp
71–74

Grab the DataLayout off the Module here?

196–201

No braces, could also use a comment.

lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
155–160

No braces here.

This revision is now accepted and ready to land.Jul 10 2015, 6:13 PM
mehdi_amini added inline comments.Jul 11 2015, 8:23 PM
lib/ExecutionEngine/MCJIT/MCJIT.cpp
71–74

Since the Module DL can be the default one and it will be overridden with the one of the TargetMachine later and before processing, we really don't want to get the one from the Module here.

lhames accepted this revision.Jul 13 2015, 10:36 AM
lhames edited edge metadata.

LGTM. Thanks Mehdi!