[lld] r233088 - [Mips] Suppress "right shift by too large amount" warning

Simon Atanasyan simon at atanasyan.com
Tue Mar 24 10:28:26 PDT 2015


On Tue, Mar 24, 2015 at 7:16 PM, David Blaikie <dblaikie at gmail.com> wrote:
>
> On Tue, Mar 24, 2015 at 8:49 AM, Simon Atanasyan <simon at atanasyan.com>
> wrote:
>>
>> Author: atanasyan
>> Date: Tue Mar 24 10:49:59 2015
>> New Revision: 233088
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=233088&view=rev
>> Log:
>> [Mips] Suppress "right shift by too large amount" warning
>>
>> Visual C++ shows the "right shift by too large amount" warning if
>> `MipsELFReference` is instantiated for 32-bit target and
>> `Elf_Rel_Impl::getType`
>> method has `unsigned char` return type. We can freely suppress the warning
>> in
>> that case because MIPS 32-bit ABI does not pack multiple relocation types
>> into
>> the single field `r_type` and the `MipsELFReference::_tag` should be
>> always
>> zero in that case.
>
>
> Can we just disable the MSVC warning if it's wrong, then?

I thought about an alternative solution - fix Elf_Rel_Impl::getType()
method so all its variants have the same return type uint32_t. Any
objections against this idea?

-- 
Simon Atanasyan



More information about the llvm-commits mailing list