Skip to content

Commit

Permalink
[GlobalISel] Remove now-unnecessary variable. NFC.
Browse files Browse the repository at this point in the history
Since r296047, we're able to return early on failures.
Don't track whether we succeeded.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296057 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
ahmedbougacha committed Feb 24, 2017
1 parent 0ca20ba commit 0108464
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions lib/CodeGen/GlobalISel/IRTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1048,8 +1048,7 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
SmallVector<unsigned, 8> 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());
Expand All @@ -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;

OptimizationRemarkMissed R("gisel-irtranslator", "IRTranslatorFailure: ",
&Inst);
R << "unable to translate instruction: " << ore::NV("Opcode", &Inst)
<< ": '" << InstStr.str() << "'";
reportTranslationError(*MF, *TPC, *ORE, R);
return false;
}
if (translate(Inst))
continue;

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;
}
}

Expand Down

0 comments on commit 0108464

Please sign in to comment.