[PATCH] D16025: [RS4GC] Replace some asserts by similar code using report_fatal_error().

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 12 17:42:53 PST 2016



On 01/11/2016 07:27 PM, Manuel Jacob wrote:
> mjacob added a comment.
>
> 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.
Just to make sure I understand, this is a) possible future use and b) 
specifically for detecting miscompiles?  We generally do not use 
report_fatal_error for (b).  I think doing so here would be a mistake.

Just for the record, you're quite a ways too early for (a).  All of this 
is still highly experimental and likely will be so for a while yet.
>
> 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.
I don't believe any of these asserts are about input validation. They're 
about checking assumptions on the input IR we haven't had any other way 
to express to date.  This isn't quite the same thing. The "right way" to 
express this would be as conditional checks in the verifier keyed off 
either a) the gc attribute, or b) the data layout/address space.  I 
think that instead of treating them like input validation, we should 
figure out to express these properties clearly for the verifier.
>
>
> http://reviews.llvm.org/D16025
>
>
>



More information about the llvm-commits mailing list