mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Another sentinel optimization. This one should always
be a win, since almost every interesting function has at least one Argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65778 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
abd6f28a74
commit
5e7d4d643d
@ -48,12 +48,15 @@ private:
|
||||
template<> struct ilist_traits<Argument>
|
||||
: public SymbolTableListTraits<Argument, Function> {
|
||||
|
||||
// createSentinel is used to create a node that marks the end of the list...
|
||||
static Argument *createSentinel();
|
||||
static void destroySentinel(Argument *A) { delete A; }
|
||||
Argument *createSentinel() const {
|
||||
return const_cast<Argument*>(static_cast<const Argument*>(&Sentinel));
|
||||
}
|
||||
static void destroySentinel(Argument*) {}
|
||||
static iplist<Argument> &getList(Function *F);
|
||||
static ValueSymbolTable *getSymTab(Function *ItemParent);
|
||||
static int getListOffset();
|
||||
private:
|
||||
ilist_node<Argument> Sentinel;
|
||||
};
|
||||
|
||||
class Function : public GlobalValue, public Annotable,
|
||||
|
@ -26,13 +26,6 @@ iplist<BasicBlock> &ilist_traits<BasicBlock>::getList(Function *F) {
|
||||
return F->getBasicBlockList();
|
||||
}
|
||||
|
||||
Argument *ilist_traits<Argument>::createSentinel() {
|
||||
Argument *Ret = new Argument(Type::Int32Ty);
|
||||
// This should not be garbage monitored.
|
||||
LeakDetector::removeGarbageObject(Ret);
|
||||
return Ret;
|
||||
}
|
||||
|
||||
iplist<Argument> &ilist_traits<Argument>::getList(Function *F) {
|
||||
return F->getArgumentList();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user