llvm.org GIT mirror llvm / 0afc8f4
Merge r98845 from mainline. git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_27@99291 91177308-0d34-0410-b5e6-96231b3b80d8 Tanya Lattner 10 years ago
3 changed file(s) with 20 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
7878 /// getEntryAlignment - Return the alignment of each entry in the jump table.
7979 unsigned getEntryAlignment(const TargetData &TD) const;
8080
81 /// getJumpTableIndex - Create a new jump table or return an existing one.
81 /// createJumpTableIndex - Create a new jump table.
82 ///
83 unsigned createJumpTableIndex(const std::vector &DestBBs);
84
85 /// getJumpTableIndex - Return the index for an existing jump table.
8286 ///
8387 unsigned getJumpTableIndex(const std::vector &DestBBs);
8488
593593 return ~0;
594594 }
595595
596 /// getJumpTableIndex - Create a new jump table entry in the jump table info
597 /// or return an existing one.
598 ///
599 unsigned MachineJumpTableInfo::getJumpTableIndex(
596 /// createJumpTableIndex - Create a new jump table entry in the jump table info.
597 ///
598 unsigned MachineJumpTableInfo::createJumpTableIndex(
600599 const std::vector &DestBBs) {
601600 assert(!DestBBs.empty() && "Cannot create an empty jump table!");
602601 JumpTables.push_back(MachineJumpTableEntry(DestBBs));
603602 return JumpTables.size()-1;
604603 }
605604
605 /// getJumpTableIndex - Return the index for an existing jump table entry in
606 /// the jump table info.
607 unsigned MachineJumpTableInfo::getJumpTableIndex(
608 const std::vector &DestBBs) {
609 for (unsigned i = 0, e = JumpTables.size(); i != e; ++i)
610 if (JumpTables[i].MBBs == DestBBs)
611 return i;
612 assert(false && "getJumpTableIndex failed to find matching table");
613 return ~0;
614 }
606615
607616 /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
608617 /// the jump tables to branch to New instead.
16731673 }
16741674 }
16751675
1676 // Create a jump table index for this jump table, or return an existing
1677 // one.
1676 // Create a jump table index for this jump table.
16781677 unsigned JTEncoding = TLI.getJumpTableEncoding();
16791678 unsigned JTI = CurMF->getOrCreateJumpTableInfo(JTEncoding)
1680 ->getJumpTableIndex(DestBBs);
1679 ->createJumpTableIndex(DestBBs);
16811680
16821681 // Set the jump table information so that we can codegen it as a second
16831682 // MachineBasicBlock