Page MenuHomePhabricator

[LTO] Reject modules without datalayout

Authored by davide on Nov 23 2016, 4:17 PM.



As per our previous discussion, see for reference.
If you agree on the patch, I'll also update the gold/lld tests failing.

Diff Detail


Event Timeline

davide updated this revision to Diff 79174.Nov 23 2016, 4:17 PM
davide retitled this revision from to [LTO] Reject modules without datalayout .
davide updated this object.
davide added reviewers: mehdi_amini, pcc, rafael.
davide added a subscriber: llvm-commits.
mehdi_amini edited edge metadata.Nov 23 2016, 4:44 PM

We should also handle Datalayout mismatch with what the target expects.

We usually avoid report_fatal_error in libraries.
We should be able to catch this early in the LTO::add(...) method and return an error.

davide updated this revision to Diff 81340.Dec 13 2016, 8:19 PM
davide edited edge metadata.

Prefer Error<T> instead to report_fatal_error()

davide updated this revision to Diff 81341.Dec 13 2016, 8:30 PM

Upload correct diff (setDataLayout() calls removed). Thanks to Mehdi for noticing.

davide updated this revision to Diff 81342.Dec 13 2016, 8:30 PM
mehdi_amini accepted this revision.Dec 13 2016, 8:36 PM
mehdi_amini edited edge metadata.


This revision is now accepted and ready to land.Dec 13 2016, 8:36 PM
This revision was automatically updated to reflect the committed changes.