[llvm-commits] [llvm] r80128 - in /llvm/trunk/include/llvm: ADT/ilist.h ADT/ilist_node.h BasicBlock.h CodeGen/MachineBasicBlock.h CodeGen/MachineFunction.h CodeGen/SelectionDAG.h Function.h

Gabor Greif ggreif at gmail.com
Wed Aug 26 12:16:32 PDT 2009


Author: ggreif
Date: Wed Aug 26 14:16:32 2009
New Revision: 80128

URL: http://llvm.org/viewvc/llvm-project?rev=80128&view=rev
Log:
Remove all the LLVM_COMPACTIFY_SENTINELS-related macro magic as discussed with Chris on IRC. Anybody wanting to debug sentinel dereferencing problems must revert this patch and perform the indicated modifications.

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

Modified: llvm/trunk/include/llvm/ADT/ilist.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/ilist.h (original)
+++ llvm/trunk/include/llvm/ADT/ilist.h Wed Aug 26 14:16:32 2009
@@ -41,21 +41,6 @@
 #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 @@
 
   // 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 @@
   }
   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...

Modified: llvm/trunk/include/llvm/ADT/ilist_node.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/ilist_node.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/ADT/ilist_node.h (original)
+++ llvm/trunk/include/llvm/ADT/ilist_node.h Wed Aug 26 14:16:32 2009
@@ -15,15 +15,6 @@
 #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 @@
   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

Modified: llvm/trunk/include/llvm/BasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/BasicBlock.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/BasicBlock.h (original)
+++ llvm/trunk/include/llvm/BasicBlock.h Wed Aug 26 14:16:32 2009
@@ -47,7 +47,7 @@
   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

Modified: llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineBasicBlock.h Wed Aug 26 14:16:32 2009
@@ -26,7 +26,7 @@
 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;

Modified: llvm/trunk/include/llvm/CodeGen/MachineFunction.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/MachineFunction.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/MachineFunction.h (original)
+++ llvm/trunk/include/llvm/CodeGen/MachineFunction.h Wed Aug 26 14:16:32 2009
@@ -38,7 +38,7 @@
 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);

Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Aug 26 14:16:32 2009
@@ -37,7 +37,7 @@
 
 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);

Modified: llvm/trunk/include/llvm/Function.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Function.h?rev=80128&r1=80127&r2=80128&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Function.h (original)
+++ llvm/trunk/include/llvm/Function.h Wed Aug 26 14:16:32 2009
@@ -45,7 +45,7 @@
 
   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 @@
 
   static ValueSymbolTable *getSymTab(Function *ItemParent);
 private:
-  mutable ILIST_NODE<Argument> Sentinel;
+  mutable ilist_half_node<Argument> Sentinel;
 };
 
 class Function : public GlobalValue,





More information about the llvm-commits mailing list