[llvm] r190304 - Silencing a warning about control flow reaching the end of a non-void function.

Aaron Ballman aaron at aaronballman.com
Mon Sep 9 08:18:32 PDT 2013


That's what I did in r190308  :-)

~Aaron

On Mon, Sep 9, 2013 at 11:03 AM, Duncan Sands <duncan.sands at gmail.com> wrote:
> On 09/09/13 16:34, Aaron Ballman wrote:
>>
>> On Mon, Sep 9, 2013 at 10:20 AM, Duncan Sands <duncan.sands at gmail.com>
>> wrote:
>>>
>>> Hi Aaron,
>>>
>>>
>>> On 09/09/13 15:22, Aaron Ballman wrote:
>>>>
>>>>
>>>> Author: aaronballman
>>>> Date: Mon Sep  9 08:22:45 2013
>>>> New Revision: 190304
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=190304&view=rev
>>>> Log:
>>>> Silencing a warning about control flow reaching the end of a non-void
>>>> function.
>>>>
>>>> Modified:
>>>>       llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp
>>>>
>>>> Modified: llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp
>>>> URL:
>>>>
>>>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp?rev=190304&r1=190303&r2=190304&view=diff
>>>>
>>>>
>>>> ==============================================================================
>>>> --- llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp (original)
>>>> +++ llvm/trunk/lib/Target/XCore/XCoreLowerThreadLocal.cpp Mon Sep  9
>>>> 08:22:45 2013
>>>> @@ -122,6 +122,7 @@ createReplacementInstr(ConstantExpr *CE,
>>>>        default:
>>>>          assert(0 && "Unhandled constant expression!\n");
>>>>      }
>>>> +  llvm_unreachable("Unhandled constant expression!\n");
>>>
>>>
>>>
>>> how about removing the default case, since it isn't doing anything
>>> useful any more.
>>
>>
>> Wouldn't that trigger -Wcovered-enum warnings?
>
>
> If so, maybe move the llvm_unreachable up into the default case, or
> let the default fall through?
>
> Ciao, Duncan.
>



More information about the llvm-commits mailing list