Skip to content

Commit

Permalink
[NFC] Add parentheses in MathExtra.h
Browse files Browse the repository at this point in the history
The code used to cause a warning:
  llvm/include/llvm/Support/MathExtras.h:751:39: warning: suggest parentheses around ‘-’ in operand of ‘&’ [-Wparentheses]
    751 |   assert(Align != 0 && (Align & Align - 1) == 0 &&
        |
  • Loading branch information
deadalnix committed Jul 24, 2022
1 parent 9e88cbc commit 5e29360
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llvm/include/llvm/Support/MathExtras.h
Expand Up @@ -748,7 +748,7 @@ inline uint64_t alignTo(uint64_t Value, uint64_t Align) {
}

inline uint64_t alignToPowerOf2(uint64_t Value, uint64_t Align) {
assert(Align != 0 && (Align & Align - 1) == 0 &&
assert(Align != 0 && (Align & (Align - 1)) == 0 &&
"Align must be a power of 2");
return (Value + Align - 1) & -Align;
}
Expand Down

0 comments on commit 5e29360

Please sign in to comment.