LLVM API Documentation

Classes | Public Member Functions | Friends
llvm::StringPool Class Reference

#include <StringPool.h>

List of all members.

Classes

struct  PooledString

Public Member Functions

 StringPool ()
 ~StringPool ()
PooledStringPtr intern (StringRef Str)
bool empty () const

Friends

class PooledStringPtr

Detailed Description

StringPool - An interned string pool. Use the intern method to add a string. Strings are removed automatically as PooledStringPtrs are destroyed.

Definition at line 44 of file StringPool.h.


Constructor & Destructor Documentation

Definition at line 19 of file StringPool.cpp.

Definition at line 21 of file StringPool.cpp.

References llvm::StringMapImpl::empty().


Member Function Documentation

bool llvm::StringPool::empty ( ) const [inline]

empty - Checks whether the pool is empty. Returns true if so.

Definition at line 72 of file StringPool.h.

References llvm::StringMapImpl::empty().

Referenced by llvm::Function::clearGC().

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.

Referenced by llvm::Function::setGC().


Friends And Related Function Documentation

friend class PooledStringPtr [friend]

Definition at line 55 of file StringPool.h.

Referenced by intern().


The documentation for this class was generated from the following files: