Use MachineBasicBlock::transferSuccessors.
[oota-llvm.git] / include / llvm / Support / StringPool.h
index 07b2a8ddde2afd262a117fed63c599eb2a4b3e69..8661f60e2ef9665e41ea68c3aec916e19ccdce11 100644 (file)
@@ -2,8 +2,8 @@
 //
 //                     The LLVM Compiler Infrastructure
 //
-// This file was developed by Gordon Henriksen and is distributed under the
-// University of Illinois Open Source License. See LICENSE.TXT for details.
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
 //
 //===----------------------------------------------------------------------===//
 //
@@ -29,7 +29,7 @@
 #ifndef LLVM_SUPPORT_STRINGPOOL_H
 #define LLVM_SUPPORT_STRINGPOOL_H
 
-#include <llvm/ADT/StringMap.h>
+#include "llvm/ADT/StringMap.h"
 #include <new>
 #include <cassert>
 
@@ -41,6 +41,8 @@ namespace llvm {
   /// string. Strings are removed automatically as PooledStringPtrs are
   /// destroyed.
   class StringPool {
+    /// PooledString - This is the value of an entry in the pool's interning
+    /// table.
     struct PooledString {
       StringPool *Pool;  ///< So the string can remove itself.
       unsigned Refcount; ///< Number of referencing PooledStringPtrs.
@@ -59,8 +61,19 @@ namespace llvm {
     StringPool();
     ~StringPool();
     
+    /// intern - Adds a string to the pool and returns a reference-counted
+    /// pointer to it. No additional memory is allocated if the string already
+    /// exists in the pool.
     PooledStringPtr intern(const char *Begin, const char *End);
+    
+    /// intern - Adds a null-terminated string to the pool and returns a
+    /// reference-counted pointer to it. No additional memory is allocated if
+    /// the string already exists in the pool.
     inline PooledStringPtr intern(const char *Str);
+    
+    /// empty - Checks whether the pool is empty. Returns true if so.
+    /// 
+    inline bool empty() const { return InternTable.empty(); }
   };
   
   /// PooledStringPtr - A pointer to an interned string. Use operator bool to
@@ -97,7 +110,7 @@ namespace llvm {
         return;
       if (--S->getValue().Refcount == 0) {
         S->getValue().Pool->InternTable.remove(S);
-        delete S;
+        S->Destroy();
       }
       S = 0;
     }