diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-10-16 20:41:42 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-10-16 20:41:42 +0000 |
| commit | e7d49862a588caf9562c464c4f414f3bee6093cf (patch) | |
| tree | ea2727cfc98e72c1758297656eb7bffdc2fa3030 | |
| parent | 9db3a088648633f9842906fd15127a33bf810adb (diff) | |
| download | bcm5719-llvm-e7d49862a588caf9562c464c4f414f3bee6093cf.tar.gz bcm5719-llvm-e7d49862a588caf9562c464c4f414f3bee6093cf.zip | |
add a ReplaceMBBInJumpTables method
llvm-svn: 30983
| -rw-r--r-- | llvm/include/llvm/CodeGen/MachineJumpTableInfo.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h index c0f4af34c22..7f6c965d7cd 100644 --- a/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h +++ b/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h @@ -26,6 +26,7 @@ namespace llvm { class MachineBasicBlock; +class TargetData; /// MachineJumpTableEntry - One jump table in the jump table info. /// @@ -54,6 +55,17 @@ public: return JumpTables; } + /// 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) { + 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) + JTE.MBBs[j] = New; + } + } + /// getEntrySize - returns the size of an individual field in a jump table unsigned getEntrySize() const; |

