[llvm] r310459 - Suppress a warning. NFC.
Gábor Horváth via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 15 03:57:00 PDT 2017
It is a newly introduced warning: https://reviews.llvm.org/D36526
It warns when two different types of (non-anonymous) enums are used in the
same switch. An alternative fix would be to make AMDGPU::fixup_si_sopp_br
part of an anonymous enum instead. Feel free to change it, the main purpose
of this commit was to unbreak a build bot which treats warnings as errors.
I also sent a mail to the one who committed this code, to change this fix
if desired.
Regards,
Gábor
On 14 August 2017 at 22:39, David Blaikie <dblaikie at gmail.com> wrote:
> Which warning is being suppressed? If it's a -Wswitch-enum - why not
> remove the default? (& place the unreachable after the switch)
>
> On Wed, Aug 9, 2017 at 3:39 AM Gabor Horvath via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: xazax
>> Date: Wed Aug 9 03:38:53 2017
>> New Revision: 310459
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=310459&view=rev
>> Log:
>> Suppress a warning. NFC.
>>
>> Modified:
>> llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
>>
>> Modified: llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/
>> AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp?rev=310459&r1=310458&r2=310459&
>> view=diff
>> ============================================================
>> ==================
>> --- llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp
>> (original)
>> +++ llvm/trunk/lib/Target/AMDGPU/MCTargetDesc/AMDGPUAsmBackend.cpp Wed
>> Aug 9 03:38:53 2017
>> @@ -78,7 +78,7 @@ static uint64_t adjustFixupValue(const M
>> MCContext *Ctx) {
>> int64_t SignedValue = static_cast<int64_t>(Value);
>>
>> - switch (Fixup.getKind()) {
>> + switch (static_cast<unsigned>(Fixup.getKind())) {
>> case AMDGPU::fixup_si_sopp_br: {
>> int64_t BrImm = (SignedValue - 4) / 4;
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170815/bf89fd3f/attachment.html>
More information about the llvm-commits
mailing list