Tidy up. Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156276 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2012-05-07 02:25:53 +00:00
parent d978c54e60
commit f09769067f

View File

@ -10,9 +10,9 @@
// The MachineJumpTableInfo class keeps track of jump tables referenced by // The MachineJumpTableInfo class keeps track of jump tables referenced by
// lowered switch instructions in the MachineFunction. // lowered switch instructions in the MachineFunction.
// //
// Instructions reference the address of these jump tables through the use of // Instructions reference the address of these jump tables through the use of
// MO_JumpTableIndex values. When emitting assembly or machine code, these // MO_JumpTableIndex values. When emitting assembly or machine code, these
// virtual address references are converted to refer to the address of the // virtual address references are converted to refer to the address of the
// function jump tables. // function jump tables.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -34,11 +34,11 @@ class raw_ostream;
struct MachineJumpTableEntry { struct MachineJumpTableEntry {
/// MBBs - The vector of basic blocks from which to create the jump table. /// MBBs - The vector of basic blocks from which to create the jump table.
std::vector<MachineBasicBlock*> MBBs; std::vector<MachineBasicBlock*> MBBs;
explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M) explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M)
: MBBs(M) {} : MBBs(M) {}
}; };
class MachineJumpTableInfo { class MachineJumpTableInfo {
public: public:
/// JTEntryKind - This enum indicates how each entry of the jump table is /// JTEntryKind - This enum indicates how each entry of the jump table is
@ -57,7 +57,7 @@ public:
/// with a relocation as gp-relative, e.g.: /// with a relocation as gp-relative, e.g.:
/// .gprel32 LBB123 /// .gprel32 LBB123
EK_GPRel32BlockAddress, EK_GPRel32BlockAddress,
/// EK_LabelDifference32 - Each entry is the address of the block minus /// EK_LabelDifference32 - Each entry is the address of the block minus
/// the address of the jump table. This is used for PIC jump tables where /// the address of the jump table. This is used for PIC jump tables where
/// gprel32 is not supported. e.g.: /// gprel32 is not supported. e.g.:
@ -80,18 +80,18 @@ private:
std::vector<MachineJumpTableEntry> JumpTables; std::vector<MachineJumpTableEntry> JumpTables;
public: public:
explicit MachineJumpTableInfo(JTEntryKind Kind): EntryKind(Kind) {} explicit MachineJumpTableInfo(JTEntryKind Kind): EntryKind(Kind) {}
JTEntryKind getEntryKind() const { return EntryKind; } JTEntryKind getEntryKind() const { return EntryKind; }
/// getEntrySize - Return the size of each entry in the jump table. /// getEntrySize - Return the size of each entry in the jump table.
unsigned getEntrySize(const TargetData &TD) const; unsigned getEntrySize(const TargetData &TD) const;
/// getEntryAlignment - Return the alignment of each entry in the jump table. /// getEntryAlignment - Return the alignment of each entry in the jump table.
unsigned getEntryAlignment(const TargetData &TD) const; unsigned getEntryAlignment(const TargetData &TD) const;
/// createJumpTableIndex - Create a new jump table. /// createJumpTableIndex - Create a new jump table.
/// ///
unsigned createJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs); unsigned createJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs);
/// isEmpty - Return true if there are no jump tables. /// isEmpty - Return true if there are no jump tables.
/// ///
bool isEmpty() const { return JumpTables.empty(); } bool isEmpty() const { return JumpTables.empty(); }
@ -105,7 +105,7 @@ public:
void RemoveJumpTable(unsigned Idx) { void RemoveJumpTable(unsigned Idx) {
JumpTables[Idx].MBBs.clear(); JumpTables[Idx].MBBs.clear();
} }
/// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
/// the jump tables to branch to New instead. /// the jump tables to branch to New instead.
bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New); bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New);