LLVM API Documentation
#include <SmallString.h>
Public Member Functions | |
SmallString () | |
Default ctor - Initialize to empty. More... | |
SmallString (StringRef S) | |
Initialize from a StringRef. More... | |
template<typename ItTy > | |
SmallString (ItTy S, ItTy E) | |
Initialize with a range. More... | |
SmallString (const SmallString &RHS) | |
Copy ctor. More... | |
String Assignment | |
void | assign (size_t NumElts, char Elt) |
Assign from a repeated element. More... | |
template<typename in_iter > | |
void | assign (in_iter S, in_iter E) |
Assign from an iterator pair. More... | |
void | assign (StringRef RHS) |
Assign from a StringRef. More... | |
void | assign (const SmallVectorImpl< char > &RHS) |
Assign from a SmallVector. More... | |
String Concatenation | |
template<typename in_iter > | |
void | append (in_iter S, in_iter E) |
Append from an iterator pair. More... | |
void | append (size_t NumInputs, char Elt) |
void | append (StringRef RHS) |
Append from a StringRef. More... | |
void | append (const SmallVectorImpl< char > &RHS) |
Append from a SmallVector. More... | |
String Comparison | |
bool | equals (StringRef RHS) const |
bool | equals_lower (StringRef RHS) const |
Check for string equality, ignoring case. More... | |
int | compare (StringRef RHS) const |
int | compare_lower (StringRef RHS) const |
compare_lower - Compare two strings, ignoring case. More... | |
int | compare_numeric (StringRef RHS) const |
String Predicates | |
bool | startswith (StringRef Prefix) const |
startswith - Check if this string starts with the given Prefix . More... | |
bool | endswith (StringRef Suffix) const |
endswith - Check if this string ends with the given Suffix . More... | |
String Searching | |
size_t | find (char C, size_t From=0) const |
size_t | find (StringRef Str, size_t From=0) const |
size_t | rfind (char C, size_t From=StringRef::npos) const |
size_t | rfind (StringRef Str) const |
size_t | find_first_of (char C, size_t From=0) const |
size_t | find_first_of (StringRef Chars, size_t From=0) const |
size_t | find_first_not_of (char C, size_t From=0) const |
size_t | find_first_not_of (StringRef Chars, size_t From=0) const |
size_t | find_last_of (char C, size_t From=StringRef::npos) const |
size_t | find_last_of (StringRef Chars, size_t From=StringRef::npos) const |
Helpful Algorithms | |
size_t | count (char C) const |
Return the number of occurrences of C in the string. More... | |
size_t | count (StringRef Str) const |
Substring Operations | |
StringRef | substr (size_t Start, size_t N=StringRef::npos) const |
StringRef | slice (size_t Start, size_t End) const |
StringRef | str () const |
Explicit conversion to StringRef. More... | |
const char * | c_str () |
operator StringRef () const | |
Implicit conversion to StringRef. More... | |
const SmallString & | operator= (StringRef RHS) |
SmallString & | operator+= (StringRef RHS) |
SmallString & | operator+= (char C) |
![]() | |
SmallVector () | |
SmallVector (unsigned Size, const char &Value=char()) | |
SmallVector (ItTy S, ItTy E) | |
SmallVector (const SmallVector &RHS) | |
const SmallVector & | operator= (const SmallVector &RHS) |
![]() | |
~SmallVectorImpl () | |
void | clear () |
void | resize (unsigned N) |
void | resize (unsigned N, const char &NV) |
void | reserve (unsigned N) |
charLLVM_ATTRIBUTE_UNUSED_RESULT | pop_back_val () |
void | swap (SmallVectorImpl &RHS) |
void | append (in_iter in_start, in_iter in_end) |
void | append (size_type NumInputs, const char &Elt) |
void | assign (unsigned NumElts, const char &Elt) |
iterator | erase (iterator I) |
iterator | erase (iterator S, iterator E) |
iterator | insert (iterator I, const char &Elt) |
iterator | insert (iterator I, size_type NumToInsert, const char &Elt) |
iterator | insert (iterator I, ItTy From, ItTy To) |
SmallVectorImpl & | operator= (const SmallVectorImpl &RHS) |
bool | operator== (const SmallVectorImpl &RHS) const |
bool | operator!= (const SmallVectorImpl &RHS) const |
bool | operator< (const SmallVectorImpl &RHS) const |
void | set_size (unsigned N) |
![]() | |
void | push_back (const T &Elt) |
void | pop_back () |
![]() | |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
reverse_iterator | rbegin () |
const_reverse_iterator | rbegin () const |
reverse_iterator | rend () |
const_reverse_iterator | rend () const |
size_type | size () const |
size_type | max_size () const |
size_t | capacity () const |
pointer | data () |
data - Return a pointer to the vector's buffer, even if empty(). More... | |
const_pointer | data () const |
data - Return a pointer to the vector's buffer, even if empty(). More... | |
reference | operator[] (unsigned idx) |
const_reference | operator[] (unsigned idx) const |
reference | front () |
const_reference | front () const |
reference | back () |
const_reference | back () const |
![]() | |
size_t | size_in_bytes () const |
size_in_bytes - This returns size()*sizeof(T). More... | |
size_t | capacity_in_bytes () const |
capacity_in_bytes - This returns capacity()*sizeof(T). More... | |
bool LLVM_ATTRIBUTE_UNUSED_RESULT | empty () const |
Additional Inherited Members | |
![]() | |
typedef SuperClass::iterator | iterator |
typedef SuperClass::size_type | size_type |
![]() | |
typedef size_t | size_type |
typedef ptrdiff_t | difference_type |
typedef T | value_type |
typedef T * | iterator |
typedef const T * | const_iterator |
typedef std::reverse_iterator < const_iterator > | const_reverse_iterator |
typedef std::reverse_iterator < iterator > | reverse_iterator |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | pointer |
typedef const T * | const_pointer |
![]() | |
SmallVectorImpl (unsigned N) | |
![]() | |
SmallVectorTemplateBase (size_t Size) | |
void | grow (size_t MinSize=0) |
![]() | |
SmallVectorTemplateCommon (size_t Size) | |
void | grow_pod (size_t MinSizeInBytes, size_t TSize) |
bool | isSmall () const |
void | resetToSmall () |
resetToSmall - Put this vector in a state of being small. More... | |
void | setEnd (T *P) |
iterator | capacity_ptr () |
const_iterator | capacity_ptr () const |
![]() | |
SmallVectorBase (void *FirstEl, size_t Size) | |
void | grow_pod (void *FirstEl, size_t MinSizeInBytes, size_t TSize) |
![]() | |
static void | destroy_range (T *S, T *E) |
template<typename It1 , typename It2 > | |
static It2 | move (It1 I, It1 E, It2 Dest) |
template<typename It1 , typename It2 > | |
static It2 | move_backward (It1 I, It1 E, It2 Dest) |
template<typename It1 , typename It2 > | |
static void | uninitialized_move (It1 I, It1 E, It2 Dest) |
template<typename It1 , typename It2 > | |
static void | uninitialized_copy (It1 I, It1 E, It2 Dest) |
![]() | |
void * | BeginX |
void * | EndX |
void * | CapacityX |
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. operator+ etc).
Definition at line 25 of file SmallString.h.
|
inline |
Default ctor - Initialize to empty.
Definition at line 28 of file SmallString.h.
|
inline |
Initialize from a StringRef.
Definition at line 31 of file SmallString.h.
|
inline |
Initialize with a range.
Definition at line 35 of file SmallString.h.
|
inline |
Copy ctor.
Definition at line 38 of file SmallString.h.
|
inline |
Append from an iterator pair.
Definition at line 77 of file SmallString.h.
Referenced by llvm::AsmPrinter::GetSymbolWithGlobalValueBase(), llvm::SmallString< 256 >::operator+=(), parseBackslash(), and llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal().
|
inline |
Definition at line 81 of file SmallString.h.
|
inline |
Append from a StringRef.
Definition at line 87 of file SmallString.h.
|
inline |
Append from a SmallVector.
Definition at line 92 of file SmallString.h.
|
inline |
Assign from a repeated element.
Definition at line 48 of file SmallString.h.
|
inline |
Assign from an iterator pair.
Definition at line 54 of file SmallString.h.
|
inline |
Assign from a StringRef.
Definition at line 60 of file SmallString.h.
|
inline |
Assign from a SmallVector.
Definition at line 66 of file SmallString.h.
|
inline |
Definition at line 273 of file SmallString.h.
Referenced by LTOCodeGenerator::compile_to_file(), llvm::DILineInfo::getFileName(), llvm::DILineInfo::getFunctionName(), llvm::LockFileManager::LockFileManager(), parseDouble(), llvm::cl::TokenizeGNUCommandLine(), and llvm::cl::TokenizeWindowsCommandLine().
|
inline |
Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less than, equal to, or greater than the RHS
.
Definition at line 113 of file SmallString.h.
|
inline |
compare_lower - Compare two strings, ignoring case.
Definition at line 118 of file SmallString.h.
|
inline |
compare_numeric - Compare two strings, treating sequences of digits as numbers.
Definition at line 124 of file SmallString.h.
|
inline |
Return the number of occurrences of C
in the string.
Definition at line 226 of file SmallString.h.
|
inline |
Return the number of non-overlapped occurrences of Str
in the string.
Definition at line 232 of file SmallString.h.
|
inline |
endswith - Check if this string ends with the given Suffix
.
Definition at line 138 of file SmallString.h.
|
inline |
Check for string equality. This is more efficient than compare() when the relative ordering of inequal strings isn't needed.
Definition at line 102 of file SmallString.h.
Referenced by llvm::DILineInfo::operator==().
|
inline |
Check for string equality, ignoring case.
Definition at line 107 of file SmallString.h.
|
inline |
find - Search for the first character C
in the string.
C
, or npos if not found. Definition at line 150 of file SmallString.h.
|
inline |
Search for the first string Str
in the string.
Str
, or npos if not found. Definition at line 158 of file SmallString.h.
|
inline |
Find the first character in the string that is not C
or npos if not found.
Definition at line 194 of file SmallString.h.
|
inline |
Find the first character in the string that is not in the string Chars
, or npos if not found.
Complexity: O(size() + Chars.size())
Definition at line 202 of file SmallString.h.
|
inline |
Find the first character in the string that is C
, or npos if not found. Same as find.
Definition at line 180 of file SmallString.h.
|
inline |
Find the first character in the string that is in Chars
, or npos if not found.
Complexity: O(size() + Chars.size())
Definition at line 188 of file SmallString.h.
|
inline |
Find the last character in the string that is C
, or npos if not found.
Definition at line 208 of file SmallString.h.
|
inline |
Find the last character in the string that is in C
, or npos if not found.
Complexity: O(size() + Chars.size())
Definition at line 216 of file SmallString.h.
|
inline |
Implicit conversion to StringRef.
Definition at line 280 of file SmallString.h.
|
inline |
Definition at line 288 of file SmallString.h.
|
inline |
Definition at line 292 of file SmallString.h.
|
inline |
Definition at line 283 of file SmallString.h.
|
inline |
Search for the last character C
in the string.
C
, or npos if not found. Definition at line 166 of file SmallString.h.
|
inline |
Search for the last string Str
in the string.
Str
, or npos if not found. Definition at line 174 of file SmallString.h.
|
inline |
Return a reference to the substring from [Start, End).
Start | The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned. |
End | The index following the last character to include in the substring. If this is npos, or less than Start , or exceeds the number of characters remaining in the string, the string suffix (starting with Start ) will be returned. |
Definition at line 263 of file SmallString.h.
|
inline |
startswith - Check if this string starts with the given Prefix
.
Definition at line 133 of file SmallString.h.
Referenced by GetSymbolFromOperand().
|
inline |
Explicit conversion to StringRef.
Definition at line 270 of file SmallString.h.
Referenced by llvm::SmallString< 256 >::compare(), llvm::SmallString< 256 >::compare_lower(), llvm::SmallString< 256 >::compare_numeric(), llvm::SmallString< 256 >::count(), CrashHandler(), llvm::createGraphFilename(), llvm::APInt::dump(), emitComments(), llvm::StringToOffsetTable::EmitString(), llvm::SmallString< 256 >::endswith(), llvm::SmallString< 256 >::equals(), llvm::SmallString< 256 >::equals_lower(), llvm::SmallString< 256 >::find(), llvm::SmallString< 256 >::find_first_not_of(), llvm::SmallString< 256 >::find_first_of(), llvm::SmallString< 256 >::find_last_of(), llvm::MSP430MCInstLower::GetConstantPoolIndexSymbol(), llvm::AsmPrinter::GetExternalSymbolSymbol(), llvm::DWARFDebugLine::LineTable::getFileNameByIndex(), getFileNameForCompileUnit(), llvm::getFnSpecificMDNode(), llvm::jitprofiling::FilenameCache::getFullPath(), llvm::MachineFunction::getJTISymbol(), llvm::MSP430MCInstLower::GetJumpTableSymbol(), llvm::MCContext::getMachOSection(), llvm::MCContext::GetOrCreateSymbol(), llvm::getOrInsertFnSpecificMDNode(), llvm::TargetLoweringObjectFile::getSymbol(), GetSymbolFromOperand(), llvm::AsmPrinter::GetSymbolWithGlobalValueBase(), llvm::LockFileManager::LockFileManager(), llvm::MCContext::LookupSymbol(), llvm::opt::ArgList::MakeArgString(), llvm::SmallString< 256 >::operator StringRef(), llvm::APInt::print(), llvm::SmallString< 256 >::rfind(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal(), llvm::Triple::setArchName(), llvm::FileRemover::setFile(), llvm::SmallString< 256 >::slice(), llvm::SmallString< 256 >::startswith(), llvm::SmallString< 256 >::substr(), llvm::APInt::toString(), llvm::LockFileManager::waitForUnlock(), llvm::WriteConstantInternal(), writeFragment(), llvm::MachObjectWriter::WriteObject(), llvm::FileRemover::~FileRemover(), and llvm::LockFileManager::~LockFileManager().
|
inline |
Return a reference to the substring from [Start, Start + N).
Start | The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned. |
N | The number of characters to included in the substring. If N exceeds the number of characters remaining in the string, the string suffix (starting with Start ) will be returned. |
Definition at line 249 of file SmallString.h.