mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-14 14:24:05 +00:00
The (negative) offset from a SymbolTableListTraits-using ilist to its container
object is always constant. As such, evaluate it at compile time instead of storing it as an ivar in SymbolTableListTraits. This shrinks every SymbolTableListTraits ilist by a word, shrinking BasicBlock from 44->40 bytes, Function from 96->88 bytes, and Module from 60->52 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user