[llvm] r261207 - Add parentheses around arithmetic in operand of '|'.

Benjamin Kramer via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 05:23:18 PST 2016


Author: d0k
Date: Thu Feb 18 07:23:17 2016
New Revision: 261207

URL: http://llvm.org/viewvc/llvm-project?rev=261207&view=rev
Log:
Add parentheses around arithmetic in operand of '|'.

This avoids a operator precedence warning for mixing + and | in an
expression. I checked that this matches the definition in the Split
DWARF proposal.

Patch by Cong Liu!

Differential Revision: http://reviews.llvm.org/D17375

Modified:
    llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp

Modified: llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp?rev=261207&r1=261206&r2=261207&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp (original)
+++ llvm/trunk/tools/llvm-dwp/llvm-dwp.cpp Thu Feb 18 07:23:17 2016
@@ -238,7 +238,7 @@ static void writeIndex(MCStreamer &Out,
     while (Buckets[H]) {
       assert(S != IndexEntries[Buckets[H] - 1].Signature &&
              "Duplicate type unit");
-      H = (H + ((S >> 32) & Mask) | 1) % Buckets.size();
+      H = (H + (((S >> 32) & Mask) | 1)) % Buckets.size();
     }
     Buckets[H] = i + 1;
   }




More information about the llvm-commits mailing list