diff options
author | Gabor Greif <ggreif@gmail.com> | 2009-08-24 21:34:17 +0000 |
---|---|---|
committer | Gabor Greif <ggreif@gmail.com> | 2009-08-24 21:34:17 +0000 |
commit | fd7a918e5890a6c0611ab6b3fca7001d16593844 (patch) | |
tree | bf0ca4ee1f539d264e69ae429fa7c0b77e60ed25 /include/llvm/ADT/ilist.h | |
parent | 81fece667e1f8a9569360b1c8a12e494c79bf009 (diff) | |
download | llvm-fd7a918e5890a6c0611ab6b3fca7001d16593844.tar.gz llvm-fd7a918e5890a6c0611ab6b3fca7001d16593844.tar.bz2 llvm-fd7a918e5890a6c0611ab6b3fca7001d16593844.tar.xz |
Resubmit an earlier patch of mine:
reduce the size of relevant "ghostly" sentinels
by a pointer.
This attempt now makes the compactification dependent
on the configure variable LLVM_COMPACT_SENTINELS
and should not cause any bootstrap failures for
llvm-gcc any more.
Please note that this is not yet the final version,
and (as settled with Chris) I shall take out the
autofoo/cmake portions in the next days.
This will also lose the assertability on sentinel
dereferencing and operator++, but that seems
an acceptable price to pay for the simplified
build logic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79938 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/ilist.h')
-rw-r--r-- | include/llvm/ADT/ilist.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/llvm/ADT/ilist.h b/include/llvm/ADT/ilist.h index 1db648b0ff..1a3571dea5 100644 --- a/include/llvm/ADT/ilist.h +++ b/include/llvm/ADT/ilist.h @@ -39,8 +39,15 @@ #define LLVM_ADT_ILIST_H #include "llvm/ADT/iterator.h" +#include "llvm/Config/config.h" #include <cassert> +#if defined(LLVM_COMPACT_SENTINELS) && LLVM_COMPACT_SENTINELS +# define sentinel_tail_assert(COND) +#else +# define sentinel_tail_assert(COND) assert(COND) +#endif + namespace llvm { template<typename NodeTy, typename Traits> class iplist; @@ -189,12 +196,12 @@ public: // Accessors... operator pointer() const { - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return NodePtr; } reference operator*() const { - assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); + sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"); return *NodePtr; } pointer operator->() const { return &operator*(); } @@ -215,7 +222,7 @@ public: } ilist_iterator &operator++() { // preincrement - Advance NodePtr = Traits::getNext(NodePtr); - assert(NodePtr && "++'d off the end of an ilist!"); + sentinel_tail_assert(NodePtr && "++'d off the end of an ilist!"); return *this; } ilist_iterator operator--(int) { // postdecrement operators... |