aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/BasicBlock.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-03-07 10:00:35 +0000
committerGabor Greif <ggreif@gmail.com>2009-03-07 10:00:35 +0000
commitb547a181005cc255fa57c61c1c0dbafca5375fb4 (patch)
treeb410d6b76be08d5820401da6eb8f015fdd7d68fc /include/llvm/BasicBlock.h
parent922a881f32df95170cb2c28e1a5ee0053d6f0f90 (diff)
Remove the burden of dealing with list offsets
from SymbolTableListTraits' clients, and intead request a nice declarative interface. Cleans up an IMHO ugly wart. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/BasicBlock.h')
-rw-r--r--include/llvm/BasicBlock.h15
1 files changed, 3 insertions, 12 deletions
diff --git a/include/llvm/BasicBlock.h b/include/llvm/BasicBlock.h
index 84dc6a6626..0d40909f00 100644
--- a/include/llvm/BasicBlock.h
+++ b/include/llvm/BasicBlock.h
@@ -48,7 +48,6 @@ template<> struct ilist_traits<Instruction>
static iplist<Instruction> &getList(BasicBlock *BB);
static ValueSymbolTable *getSymTab(BasicBlock *ItemParent);
- static int getListOffset();
private:
mutable ilist_node<Instruction> Sentinel;
};
@@ -186,6 +185,9 @@ public:
///
const InstListType &getInstList() const { return InstList; }
InstListType &getInstList() { return InstList; }
+ static iplist<Instruction> BasicBlock::*getSublistAccess(Instruction*) {
+ return &BasicBlock::InstList;
+ }
/// Methods for support type inquiry through isa, cast, and dyn_cast:
static inline bool classof(const BasicBlock *) { return true; }
@@ -224,19 +226,8 @@ public:
/// the basic block).
///
BasicBlock *splitBasicBlock(iterator I, const std::string &BBName = "");
-
-
- static unsigned getInstListOffset() {
- BasicBlock *Obj = 0;
- return unsigned(reinterpret_cast<uintptr_t>(&Obj->InstList));
- }
};
-inline int
-ilist_traits<Instruction>::getListOffset() {
- return BasicBlock::getInstListOffset();
-}
-
} // End llvm namespace
#endif