X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FCodeGen%2FMachineJumpTableInfo.h;h=bccd65dfbd060e331b29a67b4cb4fb3f4d1ba65e;hb=f73823000e2d5d6e1cf65bdf5a107297e18d35fb;hp=2d640a7cb102ddaf3c43f5a0fa070eca2a129a8f;hpb=a4eb44a285984ec999de632beb5145b099f5416d;p=oota-llvm.git diff --git a/include/llvm/CodeGen/MachineJumpTableInfo.h b/include/llvm/CodeGen/MachineJumpTableInfo.h index 2d640a7cb10..bccd65dfbd0 100644 --- a/include/llvm/CodeGen/MachineJumpTableInfo.h +++ b/include/llvm/CodeGen/MachineJumpTableInfo.h @@ -2,8 +2,8 @@ // // The LLVM Compiler Infrastructure // -// This file was developed by Nate Begeman and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // @@ -22,6 +22,7 @@ #include #include +#include namespace llvm { @@ -34,14 +35,17 @@ struct MachineJumpTableEntry { /// MBBs - The vector of basic blocks from which to create the jump table. std::vector MBBs; - MachineJumpTableEntry(const std::vector &M) : MBBs(M) {} + explicit MachineJumpTableEntry(const std::vector &M) + : MBBs(M) {} }; class MachineJumpTableInfo { - const TargetData *TD; + unsigned EntrySize; + unsigned Alignment; std::vector JumpTables; public: - MachineJumpTableInfo(const TargetData *td) : TD(td) {} + MachineJumpTableInfo(unsigned Size, unsigned Align) + : EntrySize(Size), Alignment(Align) {} /// getJumpTableIndex - Create a new jump table or return an existing one. /// @@ -64,6 +68,7 @@ public: /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update /// the jump tables to branch to New instead. bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New) { + assert(Old != New && "Not making a change?"); bool MadeChange = false; for (unsigned i = 0, e = JumpTables.size(); i != e; ++i) { MachineJumpTableEntry &JTE = JumpTables[i]; @@ -76,16 +81,18 @@ public: return MadeChange; } - /// getEntrySize - returns the size of an individual field in a jump table - unsigned getEntrySize() const; + /// getEntrySize - Returns the size of an individual field in a jump table. + /// + unsigned getEntrySize() const { return EntrySize; } /// getAlignment - returns the target's preferred alignment for jump tables - unsigned getAlignment() const; + unsigned getAlignment() const { return Alignment; } /// print - Used by the MachineFunction printer to print information about /// jump tables. Implemented in MachineFunction.cpp /// void print(std::ostream &OS) const; + void print(std::ostream *OS) const { if (OS) print(*OS); } /// dump - Call print(std::cerr) to be called from the debugger. ///