This is an archive of the discontinued LLVM Phabricator instance.

[RS4GC] Replace some asserts by similar code using report_fatal_error().
AbandonedPublic

Authored by mjacob on Jan 8 2016, 7:29 PM.

Details

Reviewers
reames
Summary

I've replaced asserts which check restrictions on the input IR or for
unimplemented cases. The point is to have these checks also in release builds.

Diff Detail

Event Timeline

mjacob updated this revision to Diff 44399.Jan 8 2016, 7:29 PM
mjacob retitled this revision from to [RS4GC] Replace some asserts by similar code using report_fatal_error()..
mjacob updated this object.
mjacob added a reviewer: reames.
mjacob added a subscriber: llvm-commits.
reames edited edge metadata.Jan 11 2016, 5:11 PM

In general, I don't like the idea of this patch. Can you give a specific reason why you want this?

At some point in the future I want to be able to compile the language I'm working on using a stable released version of LLVM, which is usually compiled with assertions disabled. Currently invalid input IR can lead to undefined (or at least unwanted) behaviour if assertions are disabled.

Assertions shouldn't be used for input validation. Instead they should be used for catching programming errors. If you think I've rewritten an assertion that falls into the latter category, we can discuss that, though.

mjacob abandoned this revision.Jan 12 2016, 6:25 PM

Note: there are two more comments on the mailing list which didn't end up showing here.

I'm abandoning this revision because the verifier should be extended to check restrictions on the input IR instead of adding report_fatal_error() in the RS4GC pass.