mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-26 07:24:25 +00:00
"ghostify" the ilist<Function> sentinel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67872 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -28,9 +28,20 @@ class FunctionType;
|
||||
|
||||
template<> struct ilist_traits<Function>
|
||||
: public SymbolTableListTraits<Function, Module> {
|
||||
// createSentinel is used to create a node that marks the end of the list.
|
||||
static Function *createSentinel();
|
||||
static void destroySentinel(Function *F) { delete F; }
|
||||
|
||||
// createSentinel is used to get hold of the node that marks the end of the
|
||||
// list... (same trick used here as in ilist_traits<Instruction>)
|
||||
Function *createSentinel() const {
|
||||
return static_cast<Function*>(&Sentinel);
|
||||
}
|
||||
static void destroySentinel(Function*) {}
|
||||
|
||||
Function *provideInitialHead() const { return createSentinel(); }
|
||||
Function *ensureHead(Function*) const { return createSentinel(); }
|
||||
static void noteHead(Function*, Function*) {}
|
||||
|
||||
private:
|
||||
mutable ilist_node<Function> Sentinel;
|
||||
};
|
||||
template<> struct ilist_traits<GlobalVariable>
|
||||
: public SymbolTableListTraits<GlobalVariable, Module> {
|
||||
|
Reference in New Issue
Block a user