|
LLVM
3.7.0
|
Utility for building string tables with deduplicated suffixes. More...
#include <StringTableBuilder.h>
Public Types | |
| enum | Kind { ELF, WinCOFF, MachO } |
Public Member Functions | |
| StringRef | add (StringRef s) |
| Add a string to the builder. More... | |
| void | finalize (Kind kind) |
| Analyze the strings and build the final table. More... | |
| StringRef | data () |
| Retrieve the string table data. More... | |
| size_t | getOffset (StringRef s) |
| Get the offest of a string in the string table. More... | |
| void | clear () |
Utility for building string tables with deduplicated suffixes.
Definition at line 20 of file StringTableBuilder.h.
| Enumerator | |
|---|---|
| ELF | |
| WinCOFF | |
| MachO | |
Definition at line 32 of file StringTableBuilder.h.
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::StringMap< ValueTy, AllocatorTy >::insert().
Referenced by llvm::MachObjectWriter::computeSymbolTable().
| void StringTableBuilder::clear | ( | ) |
Definition at line 85 of file StringTableBuilder.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::clear(), and llvm::SmallVectorImpl< T >::clear().
Referenced by llvm::MachObjectWriter::reset().
|
inline |
Retrieve the string table data.
Can only be used after the table is finalized.
Definition at line 44 of file StringTableBuilder.h.
Referenced by llvm::MachObjectWriter::writeObject().
| void StringTableBuilder::finalize | ( | Kind | kind | ) |
Analyze the strings and build the final table.
No more strings can be added after this point.
Definition at line 30 of file StringTableBuilder.cpp.
References llvm::SmallString< InternalLen >::append(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::StringMap< ValueTy, AllocatorTy >::begin(), compareBySuffix(), llvm::SmallVectorTemplateCommon< T, typename >::data(), ELF, llvm::SmallVectorTemplateCommon< T >::end(), llvm::StringMap< ValueTy, AllocatorTy >::end(), llvm::StringRef::endswith(), MachO, llvm::COFF::NameSize, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorImpl< T >::reserve(), size, llvm::StringMapImpl::size(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and WinCOFF.
Referenced by llvm::MachObjectWriter::computeSymbolTable().
|
inline |
Get the offest of a string in the string table.
Can only be used after the table is finalized.
Definition at line 51 of file StringTableBuilder.h.
References llvm::StringMap< ValueTy, AllocatorTy >::count().
Referenced by llvm::MachObjectWriter::computeSymbolTable().
1.8.6