[lld] r255622 - [ELF][MIPS] Remove applying the redundant bit-mask

Simon Atanasyan via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 22:06:34 PST 2015


Author: atanasyan
Date: Tue Dec 15 00:06:34 2015
New Revision: 255622

URL: http://llvm.org/viewvc/llvm-project?rev=255622&view=rev
Log:
[ELF][MIPS] Remove applying the redundant bit-mask

The `mipsHigh` return type is `uint16_t` so we do not need to extract
low 16-bits from return value explicitly.

Modified:
    lld/trunk/ELF/Target.cpp

Modified: lld/trunk/ELF/Target.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=255622&r1=255621&r2=255622&view=diff
==============================================================================
--- lld/trunk/ELF/Target.cpp (original)
+++ lld/trunk/ELF/Target.cpp Tue Dec 15 00:06:34 2015
@@ -1287,7 +1287,7 @@ bool MipsTargetInfo<ELFT>::relocNeedsPlt
   return false;
 }
 
-static uint16_t mipsHigh(uint64_t V) { return ((V + 0x8000) >> 16) & 0xffff; }
+static uint16_t mipsHigh(uint64_t V) { return (V + 0x8000) >> 16; }
 
 template <class ELFT>
 void MipsTargetInfo<ELFT>::relocateOne(uint8_t *Loc, uint8_t *BufEnd,




More information about the llvm-commits mailing list