mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +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:
@@ -45,7 +45,6 @@ template<> struct ilist_traits<BasicBlock>
|
||||
|
||||
static iplist<BasicBlock> &getList(Function *F);
|
||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||
static int getListOffset();
|
||||
private:
|
||||
mutable ilist_node<BasicBlock> Sentinel;
|
||||
};
|
||||
@@ -64,7 +63,6 @@ template<> struct ilist_traits<Argument>
|
||||
|
||||
static iplist<Argument> &getList(Function *F);
|
||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||
static int getListOffset();
|
||||
private:
|
||||
mutable ilist_node<Argument> Sentinel;
|
||||
};
|
||||
@@ -305,9 +303,15 @@ public:
|
||||
CheckLazyArguments();
|
||||
return ArgumentList;
|
||||
}
|
||||
static iplist<Argument> Function::*getSublistAccess(Argument*) {
|
||||
return &Function::ArgumentList;
|
||||
}
|
||||
|
||||
const BasicBlockListType &getBasicBlockList() const { return BasicBlocks; }
|
||||
BasicBlockListType &getBasicBlockList() { return BasicBlocks; }
|
||||
static iplist<BasicBlock> Function::*getSublistAccess(BasicBlock*) {
|
||||
return &Function::BasicBlocks;
|
||||
}
|
||||
|
||||
const BasicBlock &getEntryBlock() const { return front(); }
|
||||
BasicBlock &getEntryBlock() { return front(); }
|
||||
@@ -393,15 +397,6 @@ public:
|
||||
/// including any contained basic blocks.
|
||||
///
|
||||
void dropAllReferences();
|
||||
|
||||
static unsigned getBasicBlockListOffset() {
|
||||
Function *Obj = 0;
|
||||
return unsigned(reinterpret_cast<uintptr_t>(&Obj->BasicBlocks));
|
||||
}
|
||||
static unsigned getArgumentListOffset() {
|
||||
Function *Obj = 0;
|
||||
return unsigned(reinterpret_cast<uintptr_t>(&Obj->ArgumentList));
|
||||
}
|
||||
};
|
||||
|
||||
inline ValueSymbolTable *
|
||||
@@ -414,17 +409,6 @@ ilist_traits<Argument>::getSymTab(Function *F) {
|
||||
return F ? &F->getValueSymbolTable() : 0;
|
||||
}
|
||||
|
||||
inline int
|
||||
ilist_traits<BasicBlock>::getListOffset() {
|
||||
return Function::getBasicBlockListOffset();
|
||||
}
|
||||
|
||||
inline int
|
||||
ilist_traits<Argument>::getListOffset() {
|
||||
return Function::getArgumentListOffset();
|
||||
}
|
||||
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user