mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user