[llvm] r373164 - [PowerPC] Fix conditions of assert in PPCAsmPrinter
Jinsong Ji via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 29 05:43:46 PDT 2019
Author: jsji
Date: Sun Sep 29 05:43:46 2019
New Revision: 373164
URL: http://llvm.org/viewvc/llvm-project?rev=373164&view=rev
Log:
[PowerPC] Fix conditions of assert in PPCAsmPrinter
Summary:
g++ build emits warning:
llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:667:77: error: suggest parentheses around ?&&? within ?||? [-Werror=parentheses]
assert(MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() &&
~~~~~~~~~~~~~~~~~~~~^~
"Unexpected operand type for LWZtoc pseudo.");
I believe the intension is to assert all different types,
so we should add a parentheses to include all '||'.
Reviewers: #powerpc, sfertile, hubert.reinterpretcast, Xiangling_L
Reviewed By: Xiangling_L
Subscribers: wuzish, nemanjai, hiraditya, kbarton, MaskRay, shchenz, steven.zhang, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D68180
Modified:
llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
Modified: llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp?rev=373164&r1=373163&r2=373164&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCAsmPrinter.cpp Sun Sep 29 05:43:46 2019
@@ -664,7 +664,7 @@ void PPCAsmPrinter::EmitInstruction(cons
TmpInst.setOpcode(PPC::LWZ);
const MachineOperand &MO = MI->getOperand(1);
- assert(MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress() &&
+ assert((MO.isGlobal() || MO.isCPI() || MO.isJTI() || MO.isBlockAddress()) &&
"Unexpected operand type for LWZtoc pseudo.");
// Map the operand to its corresponding MCSymbol.
More information about the llvm-commits
mailing list