diff options
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r-- | include/llvm/BasicBlock.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h index 8cc450c127..0a22f44b98 100644 --- a/include/llvm/BasicBlock.h +++ b/include/llvm/BasicBlock.h @@ -31,6 +31,7 @@ template<> struct ilist_traits<Instruction> static void destroySentinel(Instruction *I) { delete I; } static iplist<Instruction> &getList(BasicBlock *BB); static ValueSymbolTable *getSymTab(BasicBlock *ItemParent); + static int getListOffset(); }; /// This represents a single basic block in LLVM. A basic block is simply a @@ -194,8 +195,19 @@ public: /// the basic block). /// BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = ""); + + + static unsigned getInstListOffset() { + BasicBlock *Obj = 0; + return reinterpret_cast<unsigned>(&Obj->InstList); + } }; +inline int +ilist_traits<Instruction>::getListOffset() { + return BasicBlock::getInstListOffset(); +} + } // End llvm namespace #endif |