[llvm-branch-commits] [llvm-branch] r99291 - in /llvm/branches/release_27: ./ include/llvm/CodeGen/MachineJumpTableInfo.h lib/CodeGen/MachineFunction.cpp lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Tanya Lattner
tonic at nondot.org
Tue Mar 23 10:11:51 PDT 2010
Author: tbrethou
Date: Tue Mar 23 12:11:51 2010
New Revision: 99291
URL: http://llvm.org/viewvc/llvm-project?rev=99291&view=rev
Log:
Merge r98845 from mainline.
Modified:
llvm/branches/release_27/ (props changed)
llvm/branches/release_27/include/llvm/CodeGen/MachineJumpTableInfo.h
llvm/branches/release_27/lib/CodeGen/MachineFunction.cpp
llvm/branches/release_27/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Propchange: llvm/branches/release_27/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Mar 23 12:11:51 2010
@@ -1 +1 @@
-/llvm/trunk:97965,97974,97980,98171,98193,98203,98205,98212,98416,98561
+/llvm/trunk:97965,97974,97980,98171,98193,98203,98205,98212,98416,98561,98845
Modified: llvm/branches/release_27/include/llvm/CodeGen/MachineJumpTableInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/include/llvm/CodeGen/MachineJumpTableInfo.h?rev=99291&r1=99290&r2=99291&view=diff
==============================================================================
--- llvm/branches/release_27/include/llvm/CodeGen/MachineJumpTableInfo.h (original)
+++ llvm/branches/release_27/include/llvm/CodeGen/MachineJumpTableInfo.h Tue Mar 23 12:11:51 2010
@@ -79,7 +79,11 @@
/// getEntryAlignment - Return the alignment of each entry in the jump table.
unsigned getEntryAlignment(const TargetData &TD) const;
- /// getJumpTableIndex - Create a new jump table or return an existing one.
+ /// createJumpTableIndex - Create a new jump table.
+ ///
+ unsigned createJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs);
+
+ /// getJumpTableIndex - Return the index for an existing jump table.
///
unsigned getJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs);
Modified: llvm/branches/release_27/lib/CodeGen/MachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/lib/CodeGen/MachineFunction.cpp?rev=99291&r1=99290&r2=99291&view=diff
==============================================================================
--- llvm/branches/release_27/lib/CodeGen/MachineFunction.cpp (original)
+++ llvm/branches/release_27/lib/CodeGen/MachineFunction.cpp Tue Mar 23 12:11:51 2010
@@ -594,16 +594,25 @@
return ~0;
}
-/// getJumpTableIndex - Create a new jump table entry in the jump table info
-/// or return an existing one.
+/// createJumpTableIndex - Create a new jump table entry in the jump table info.
///
-unsigned MachineJumpTableInfo::getJumpTableIndex(
+unsigned MachineJumpTableInfo::createJumpTableIndex(
const std::vector<MachineBasicBlock*> &DestBBs) {
assert(!DestBBs.empty() && "Cannot create an empty jump table!");
JumpTables.push_back(MachineJumpTableEntry(DestBBs));
return JumpTables.size()-1;
}
+/// getJumpTableIndex - Return the index for an existing jump table entry in
+/// the jump table info.
+unsigned MachineJumpTableInfo::getJumpTableIndex(
+ const std::vector<MachineBasicBlock*> &DestBBs) {
+ for (unsigned i = 0, e = JumpTables.size(); i != e; ++i)
+ if (JumpTables[i].MBBs == DestBBs)
+ return i;
+ assert(false && "getJumpTableIndex failed to find matching table");
+ return ~0;
+}
/// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
/// the jump tables to branch to New instead.
Modified: llvm/branches/release_27/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_27/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp?rev=99291&r1=99290&r2=99291&view=diff
==============================================================================
--- llvm/branches/release_27/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (original)
+++ llvm/branches/release_27/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp Tue Mar 23 12:11:51 2010
@@ -1674,11 +1674,10 @@
}
}
- // Create a jump table index for this jump table, or return an existing
- // one.
+ // Create a jump table index for this jump table.
unsigned JTEncoding = TLI.getJumpTableEncoding();
unsigned JTI = CurMF->getOrCreateJumpTableInfo(JTEncoding)
- ->getJumpTableIndex(DestBBs);
+ ->createJumpTableIndex(DestBBs);
// Set the jump table information so that we can codegen it as a second
// MachineBasicBlock
More information about the llvm-branch-commits
mailing list