[llvm-commits] [llvm] r44713 - /llvm/trunk/include/llvm/Support/StringPool.h
Gordon Henriksen
gordonhenriksen at mac.com
Sat Dec 8 12:10:43 PST 2007
Author: gordon
Date: Sat Dec 8 14:10:40 2007
New Revision: 44713
URL: http://llvm.org/viewvc/llvm-project?rev=44713&view=rev
Log:
Incorporating review feedback from Reid.
Modified:
llvm/trunk/include/llvm/Support/StringPool.h
Modified: llvm/trunk/include/llvm/Support/StringPool.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/StringPool.h?rev=44713&r1=44712&r2=44713&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/StringPool.h (original)
+++ llvm/trunk/include/llvm/Support/StringPool.h Sat Dec 8 14:10:40 2007
@@ -41,6 +41,8 @@
/// 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 @@
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);
};
More information about the llvm-commits
mailing list