LLVM API Documentation
Utility for building string tables with deduplicated suffixes. More...
#include <StringTableBuilder.h>
Public Member Functions | |
StringRef | add (StringRef s) |
Add a string to the builder. Returns a StringRef to the internal copy of s. Can only be used before the table is finalized. | |
void | finalize () |
Analyze the strings and build the final table. No more strings can be added after this point. | |
StringRef | data () |
Retrieve the string table data. Can only be used after the table is finalized. | |
size_t | getOffset (StringRef s) |
Get the offest of a string in the string table. Can only be used after the table is finalized. |
Utility for building string tables with deduplicated suffixes.
Definition at line 20 of file StringTableBuilder.h.
StringRef llvm::StringTableBuilder::add | ( | StringRef | s | ) | [inline] |
Add a string to the builder. Returns a StringRef to the internal copy of s. Can only be used before the table is finalized.
Definition at line 27 of file StringTableBuilder.h.
References llvm::StringMapEntry< ValueTy >::getKey(), and llvm::StringMap< ValueTy, AllocatorTy >::GetOrCreateValue().
StringRef llvm::StringTableBuilder::data | ( | ) | [inline] |
Retrieve the string table data. Can only be used after the table is finalized.
Definition at line 38 of file StringTableBuilder.h.
void StringTableBuilder::finalize | ( | ) |
Analyze the strings and build the final table. No more strings can be added after this point.
Definition at line 28 of file StringTableBuilder.cpp.
References llvm::SmallVectorTemplateCommon< T >::begin(), llvm::StringMap< ValueTy, AllocatorTy >::begin(), compareBySuffix(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringRef::endswith(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), and llvm::StringMapImpl::size().
size_t llvm::StringTableBuilder::getOffset | ( | StringRef | s | ) | [inline] |
Get the offest of a string in the string table. Can only be used after the table is finalized.
Definition at line 45 of file StringTableBuilder.h.
References llvm::StringMap< ValueTy, AllocatorTy >::count().