summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-03-01 17:13:15 +0000
committerGabor Greif <ggreif@gmail.com>2009-03-01 17:13:15 +0000
commit5e7d4d643d691f6169eaaf60b13dc54ba2b69232 (patch)
tree4d17d738199b8f07900280d2b4c740e06c4454e5 /include
parentabd6f28a74e74303725ec123bdfe9202617115c8 (diff)
downloadllvm-5e7d4d643d691f6169eaaf60b13dc54ba2b69232.tar.gz
llvm-5e7d4d643d691f6169eaaf60b13dc54ba2b69232.tar.bz2
llvm-5e7d4d643d691f6169eaaf60b13dc54ba2b69232.tar.xz
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
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Function.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/llvm/Function.h b/include/llvm/Function.h
index bdae9cd02f..9f4f23be08 100644
--- a/include/llvm/Function.h
+++ b/include/llvm/Function.h
@@ -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,