This is an archive of the discontinued LLVM Phabricator instance.

Redirect DataLayout from TargetMachine to Module in CodeGen Prepare
ClosedPublic

Authored by mehdi_amini on Jul 6 2015, 11:04 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.

Diff Detail

Event Timeline

mehdi_amini retitled this revision from to Redirect DataLayout from TargetMachine to Module in CodeGen Prepare.
mehdi_amini updated this object.
mehdi_amini added a reviewer: echristo.
mehdi_amini added a subscriber: llvm-commits.
mehdi_amini set the repository for this revision to rL LLVM.Jul 7 2015, 10:22 AM
mehdi_amini added subscribers: rafael, yaron.keren.
echristo accepted this revision.Jul 7 2015, 10:34 AM
echristo edited edge metadata.

One inline comment then LGTM.

Thanks!

-eric

lib/CodeGen/CodeGenPrepare.cpp
314

I think since you've always got a Function here you don't need to explicitly null out the DataLayout member and just set it unconditionally at the beginning of runOnFunction (or if you feel strongly it should probably happen for all of the class members).

This revision is now accepted and ready to land.Jul 7 2015, 10:34 AM