[Target/PPC] Fold inside an assertion.
authorDavide Italiano <ditaliano@apple.com>
Mon, 15 Jun 2020 19:08:15 +0000 (12:08 -0700)
committerDavide Italiano <ditaliano@apple.com>
Mon, 15 Jun 2020 19:08:57 +0000 (12:08 -0700)
Pointed out by dblaikie.

llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp

index cd6bce2..fb65e73 100644 (file)
@@ -242,9 +242,8 @@ PPCMCCodeEmitter::getMemRI34PCRelEncoding(const MCInst &MI, unsigned OpNo,
 
     const MCSymbolRefExpr *SRE = cast<MCSymbolRefExpr>(LHS);
     (void)SRE;
-    const MCConstantExpr *CE = cast<MCConstantExpr>(RHS);
-    (void)CE;
-    assert(isInt<34>(CE->getValue()) && "Value must fit in 34 bits.");
+    assert(isInt<34>(cast<MCConstantExpr>(RHS)->getValue()) &&
+           "Value must fit in 34 bits.");
 
     // Currently these are the only valid PCRelative Relocations.
     assert((SRE->getKind() == MCSymbolRefExpr::VK_PCREL ||