LLVM
8.0.1
|
StringPool - An interned string pool. More...
#include "llvm/Support/StringPool.h"
Public Member Functions | |
StringPool () | |
~StringPool () | |
PooledStringPtr | intern (StringRef Str) |
intern - Adds a string to the pool and returns a reference-counted pointer to it. More... | |
bool | empty () const |
empty - Checks whether the pool is empty. More... | |
Friends | |
class | PooledStringPtr |
StringPool - An interned string pool.
Use the intern method to add a string. Strings are removed automatically as PooledStringPtrs are destroyed.
Definition at line 43 of file StringPool.h.
StringPool::StringPool | ( | ) |
Definition at line 19 of file StringPool.cpp.
StringPool::~StringPool | ( | ) |
Definition at line 21 of file StringPool.cpp.
References assert(), and llvm::StringMapImpl::empty().
|
inline |
empty - Checks whether the pool is empty.
Returns true if so.
Definition at line 71 of file StringPool.h.
References llvm::StringMapImpl::empty().
PooledStringPtr StringPool::intern | ( | StringRef | Str | ) |
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.
Definition at line 25 of file StringPool.cpp.
References llvm::StringMapEntry< ValueTy >::Create(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringMap< ValueTy, AllocatorTy >::find(), llvm::StringMapEntry< ValueTy >::getValue(), I, llvm::StringMap< ValueTy, AllocatorTy >::insert(), and PooledStringPtr.
|
friend |
Definition at line 54 of file StringPool.h.
Referenced by intern().