From 8f9e99bcb6558846b85202029c137d6d72350530 Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Fri, 24 Feb 2017 00:34:41 +0000 Subject: [PATCH] [GlobalISel] Remove now-unnecessary variable. NFC. Since r296047, we're able to return early on failures. Don't track whether we succeeded. llvm-svn: 296057 --- llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp | 27 ++++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index 6b93a121ce39..2df3810afaec 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -1048,8 +1048,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) { SmallVector VRegArgs; for (const Argument &Arg: F.args()) VRegArgs.push_back(getOrCreateVReg(Arg)); - bool Succeeded = CLI->lowerFormalArguments(EntryBuilder, F, VRegArgs); - if (!Succeeded) { + if (!CLI->lowerFormalArguments(EntryBuilder, F, VRegArgs)) { OptimizationRemarkMissed R("gisel-irtranslator", "GISelFailure", DebugLoc(), &MF->getFunction()->getEntryBlock()); R << "unable to lower arguments: " << ore::NV("Prototype", F.getType()); @@ -1065,19 +1064,19 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) { CurBuilder.setMBB(MBB); for (const Instruction &Inst: BB) { - Succeeded &= translate(Inst); - if (!Succeeded) { - std::string InstStrStorage; - raw_string_ostream InstStr(InstStrStorage); - InstStr << Inst; + if (translate(Inst)) + continue; - OptimizationRemarkMissed R("gisel-irtranslator", "IRTranslatorFailure: ", - &Inst); - R << "unable to translate instruction: " << ore::NV("Opcode", &Inst) - << ": '" << InstStr.str() << "'"; - reportTranslationError(*MF, *TPC, *ORE, R); - return false; - } + std::string InstStrStorage; + raw_string_ostream InstStr(InstStrStorage); + InstStr << Inst; + + OptimizationRemarkMissed R("gisel-irtranslator", "IRTranslatorFailure: ", + &Inst); + R << "unable to translate instruction: " << ore::NV("Opcode", &Inst) + << ": '" << InstStr.str() << "'"; + reportTranslationError(*MF, *TPC, *ORE, R); + return false; } }