Clean up.
authorEvan Cheng <evan.cheng@apple.com>
Mon, 27 Jul 2009 18:25:24 +0000 (18:25 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 27 Jul 2009 18:25:24 +0000 (18:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77221 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMBaseInstrInfo.cpp
lib/Target/ARM/ARMBaseInstrInfo.h

index e058c8ad1ad12d6e84b9b2e14ca81ade677596e2..5703f6b885618a8b0968f2002f03a1ebd8e4257d 100644 (file)
@@ -251,11 +251,7 @@ ARMBaseInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,MachineBasicBlock *&TBB,
   // ...likewise if it ends with a branch table followed by an unconditional
   // branch. The branch folder can create these, and we must get rid of them for
   // correctness of Thumb constant islands.
-  if ((SecondLastOpc == ARM::BR_JTr || 
-       SecondLastOpc == ARM::BR_JTm ||
-       SecondLastOpc == ARM::BR_JTadd ||
-       SecondLastOpc == ARM::tBR_JTr ||
-       SecondLastOpc == ARM::t2BR_JT) &&
+  if (isJumpTableBranchOpcode(SecondLastOpc) &&
       isUncondBranchOpcode(LastOpc)) {
     I = LastInst;
     if (AllowModify)
index 375410dac1b12dc3610b7481e96179212f99bc1e..e91d1ebf0e5a6321ad6e7edb56281c2a1e1938bc 100644 (file)
@@ -301,6 +301,11 @@ private:
     return Opc == ARM::Bcc || Opc == ARM::tBcc || Opc == ARM::t2Bcc;
   }
 
+  bool isJumpTableBranchOpcode(int Opc) const {
+    return Opc == ARM::BR_JTr || Opc == ARM::BR_JTm || Opc == ARM::BR_JTadd ||
+      Opc == ARM::tBR_JTr || Opc == ARM::t2BR_JT;
+  }
+
   int getMatchingCondBranchOpcode(int Opc) const;
 };
 }