[llvm-commits] [dragonegg] r150175 - /dragonegg/trunk/include/dragonegg/Internals.h

David Blaikie dblaikie at gmail.com
Thu Feb 9 08:26:14 PST 2012


On Thu, Feb 9, 2012 at 8:22 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi David, it is needed:
>
>
>>> --- dragonegg/trunk/include/dragonegg/Internals.h (original)
>>> +++ dragonegg/trunk/include/dragonegg/Internals.h Thu Feb  9 08:30:58
>>> 2012
>>> @@ -109,8 +109,8 @@
>>>  /// DieAbjectly - An unrecoverable fatal error occurred - throw in the
>>> towel,
>>>  /// give up the ghost, quit miserably.
>>>  inline void LLVM_ATTRIBUTE_NORETURN DieAbjectly(const char *Message) {
>>> -  llvm_unreachable(Message);
>>>   (void)Message; // Avoid unused variable warning when assertions are
>>> disabled.
>>
>>
>> does this actually need to be here at all? I didn't think
>> llvm_unreachable compiled down to nothing when assertions are
>> disabled...
>
>
> #elif defined(LLVM_BUILTIN_UNREACHABLE)
> #define llvm_unreachable(msg) LLVM_BUILTIN_UNREACHABLE
>
> ^ no use of msg in this case.

Right - guess I just haven't done a llvm_unreachable with anything
other than a literal before.

> That said, maybe there should be a (void)msg in this definition of
> llvm_unreachable just to suppress this kind of warning.

Quite possibly - hardly seems like it'd be onerous & what you've got
is probably the only use of an llvm_unreachable that doesn't take a
literal string anyway (so it's not likely to cause weirdness in otehr
use cases)

- David




More information about the llvm-commits mailing list