aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support
diff options
context:
space:
mode:
authorGordon Henriksen <gordonhenriksen@mac.com>2007-12-08 20:10:40 +0000
committerGordon Henriksen <gordonhenriksen@mac.com>2007-12-08 20:10:40 +0000
commit7446d0cfc551c79afa4a12296f107936ebe5e315 (patch)
tree87454a855c31234131d91880660a5aba39dd3d49 /include/llvm/Support
parent921f0d40ececc91649bff9feeef37a3c89250608 (diff)
downloadexternal_llvm-7446d0cfc551c79afa4a12296f107936ebe5e315.zip
external_llvm-7446d0cfc551c79afa4a12296f107936ebe5e315.tar.gz
external_llvm-7446d0cfc551c79afa4a12296f107936ebe5e315.tar.bz2
Incorporating review feedback from Reid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44713 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r--include/llvm/Support/StringPool.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/llvm/Support/StringPool.h b/include/llvm/Support/StringPool.h
index 07b2a8d..692beff 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);
};