diff options
| author | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-08 20:10:40 +0000 |
|---|---|---|
| committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2007-12-08 20:10:40 +0000 |
| commit | e33aec0dd68536e019d5a11fc94ce67ab5c6a20b (patch) | |
| tree | 2913737fd21619ac46d07d9e410fc053d5f1dc83 | |
| parent | 050f494f66207f937250da499e5807f8ac092177 (diff) | |
| download | bcm5719-llvm-e33aec0dd68536e019d5a11fc94ce67ab5c6a20b.tar.gz bcm5719-llvm-e33aec0dd68536e019d5a11fc94ce67ab5c6a20b.zip | |
Incorporating review feedback from Reid.
llvm-svn: 44713
| -rw-r--r-- | llvm/include/llvm/Support/StringPool.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/StringPool.h b/llvm/include/llvm/Support/StringPool.h index 07b2a8ddde2..692befffe99 100644 --- a/llvm/include/llvm/Support/StringPool.h +++ b/llvm/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); }; |

