determine whether a change was made
authorChris Lattner <sabre@nondot.org>
Sat, 28 Oct 2006 18:00:05 +0000 (18:00 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 28 Oct 2006 18:00:05 +0000 (18:00 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31265 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineJumpTableInfo.h

index 7f6c965d7cd22c3919994ee4e0afccde96c8bb56..adf33488c164679e55b64d94d32a2e053c703230 100644 (file)
@@ -57,13 +57,17 @@ public:
   
   /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
   /// the jump tables to branch to New instead.
-  void ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) {
+  bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) {
+    bool MadeChange = false;
     for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) {
       MachineJumpTableEntry &JTE = JumpTables[i];
       for (unsigned j = 0, e = JTE.MBBs.size(); j != e; ++j)
-        if (JTE.MBBs[j] == Old)
+        if (JTE.MBBs[j] == Old) {
           JTE.MBBs[j] = New;
+          MadeChange = true;
+        }
     }
+    return MadeChange;
   }
   
   /// getEntrySize - returns the size of an individual field in a jump table