Move MachineJumpTableInfo::ReplaceMBBInJumpTables out of line.
authorDan Gohman <gohman@apple.com>
Wed, 15 Apr 2009 01:18:49 +0000 (01:18 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 15 Apr 2009 01:18:49 +0000 (01:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69125 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineJumpTableInfo.h
lib/CodeGen/MachineFunction.cpp

index e0acb27f46b5320de97174c3adb62d7d6e7452cd..56e2e5499a7ffdac69c187229d09290138443459 100644 (file)
@@ -67,20 +67,8 @@ public:
   
   /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
   /// the jump tables to branch to New instead.
-  bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) {
-    assert(Old != New && "Not making a change?");
-    bool MadeChange = false;
-    for (size_t i = 0, e = JumpTables.size(); i != e; ++i) {
-      MachineJumpTableEntry &JTE = JumpTables[i];
-      for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j)
-        if (JTE.MBBs[j] == Old) {
-          JTE.MBBs[j] = New;
-          MadeChange = true;
-        }
-    }
-    return MadeChange;
-  }
-  
+  bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New);
+
   /// getEntrySize - Returns the size of an individual field in a jump table. 
   ///
   unsigned getEntrySize() const { return EntrySize; }
index 18a040e5540942b91a19ab3f43c09ab2b9b0b4c3..fc0e99fe4bbb84af48dcb5637153ff3ece585b60 100644 (file)
@@ -486,6 +486,23 @@ unsigned MachineJumpTableInfo::getJumpTableIndex(
   return JumpTables.size()-1;
 }
 
+/// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
+/// the jump tables to branch to New instead.
+bool
+MachineJumpTableInfo::ReplaceMBBInJumpTables(MachineBasicBlock *Old,
+                                             MachineBasicBlock *New) {
+  assert(Old != New && "Not making a change?");
+  bool MadeChange = false;
+  for (size_t i = 0, e = JumpTables.size(); i != e; ++i) {
+    MachineJumpTableEntry &JTE = JumpTables[i];
+    for (size_t j = 0, e = JTE.MBBs.size(); j != e; ++j)
+      if (JTE.MBBs[j] == Old) {
+        JTE.MBBs[j] = New;
+        MadeChange = true;
+      }
+  }
+  return MadeChange;
+}
 
 void MachineJumpTableInfo::print(std::ostream &OS) const {
   // FIXME: this is lame, maybe we could print out the MBB numbers or something