Skip to content

Commit

Permalink
[PowerPC] Fix gcc -Wparentheses warning [NFC]
Browse files Browse the repository at this point in the history
Without this gcc warns like
 ../lib/Target/PowerPC/PPCAsmPrinter.cpp:1650:33: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
  1650 |            (InstDisp >= -32768) &&
       |            ~~~~~~~~~~~~~~~~~~~~~^~
  1651 |                "Expecting the instruction displacement for local-exec TLS "
       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1652 |                "variables to be between [-32768, 32768)!");
       |                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
mikaelholmen committed Feb 2, 2024
1 parent a52e9ec commit 42ec993
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1646,8 +1646,8 @@ const MCExpr *PPCAsmPrinter::getAdjustedLocalExecExpr(const MachineOperand &MO,
ptrdiff_t Delta = ((FinalAddress + 32768) & ~0xFFFF);
// Check that the total instruction displacement fits within [-32768,32768).
[[maybe_unused]] ptrdiff_t InstDisp = TLSVarAddress + Offset - Delta;
assert((InstDisp < 32768) ||
(InstDisp >= -32768) &&
assert(((InstDisp < 32768) ||
(InstDisp >= -32768)) &&
"Expecting the instruction displacement for local-exec TLS "
"variables to be between [-32768, 32768)!");
Expr = MCBinaryExpr::createAdd(
Expand Down

0 comments on commit 42ec993

Please sign in to comment.