NFC: Fix variable only used in asserts by propagating the value.

Summary:
This fixes builds with assertions disabled that would otherwise
fail with unused variable warnings

Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69123

llvm-svn: 375148
This commit is contained in:
Sterling Augustine 2019-10-17 18:08:16 +00:00
parent 0aaa193127
commit 05c3d90248
1 changed files with 4 additions and 3 deletions

View File

@ -536,7 +536,6 @@ static MCSymbol *getMCSymbolForTOCPseudoMO(const MachineOperand &MO,
void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) { void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
MCInst TmpInst; MCInst TmpInst;
const bool IsDarwin = TM.getTargetTriple().isOSDarwin(); const bool IsDarwin = TM.getTargetTriple().isOSDarwin();
const bool IsPPC64 = Subtarget->isPPC64();
const bool IsAIX = Subtarget->isAIXABI(); const bool IsAIX = Subtarget->isAIXABI();
const Module *M = MF->getFunction().getParent(); const Module *M = MF->getFunction().getParent();
PICLevel::Level PL = M->getPICLevel(); PICLevel::Level PL = M->getPICLevel();
@ -760,7 +759,8 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return; return;
} }
case PPC::ADDIStocHA: { case PPC::ADDIStocHA: {
assert((IsAIX && !IsPPC64 && TM.getCodeModel() == CodeModel::Large) && assert((IsAIX && !Subtarget->isPPC64() &&
TM.getCodeModel() == CodeModel::Large) &&
"This pseudo should only be selected for 32-bit large code model on" "This pseudo should only be selected for 32-bit large code model on"
" AIX."); " AIX.");
@ -790,7 +790,8 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
return; return;
} }
case PPC::LWZtocL: { case PPC::LWZtocL: {
assert(IsAIX && !IsPPC64 && TM.getCodeModel() == CodeModel::Large && assert(IsAIX && !Subtarget->isPPC64() &&
TM.getCodeModel() == CodeModel::Large &&
"This pseudo should only be selected for 32-bit large code model on" "This pseudo should only be selected for 32-bit large code model on"
" AIX."); " AIX.");