[llvm-commits] [llvm] r69125 - in /llvm/trunk: include/llvm/CodeGen/MachineJumpTableInfo.h lib/CodeGen/MachineFunction.cpp

Dan Gohman gohman at apple.com
Tue Apr 14 18:18:49 PDT 2009


Author: djg
Date: Tue Apr 14 20:18:49 2009
New Revision: 69125

URL: http://llvm.org/viewvc/llvm-project?rev=69125&view=rev
Log:
Move MachineJumpTableInfo::ReplaceMBBInJumpTables out of line.

Modified:
    llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h
    llvm/trunk/lib/CodeGen/MachineFunction.cpp

Modified: llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h?rev=69125&r1=69124&r2=69125&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineJumpTableInfo.h Tue Apr 14 20:18:49 2009
@@ -67,20 +67,8 @@
   
   /// 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; }

Modified: llvm/trunk/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineFunction.cpp?rev=69125&r1=69124&r2=69125&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineFunction.cpp Tue Apr 14 20:18:49 2009
@@ -486,6 +486,23 @@
   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





More information about the llvm-commits mailing list