LLVM API Documentation

llvm::StringPool Class Reference

#include <StringPool.h>

Collaboration diagram for llvm::StringPool:
[legend]

List of all members.

Public Member Functions

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

Friends

class PooledStringPtr

Classes

struct  PooledString


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 43 of file StringPool.h.


Constructor & Destructor Documentation

StringPool::StringPool (  ) 

Definition at line 20 of file StringPool.cpp.

StringPool::~StringPool (  ) 

Definition at line 22 of file StringPool.cpp.


Member Function Documentation

PooledStringPtr StringPool::intern ( const 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 26 of file StringPool.cpp.

References llvm::StringRef::begin(), llvm::StringMapEntry< ValueTy >::Create(), llvm::StringRef::end(), llvm::StringMapEntry< ValueTy >::getValue(), PooledStringPtr, and S.

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

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

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

Definition at line 71 of file StringPool.h.

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


Friends And Related Function Documentation

friend class PooledStringPtr [friend]

Definition at line 54 of file StringPool.h.

Referenced by intern().


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