LLVM  3.7.0
Public Types | Public Member Functions | List of all members
llvm::StringTableBuilder Class Reference

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 ()
 

Detailed Description

Utility for building string tables with deduplicated suffixes.

Definition at line 20 of file StringTableBuilder.h.

Member Enumeration Documentation

Enumerator
ELF 
WinCOFF 
MachO 

Definition at line 32 of file StringTableBuilder.h.

Member Function Documentation

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::StringMap< ValueTy, AllocatorTy >::insert().

Referenced by llvm::MachObjectWriter::computeSymbolTable().

void StringTableBuilder::clear ( )
StringRef llvm::StringTableBuilder::data ( )
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)
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 51 of file StringTableBuilder.h.

References llvm::StringMap< ValueTy, AllocatorTy >::count().

Referenced by llvm::MachObjectWriter::computeSymbolTable().


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