[llvm] r211254 - Convert some assert(0) to llvm_unreachable or fold an 'if' condition into the assert.

Alp Toker alp at nuanti.com
Thu Jun 19 11:16:44 PDT 2014


Okay, sounds like the strings are a keeper.

Alp.

On 19/06/2014 21:01, Eric Christopher wrote:
> On Thu, Jun 19, 2014 at 10:21 AM, Reid Kleckner <rnk at google.com> wrote:
>> On Thu, Jun 19, 2014 at 9:28 AM, Duncan P. N. Exon Smith
>> <dexonsmith at apple.com> wrote:
>>>
>>>> On 2014-Jun-19, at 00:03, Alp Toker <alp at nuanti.com> wrote:
>>>>
>>>>
>>>> On 19/06/2014 09:10, Craig Topper wrote:
>>>>> Author: ctopper
>>>>> Date: Thu Jun 19 01:10:58 2014
>>>>> New Revision: 211254
>>>>>
>>>>> URL: http://llvm.org/viewvc/llvm-project?rev=211254&view=rev
>>>>> Log:
>>>>> Convert some assert(0) to llvm_unreachable or fold an 'if' condition
>>>>> into the assert.
>>>>
>>>> Hi Craig,
>>>>
>>>> While working on this commit did you get a feel for whether we could get
>>>> rid of the llvm_unreachable() string parameter?
>>>>
>>>> The llvm_unreachable("Unexpected enum value/XYZ") messages always looked
>>>> less-than-useful to me. Unlike asserts they get used in places that are
>>>> genuinely unreachable, even used as an optimisation hint in release builds.
>>>> As a result the strings are seldom seen, making the small but conscious
>>>> effort it takes to write them somewhat demeaning.
>>>>
>>>> Alp.
>>> They also get used in places that are supposed to be unreachable, but
>>> aren't.  When
>>> we get a crash, I think it's good to know why.
>>>
>>> At least, I appreciate the messages.
>>
>> The message also serves as documentation to the reader about why this
>> particular point is unreachable, so I'd like to keep them.
>>
> Agreed :)
>
> -eric
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

-- 
http://www.nuanti.com
the browser experts




More information about the llvm-commits mailing list