Add some debug output.
authorReid Spencer <rspencer@reidspencer.com>
Wed, 31 Jan 2007 21:27:38 +0000 (21:27 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Wed, 31 Jan 2007 21:27:38 +0000 (21:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33718 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/FoldingSet.cpp

index dbf3a583d86013c27861d08246dd361cbbc15599..1d04abf4e46f9bb528d5f776c36d2987e9165ef8 100644 (file)
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "foldingset"
 #include "llvm/ADT/FoldingSet.h"
 #include "llvm/Support/MathExtras.h"
+#include "llvm/Support/Debug.h"
 #include <cassert>
 using namespace llvm;
 
@@ -225,6 +227,7 @@ FoldingSetImpl::Node *FoldingSetImpl::FindNodeOrInsertPos(const NodeID &ID,
 /// FindNodeOrInsertPos.
 void FoldingSetImpl::InsertNode(Node *N, void *InsertPos) {
   // Do we need to grow the hashtable?
+  DEBUG(DOUT << "INSERT: " << N << '\n');
   if (NumNodes+1 > NumBuckets*2) {
     GrowHashTable();
     NodeID ID;
@@ -255,6 +258,7 @@ bool FoldingSetImpl::RemoveNode(Node *N) {
   // Because each bucket is a circular list, we don't need to compute N's hash
   // to remove it.  Chase around the list until we find the node (or bucket)
   // which points to N.
+  DEBUG(DOUT << "REMOVE: " << N << '\n');
   void *Ptr = N->getNextInBucket();
   if (Ptr == 0) return false;  // Not in folding set.