[lld] r234781 - Fix formatting and remove excessive parentheses.

Rui Ueyama ruiu at google.com
Mon Apr 13 12:24:01 PDT 2015


Author: ruiu
Date: Mon Apr 13 14:24:00 2015
New Revision: 234781

URL: http://llvm.org/viewvc/llvm-project?rev=234781&view=rev
Log:
Fix formatting and remove excessive parentheses.

Modified:
    lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp

Modified: lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp?rev=234781&r1=234780&r2=234781&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp (original)
+++ lld/trunk/lib/ReaderWriter/ELF/AArch64/AArch64RelocationHandler.cpp Mon Apr 13 14:24:00 2015
@@ -139,7 +139,7 @@ static std::error_code relocR_AARCH64_AD
 /// \brief R_AARCH64_ADR_PREL_LO21 - S + A - P
 static std::error_code relocR_AARCH64_ADR_PREL_LO21(uint8_t *location, uint64_t P,
                                                     uint64_t S, int64_t A) {
-  uint64_t result = (S + A) - P;
+  uint64_t result = S + A - P;
   if (!isInt<20>(result))
     return make_out_of_range_reloc_error();
   uint32_t immlo = result & 0x3;
@@ -173,7 +173,7 @@ static void relocR_AARCH64_ADD_ABS_LO12_
 /// \brief R_AARCH64_CALL26 and R_AARCH64_JUMP26
 static std::error_code relocJump26(uint8_t *location, uint64_t P, uint64_t S,
                                    int64_t A) {
-  int64_t result = (S + A) - P;
+  int64_t result = S + A - P;
   if (!isInt<27>(result))
     return make_out_of_range_reloc_error();
   result &= 0x0FFFFFFC;
@@ -190,7 +190,7 @@ static std::error_code relocJump26(uint8
 /// \brief R_AARCH64_CONDBR19
 static std::error_code relocR_AARCH64_CONDBR19(uint8_t *location, uint64_t P,
                                                uint64_t S, int64_t A) {
-  int64_t result = (S + A) - P;
+  int64_t result = S + A - P;
   if (!isInt<20>(result))
     return make_out_of_range_reloc_error();
   result &= 0x01FFFFC;
@@ -273,8 +273,9 @@ static void relocR_AARCH64_LDST128_ABS_L
   write32le(location, result | read32le(location));
 }
 
-static std::error_code relocR_AARCH64_ADR_GOT_PAGE(uint8_t *location, uint64_t P,
-                                        uint64_t S, int64_t A) {
+static std::error_code relocR_AARCH64_ADR_GOT_PAGE(uint8_t *location,
+                                                   uint64_t P, uint64_t S,
+                                                   int64_t A) {
   uint64_t result = page(S + A) - page(P);
   if (!isInt<32>(result))
     return make_out_of_range_reloc_error();
@@ -295,8 +296,9 @@ static std::error_code relocR_AARCH64_AD
 }
 
 // R_AARCH64_LD64_GOT_LO12_NC
-static std::error_code relocR_AARCH64_LD64_GOT_LO12_NC(uint8_t *location, uint64_t P,
-                                            uint64_t S, int64_t A) {
+static std::error_code relocR_AARCH64_LD64_GOT_LO12_NC(uint8_t *location,
+                                                       uint64_t P, uint64_t S,
+                                                       int64_t A) {
   int32_t result = S + A;
   DEBUG(llvm::dbgs() << " S: " << Twine::utohexstr(S);
         llvm::dbgs() << " A: " << Twine::utohexstr(A);





More information about the llvm-commits mailing list