This is an archive of the discontinued LLVM Phabricator instance.

Use report_fatal_error for unsupported calling conventions
ClosedPublic

Authored by asb on Aug 17 2017, 6:55 AM.

Details

Summary

The calling convention can be specified by the user in IR. Failing to support a particular calling convention isn't a programming error, and so relying on llvm_unreachable to catch and report an unsupported calling convention is not appropriate.

This is a very trivial patch, but given the amount of discussion that has been generated by LLVM error handling in the past I thought it would be worth posting for comments first. In general, are people happy with this sort of cleanup? There are likely many more cases elsewhere in backends where llvm_unreachable should really be replaced by report_fatal_error, or potentially something more advanced.

Diff Detail

Repository
rL LLVM

Event Timeline

asb created this revision.Aug 17 2017, 6:55 AM
t.p.northover edited edge metadata.Aug 21 2017, 1:55 PM

I think it's a reasonable change. llvm_unreachable is clearly problematic.

rengolin edited edge metadata.Aug 21 2017, 2:03 PM

Agreed.

This revision was automatically updated to reflect the committed changes.