This is an archive of the discontinued LLVM Phabricator instance.

Add a TargetMachine hook that verifies DataLayout compatibility
ClosedPublic

Authored by mehdi_amini on Jul 30 2015, 10:31 AM.

Details

Summary

Also provide the associated assertion when CodeGen starts.

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to Add a TargetMachine hook that verifies DataLayout compatibility.
mehdi_amini updated this object.
mehdi_amini added a reviewer: echristo.
mehdi_amini added a subscriber: llvm-commits.
echristo edited edge metadata.Jul 30 2015, 10:59 AM

This assert will only be valid as long as we create (or can create) a data layout in the backend right?

-eric

include/llvm/Target/TargetMachine.h
138–141

"is used for optimizations and code generation"?
"This hook provides a..."
"The default implementation just checks..." though do we really need a target override here?

mehdi_amini added inline comments.Jul 30 2015, 11:32 AM
include/llvm/Target/TargetMachine.h
138–141

I was not sure for the Target override, can we imagine that a Target is more flexible on the DataLayout requirement? Can it accept variation on some aspects?
If it does not make sense I'll make it non virtual.

echristo added inline comments.Jul 30 2015, 11:42 AM
include/llvm/Target/TargetMachine.h
138–141

Yeah, it makes sense eventually. Maybe not at the moment? Entirely up to you though. :)

mehdi_amini edited edge metadata.

Remove the virtual keyword, we can bring it back when we'll have a use-case

echristo accepted this revision.Jul 30 2015, 12:50 PM
echristo edited edge metadata.

Sorry, meant to accept this earlier. Thanks :)

-eric

This revision is now accepted and ready to land.Jul 30 2015, 12:50 PM
mehdi_amini closed this revision.Jul 30 2015, 4:25 PM
mehdi_amini marked an inline comment as done.

landed