mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-27 04:18:42 +00:00
Merge r98845 from mainline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99291 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
1 parent
8a4f9390d0
commit
0afc8f4e10
3 files changed
+19
-7
No files matched your search
@@ -79,7 +79,11 @@ public:
|
||||
/// 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);
|
||||
|
||||
|
||||
@@ -594,16 +594,25 @@ unsigned MachineJumpTableInfo::getEntryAlignment(const TargetData &TD) const {
|
||||
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.
|
||||
|
||||
@@ -1674,11 +1674,10 @@ bool SelectionDAGBuilder::handleJTSwitchCase(CaseRec& CR,
|
||||
}
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
Reference in new issue
Block a user