OSDN Git Service

[GlobalISel] Remove now-unnecessary variable. NFC.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 24 Feb 2017 00:34:41 +0000 (00:34 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Fri, 24 Feb 2017 00:34:41 +0000 (00:34 +0000)
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

lib/CodeGen/GlobalISel/IRTranslator.cpp

index 6b93a12..2df3810 100644 (file)
@@ -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());
@@ -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;
     }
   }