<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 24, 2015 at 8:49 AM, Simon Atanasyan <span dir="ltr"><<a href="mailto:simon@atanasyan.com" target="_blank">simon@atanasyan.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: atanasyan<br>
Date: Tue Mar 24 10:49:59 2015<br>
New Revision: 233088<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=233088&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=233088&view=rev</a><br>
Log:<br>
[Mips] Suppress "right shift by too large amount" warning<br>
<br>
Visual C++ shows the "right shift by too large amount" warning if<br>
`MipsELFReference` is instantiated for 32-bit target and `Elf_Rel_Impl::getType`<br>
method has `unsigned char` return type. We can freely suppress the warning in<br>
that case because MIPS 32-bit ABI does not pack multiple relocation types into<br>
the single field `r_type` and the `MipsELFReference::_tag` should be always<br>
zero in that case.<br></blockquote><div><br>Can we just disable the MSVC warning if it's wrong, then?<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
No functional changes.<br>
<br>
Modified:<br>
    lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h<br>
<br>
Modified: lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h?rev=233088&r1=233087&r2=233088&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h?rev=233088&r1=233087&r2=233088&view=diff</a><br>
==============================================================================<br>
--- lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h (original)<br>
+++ lld/trunk/lib/ReaderWriter/ELF/Mips/MipsELFFile.h Tue Mar 24 10:49:59 2015<br>
@@ -101,13 +101,13 @@ public:<br>
       : ELFReference<ELFT>(<br>
             &rel, rel.r_offset - symValue, Reference::KindArch::Mips,<br>
             rel.getType(_isMips64EL) & 0xff, rel.getSymbol(_isMips64EL)),<br>
-        _tag(rel.getType(_isMips64EL) >> 8) {}<br>
+        _tag(uint32_t(rel.getType(_isMips64EL)) >> 8) {}<br>
<br>
   MipsELFReference(uint64_t symValue, const Elf_Rel &rel)<br>
       : ELFReference<ELFT>(rel.r_offset - symValue, Reference::KindArch::Mips,<br>
                            rel.getType(_isMips64EL) & 0xff,<br>
                            rel.getSymbol(_isMips64EL)),<br>
-        _tag(rel.getType(_isMips64EL) >> 8) {}<br>
+        _tag(uint32_t(rel.getType(_isMips64EL)) >> 8) {}<br>
<br>
   uint32_t tag() const override { return _tag; }<br>
   void setTag(uint32_t tag) { _tag = tag; }<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>