Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed with Chris...
authorGabor Greif <ggreif@gmail.com>
Wed, 26 Aug 2009 19:16:32 +0000 (19:16 +0000)
committerGabor Greif <ggreif@gmail.com>
Wed, 26 Aug 2009 19:16:32 +0000 (19:16 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80128 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/ilist.h
include/llvm/ADT/ilist_node.h
include/llvm/BasicBlock.h
include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineFunction.h
include/llvm/CodeGen/SelectionDAG.h
include/llvm/Function.h

index a451a184ce77c1532c2766b4e5b3df868d7ddc3a..2f35a7ad25c7f1d1762f772e252b92e2a11ca037 100644 (file)
 #include "llvm/ADT/iterator.h"
 #include <cassert>
 
-#undef LLVM_COMPACTIFY_SENTINELS
-/// @brief activate small sentinel structs
-/// Comment out if you want better debuggability
-/// of ilist<> end() iterators.
-/// See also llvm/ADT/ilist_node.h, where the
-/// same change must be made.
-///
-#define LLVM_COMPACTIFY_SENTINELS 1
-
-#if defined(LLVM_COMPACTIFY_SENTINELS) && LLVM_COMPACTIFY_SENTINELS
-#   define sentinel_tail_assert(COND)
-#else
-#   define sentinel_tail_assert(COND) assert(COND)
-#endif
-
 namespace llvm {
 
 template<typename NodeTy, typename Traits> class iplist;
@@ -204,12 +189,10 @@ public:
 
   // Accessors...
   operator pointer() const {
-    sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
     return NodePtr;
   }
 
   reference operator*() const {
-    sentinel_tail_assert(Traits::getNext(NodePtr) != 0 && "Dereferencing end()!");
     return *NodePtr;
   }
   pointer operator->() const { return &operator*(); }
@@ -230,7 +213,6 @@ public:
   }
   ilist_iterator &operator++() {      // preincrement - Advance
     NodePtr = Traits::getNext(NodePtr);
-    sentinel_tail_assert(NodePtr && "++'d off the end of an ilist!");
     return *this;
   }
   ilist_iterator operator--(int) {    // postdecrement operators...
index ae4a5905f83cd6f26d5e6fe9e5cfa56d5fe4d419..c28169fde5f2c1901d2d00a66df27ac71f853a9a 100644 (file)
 #ifndef LLVM_ADT_ILIST_NODE_H
 #define LLVM_ADT_ILIST_NODE_H
 
-#undef LLVM_COMPACTIFY_SENTINELS
-/// @brief activate small sentinel structs
-/// Comment out if you want better debuggability
-/// of ilist<> end() iterators.
-/// See also llvm/ADT/ilist.h, where the
-/// same change must be made.
-///
-#define LLVM_COMPACTIFY_SENTINELS 1
-
 namespace llvm {
 
 template<typename NodeTy>
@@ -60,18 +51,6 @@ protected:
   ilist_node() : Next(0) {}
 };
 
-/// When assertions are off, the Next field of sentinels
-/// will not be accessed. So it is not necessary to allocate
-/// space for it. The following macro selects the most
-/// efficient traits class. The LLVM_COMPACTIFY_SENTINELS
-/// preprocessor symbol controls this.
-///
-#if defined(LLVM_COMPACTIFY_SENTINELS) && LLVM_COMPACTIFY_SENTINELS
-#   define ILIST_NODE ilist_half_node
-#else
-#   define ILIST_NODE ilist_node
-#endif
-
 } // End llvm namespace
 
 #endif
index 16f680d2438427b731f6ff44cfd7960682cdc5ba..3f535076eaa39ff4bf5867f9b43144e65db34313 100644 (file)
@@ -47,7 +47,7 @@ template<> struct ilist_traits<Instruction>
   Instruction *ensureHead(Instruction*) const { return createSentinel(); }
   static void noteHead(Instruction*, Instruction*) {}
 private:
-  mutable ILIST_NODE<Instruction> Sentinel;
+  mutable ilist_half_node<Instruction> Sentinel;
 };
 
 /// This represents a single basic block in LLVM. A basic block is simply a
index 52e56422c8cb0df2fd1c1b333f0142b92bfcb4ef..2a9e86a04c09f7648925c251fb7931f27437a592 100644 (file)
@@ -26,7 +26,7 @@ class raw_ostream;
 template <>
 struct ilist_traits<MachineInstr> : public ilist_default_traits<MachineInstr> {
 private:
-  mutable ILIST_NODE<MachineInstr> Sentinel;
+  mutable ilist_half_node<MachineInstr> Sentinel;
 
   // this is only set by the MachineBasicBlock owning the LiveList
   friend class MachineBasicBlock;
index 92f46b070f503291826909ed675cbcb2075e77ed..10a5fb4c4130e9a8b03a4bd066705a4679be06b2 100644 (file)
@@ -38,7 +38,7 @@ class TargetRegisterClass;
 template <>
 struct ilist_traits<MachineBasicBlock>
     : public ilist_default_traits<MachineBasicBlock> {
-  mutable ILIST_NODE<MachineBasicBlock> Sentinel;
+  mutable ilist_half_node<MachineBasicBlock> Sentinel;
 public:
   MachineBasicBlock *createSentinel() const {
     return static_cast<MachineBasicBlock*>(&Sentinel);
index b0fb5d8b1f2499c215a7d5a75a2ed1de912165be..426ab15c9bdadc734df6729b17ea84b2b28485cf 100644 (file)
@@ -37,7 +37,7 @@ class FunctionLoweringInfo;
 
 template<> struct ilist_traits<SDNode> : public ilist_default_traits<SDNode> {
 private:
-  mutable ILIST_NODE<SDNode> Sentinel;
+  mutable ilist_half_node<SDNode> Sentinel;
 public:
   SDNode *createSentinel() const {
     return static_cast<SDNode*>(&Sentinel);
index 6c3d41e21af4f198ff0d8c18f24ae291a490bca7..7ff18b376d53f46e6e75137ded7ee6a2124e9272 100644 (file)
@@ -45,7 +45,7 @@ template<> struct ilist_traits<BasicBlock>
 
   static ValueSymbolTable *getSymTab(Function *ItemParent);
 private:
-  mutable ILIST_NODE<BasicBlock> Sentinel;
+  mutable ilist_half_node<BasicBlock> Sentinel;
 };
 
 template<> struct ilist_traits<Argument>
@@ -62,7 +62,7 @@ template<> struct ilist_traits<Argument>
 
   static ValueSymbolTable *getSymTab(Function *ItemParent);
 private:
-  mutable ILIST_NODE<Argument> Sentinel;
+  mutable ilist_half_node<Argument> Sentinel;
 };
 
 class Function : public GlobalValue,