[llvm-commits] [PATCH] Improve error handling, supersede cerr+abort

Chris Lattner clattner at apple.com
Tue Jul 7 10:16:08 PDT 2009


On Jul 2, 2009, at 12:11 PM, Török Edwin wrote:

> On 2009-07-01 18:02, Daniel Dunbar wrote:
>> 2009/7/1 Török Edwin <edwintorok at gmail.com>:
>>
>>>> We don't need this.  Assertions "can't happen", so assert(0)  
>>>> really is
>>>> unreachable.
>>>>
>>>>
>>> What if assertions are turned off? Should we just remove the calls  
>>> to
>>> abort() after each assert(0)?
>>> I thought the abort()s were there after the assert(0) so that the
>>> compiler knows that the codepaths
>>> never return even with assertions turned off.
>>>
>>
>> The compiler will still know this if we replace such places with a
>> report_error call, and report_error is marked noreturn.
>>
>
> Yes, llvm_report_error  is already marked as noreturn.
>
> Can I commit the patch?

Yes, this looks great, please commit.  Sorry for the delay,

-Chris



More information about the llvm-commits mailing list