diff options
Diffstat (limited to 'include/llvm/Support/StringPool.h')
-rw-r--r-- | include/llvm/Support/StringPool.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/StringPool.h b/include/llvm/Support/StringPool.h index 07b2a8ddde..692befffe9 100644 --- a/include/llvm/Support/StringPool.h +++ b/include/llvm/Support/StringPool.h @@ -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,7 +61,14 @@ 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); }; |