LLVM  mainline
Public Types | Public Member Functions | Static Public Attributes
llvm::StringRef Class Reference

StringRef - Represent a constant reference to a string, i.e. More...

#include <StringRef.h>

Collaboration diagram for llvm::StringRef:
Collaboration graph
[legend]

List of all members.

Public Types

typedef const char * iterator
typedef const char * const_iterator
typedef size_t size_type

Public Member Functions

iterator begin () const
iterator end () const
const unsigned char * bytes_begin () const
const unsigned char * bytes_end () const
LLVM_ATTRIBUTE_ALWAYS_INLINE
const char * 
data () const
 data - Get a pointer to the start of the string (which may not be null terminated).
LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty () const
 empty - Check if the string is empty.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_t size () const
 size - Get the string size.
char front () const
 front - Get the first character in the string.
char back () const
 back - Get the last character in the string.
template<typename Allocator >
StringRef copy (Allocator &A) const
LLVM_ATTRIBUTE_ALWAYS_INLINE bool equals (StringRef RHS) const
 equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.
bool equals_lower (StringRef RHS) const
 equals_lower - Check for string equality, ignoring case.
LLVM_ATTRIBUTE_ALWAYS_INLINE int compare (StringRef RHS) const
 compare - Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less than, equal to, or greater than the RHS.
int compare_lower (StringRef RHS) const
 compare_lower - Compare two strings, ignoring case.
int compare_numeric (StringRef RHS) const
 compare_numeric - Compare two strings, treating sequences of digits as numbers.
unsigned edit_distance (StringRef Other, bool AllowReplacements=true, unsigned MaxEditDistance=0) const
 Determine the edit distance between this string and another string.
std::string str () const
 str - Get the contents as an std::string.
char operator[] (size_t Index) const
 operator std::string () const
LLVM_ATTRIBUTE_ALWAYS_INLINE bool startswith (StringRef Prefix) const
 Check if this string starts with the given Prefix.
bool startswith_lower (StringRef Prefix) const
 Check if this string starts with the given Prefix, ignoring case.
LLVM_ATTRIBUTE_ALWAYS_INLINE bool endswith (StringRef Suffix) const
 Check if this string ends with the given Suffix.
bool endswith_lower (StringRef Suffix) const
 Check if this string ends with the given Suffix, ignoring case.
LLVM_ATTRIBUTE_ALWAYS_INLINE size_t find (char C, size_t From=0) const
 Search for the first character C in the string.
size_t find (StringRef Str, size_t From=0) const
 Search for the first string Str in the string.
size_t rfind (char C, size_t From=npos) const
 Search for the last character C in the string.
size_t rfind (StringRef Str) const
 Search for the last string Str in the string.
size_t find_first_of (char C, size_t From=0) const
 Find the first character in the string that is C, or npos if not found.
size_t find_first_of (StringRef Chars, size_t From=0) const
 Find the first character in the string that is in Chars, or npos if not found.
size_t find_first_not_of (char C, size_t From=0) const
 Find the first character in the string that is not C or npos if not found.
size_t find_first_not_of (StringRef Chars, size_t From=0) const
 Find the first character in the string that is not in the string Chars, or npos if not found.
size_t find_last_of (char C, size_t From=npos) const
 Find the last character in the string that is C, or npos if not found.
size_t find_last_of (StringRef Chars, size_t From=npos) const
 Find the last character in the string that is in C, or npos if not found.
size_t find_last_not_of (char C, size_t From=npos) const
 Find the last character in the string that is not C, or npos if not found.
size_t find_last_not_of (StringRef Chars, size_t From=npos) const
 Find the last character in the string that is not in Chars, or npos if not found.
size_t count (char C) const
 Return the number of occurrences of C in the string.
size_t count (StringRef Str) const
 Return the number of non-overlapped occurrences of Str in the string.
template<typename T >
std::enable_if
< std::numeric_limits< T >
::is_signed, bool >::type 
getAsInteger (unsigned Radix, T &Result) const
 Parse the current string as an integer of the specified radix.
template<typename T >
std::enable_if
<!std::numeric_limits< T >
::is_signed, bool >::type 
getAsInteger (unsigned Radix, T &Result) const
bool getAsInteger (unsigned Radix, APInt &Result) const
 Parse the current string as an integer of the specified Radix, or of an autosensed radix if the Radix given is 0.
std::string lower () const
std::string upper () const
 Convert the given ASCII string to uppercase.
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringRef 
substr (size_t Start, size_t N=npos) const
 Return a reference to the substring from [Start, Start + N).
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringRef 
drop_front (size_t N=1) const
 Return a StringRef equal to 'this' but with the first N elements dropped.
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringRef 
drop_back (size_t N=1) const
 Return a StringRef equal to 'this' but with the last N elements dropped.
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringRef 
slice (size_t Start, size_t End) const
 Return a reference to the substring from [Start, End).
std::pair< StringRef, StringRefsplit (char Separator) const
 Split into two substrings around the first occurrence of a separator character.
std::pair< StringRef, StringRefsplit (StringRef Separator) const
 Split into two substrings around the first occurrence of a separator string.
void split (SmallVectorImpl< StringRef > &A, StringRef Separator, int MaxSplit=-1, bool KeepEmpty=true) const
 Split into substrings around the occurrences of a separator string.
void split (SmallVectorImpl< StringRef > &A, char Separator, int MaxSplit=-1, bool KeepEmpty=true) const
 Split into substrings around the occurrences of a separator character.
std::pair< StringRef, StringRefrsplit (char Separator) const
 Split into two substrings around the last occurrence of a separator character.
StringRef ltrim (StringRef Chars=" \t\n\v\f\r") const
 Return string with consecutive characters in Chars starting from the left removed.
StringRef rtrim (StringRef Chars=" \t\n\v\f\r") const
 Return string with consecutive characters in Chars starting from the right removed.
StringRef trim (StringRef Chars=" \t\n\v\f\r") const
 Return string with consecutive characters in Chars starting from the left and right removed.
Constructors
 StringRef ()
 Construct an empty string ref.
 StringRef (const char *Str)
 Construct a string ref from a cstring.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef (const char *data, size_t length)
 Construct a string ref from a pointer and length.
LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef (const std::string &Str)
 Construct a string ref from an std::string.

Static Public Attributes

static const size_t npos = ~size_t(0)

Detailed Description

StringRef - Represent a constant reference to a string, i.e.

a character array and a length, which need not be null terminated.

This class does not own the string data, it is expected to be used in situations where the character data resides in some other buffer, whose lifetime extends past that of the StringRef. For this reason, it is not in general safe to store a StringRef.

Definition at line 41 of file StringRef.h.


Member Typedef Documentation

Definition at line 44 of file StringRef.h.

Definition at line 43 of file StringRef.h.

Definition at line 46 of file StringRef.h.


Constructor & Destructor Documentation

Construct an empty string ref.

Definition at line 68 of file StringRef.h.

Referenced by drop_back(), and split().

llvm::StringRef::StringRef ( const char *  Str) [inline]

Construct a string ref from a cstring.

Definition at line 71 of file StringRef.h.

LLVM_ATTRIBUTE_ALWAYS_INLINE llvm::StringRef::StringRef ( const char *  data,
size_t  length 
) [inline]

Construct a string ref from a pointer and length.

Definition at line 79 of file StringRef.h.

Construct a string ref from an std::string.

Definition at line 87 of file StringRef.h.


Member Function Documentation

char llvm::StringRef::back ( ) const [inline]

back - Get the last character in the string.

Definition at line 125 of file StringRef.h.

Referenced by llvm::ConstantDataSequential::isCString(), llvm::yaml::needsQuotes(), parsePhysicalReg(), and unescapeQuotedString().

iterator llvm::StringRef::begin ( ) const [inline]

Definition at line 92 of file StringRef.h.

Referenced by llvm::sys::path::append(), llvm::SmallString< 256 >::assign(), llvm::MDString::begin(), llvm::yaml::final::BlockScalarNode(), llvm::APFloat::convertFromString(), llvm::convertUTF8ToUTF16String(), llvm::ConvertUTF8toWide(), llvm::MachineFunction::createExternalSymbolName(), llvm::sys::fs::createTemporaryFile(), decodeUTF8(), llvm::symbolize::demanglePE32ExternCFunc(), llvm::MCObjectStreamer::EmitBytes(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::yaml::escape(), llvm::APInt::getBitsNeeded(), llvm::MemoryBufferRef::getBufferStart(), getHostID(), llvm::object::Archive::Symbol::getName(), llvm::object::Archive::getNumberOfSymbols(), llvm::StringToOffsetTable::GetOrAddStringOffset(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::MachOObjectFile::getRelocationTypeName(), llvm::object::COFFObjectFile::getRelocationTypeName(), llvm::ConstantDataArray::getString(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::TextInstrProfReader::hasFormat(), llvm::hash_value(), llvm::Timer::init(), isAllZeros(), llvm::LLLexer::LLLexer(), llvm::MIToken::location(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::sys::fs::make_absolute(), mangleCoveragePath(), llvm::object::MachOUniversalBinary::ObjectForArch::ObjectForArch(), llvm::sys::path::const_iterator::operator==(), llvm::object::Archive::Child::operator==(), llvm::sys::path::reverse_iterator::operator==(), llvm::opt::OptTable::OptTable(), llvm::DWARFDebugLoc::parse(), llvm::DWARFDebugLocDWO::parse(), llvm::InlineAsm::ConstraintInfo::Parse(), llvm::InlineAsm::ParseConstraints(), parseDouble(), parsePhysicalReg(), prependCompressionHeader(), printName(), llvm::sys::path::replace_extension(), llvm::yaml::final::ScalarNode(), llvm::AsmLexer::setBuffer(), llvm::EngineBuilder::setMArch(), llvm::EngineBuilder::setMCPU(), llvm::TimerGroup::setName(), llvm::Regex::sub(), llvm::object::Archive::symbol_begin(), llvm::TGLexer::TGLexer(), WriteAttributeGroupTable(), and WriteModuleMetadataStore().

const unsigned char* llvm::StringRef::bytes_begin ( ) const [inline]
const unsigned char* llvm::StringRef::bytes_end ( ) const [inline]

Definition at line 99 of file StringRef.h.

Referenced by llvm::MDString::bytes_end(), and WriteModuleMetadata().

compare - 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 153 of file StringRef.h.

References fuzzer::min().

Referenced by llvm::SmallString< 256 >::compare_lower(), llvm::operator<(), llvm::operator<=(), llvm::operator>(), llvm::operator>=(), order_by_name(), and SortSymbolPair().

compare_lower - Compare two strings, ignoring case.

compare_lower - Compare strings, ignoring case.

Definition at line 52 of file StringRef.cpp.

References ascii_strncasecmp(), and fuzzer::min().

Referenced by llvm::SmallString< 256 >::compare_numeric().

compare_numeric - Compare two strings, treating sequences of digits as numbers.

compare_numeric - Compare strings, handle embedded numbers.

Definition at line 73 of file StringRef.cpp.

References ascii_isdigit(), E, I, and fuzzer::min().

template<typename Allocator >
StringRef llvm::StringRef::copy ( Allocator &  A) const [inline]

Definition at line 131 of file StringRef.h.

Referenced by llvm::yaml::Document::parseBlockNode().

size_t llvm::StringRef::count ( char  C) const [inline]

Return the number of occurrences of C in the string.

Definition at line 324 of file StringRef.h.

Referenced by llvm::SmallString< 256 >::count(), llvm::HexagonInstrInfo::getInlineAsmLength(), and llvm::InlineAsm::ConstraintInfo::Parse().

size_t StringRef::count ( StringRef  Str) const

Return the number of non-overlapped occurrences of Str in the string.

count - Return the number of non-overlapped occurrences of

  • Str in the string.

Definition at line 342 of file StringRef.cpp.

References equals(), N, size(), and substr().

data - Get a pointer to the start of the string (which may not be null terminated).

Definition at line 108 of file StringRef.h.

Referenced by llvm::SourceMgr::AddIncludeFile(), llvm::FoldingSetNodeID::AddString(), llvm::object::ELFFile< ELFT >::base(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), llvm::sys::unicode::columnWidthUTF8(), compareWithScalarFnName(), compareWithVectorFnName(), llvm::ConvertUTF8toWide(), CopyStringRef(), llvm::StringMapEntry< MDString >::Create(), llvm::X86Operand::CreateToken(), llvm::dumpBlock(), edit_distance(), llvm::InstrProfRecordWriterTrait::EmitKey(), llvm::RuntimeDyldImpl::emitSection(), llvm::StringSwitch< T, R >::EndsWith(), llvm::cl::Option::error(), ExecGraphViewer(), llvm::DWARFFormValue::extractValue(), find(), llvm::DataExtractor::getCStr(), llvm::AsmToken::getEndLoc(), llvm::DenseMapInfo< StringRef >::getHashValue(), llvm::object::MachOObjectFile::getIndirectName(), llvm::getInst(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::AsmToken::getLoc(), llvm::MemoryBuffer::getMemBufferCopy(), llvm::object::Elf_Sym_Impl< ELFT >::getName(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::RuntimeDyldMachO::getRelocationValueRef(), llvm::ConstantDataVector::getSplatValue(), llvm::ConstantDataArray::getString(), llvm::object::MachOObjectFile::getSymbolName(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU64(), llvm::DataExtractor::getU8(), llvm::sys::fs::identify_magic(), llvm::ExecutionEngine::InitializeMemory(), llvm::DenseMapInfo< StringRef >::isEqual(), LLVMGetAsString(), LLVMGetSectionContents(), LLVMGetSectionName(), LLVMGetStructName(), LLVMTargetMachineEmitToMemoryBuffer(), loadTestingFormat(), lookupIntrinsicID(), lookupLLVMIntrinsicByName(), llvm::Regex::match(), llvm::sys::path::native(), llvm::raw_ostream::operator<<(), llvm::opt::OptTable::ParseOneArg(), llvm::RuntimeDyldELF::processRelocationRef(), ProvideOption(), readCoverageMappingData(), llvm::GCOVBuffer::readInt(), llvm::readPGOFuncNameStrings(), llvm::codeview::MemoryTypeTableBuilder::Record::Record(), llvm::LessRecordRegister::RecordParts::RecordParts(), llvm::Regex::Regex(), replaceSubString(), llvm::report_fatal_error(), llvm::RuntimeDyldImpl::resolveExternalSymbols(), RewriteIntelBracExpression(), llvm::yaml::Output::scalarString(), llvm::X86Operand::setTokenValue(), sortOpts(), llvm::StringSwitch< T, R >::StartsWith(), llvm::MD5::update(), WriteCombinedValueSymbolTable(), and llvm::codeview::TypeRecordBuilder::writeNullTerminatedString().

Return a StringRef equal to 'this' but with the last N elements dropped.

Definition at line 416 of file StringRef.h.

References fuzzer::min(), N, and StringRef().

Referenced by llvm::symbolize::demanglePE32ExternCFunc(), llvm::ConstantDataSequential::isCString(), llvm::yaml::Document::parseBlockNode(), and smallData().

Return a StringRef equal to 'this' but with the first N elements dropped.

Definition at line 408 of file StringRef.h.

Referenced by llvm::symbolize::demanglePE32ExternCFunc(), llvm::getFuncNameWithoutPrefix(), llvm::yaml::isNumber(), llvm::yaml::isNumeric(), lexName(), and MatchCoprocessorOperandName().

unsigned StringRef::edit_distance ( llvm::StringRef  Other,
bool  AllowReplacements = true,
unsigned  MaxEditDistance = 0 
) const

Determine the edit distance between this string and another string.

Parameters:
Otherthe string to compare this string against.
AllowReplacementswhether to allow character replacements (change one character into another) as a single operation, rather than as two operations (an insertion and a removal).
MaxEditDistanceIf non-zero, the maximum edit distance that this routine is allowed to compute. If the edit distance will exceed that maximum, returns MaxEditDistance+1.
Returns:
the minimum number of character insertions, removals, or (if AllowReplacements is true) replacements needed to transform one of the given strings into the other. If zero, the strings are identical.

Definition at line 104 of file StringRef.cpp.

References llvm::ComputeEditDistance(), data(), llvm::makeArrayRef(), and size().

Referenced by LookupNearestOption().

empty - Check if the string is empty.

Definition at line 112 of file StringRef.h.

Referenced by llvm::SubtargetFeatures::AddFeature(), llvm::ExecutionEngine::addGlobalMapping(), llvm::DwarfUnit::addLinkageName(), llvm::DwarfUnit::applySubprogramAttributes(), llvm::DwarfUnit::applySubprogramDefinitionAttributes(), llvm::DwarfCompileUnit::applyVariableAttributes(), llvm::APSInt::APSInt(), CloneInstructionInExitBlock(), llvm::MipsABIInfo::computeTargetABI(), computeTargetABI(), llvm::ConstantFoldLoadFromConstPtr(), llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfUnit::constructTypeDIE(), llvm::APFloat::convertFromString(), llvm::convertUTF8ToUTF16String(), CopyStringRef(), llvm::StructType::create(), llvm::sys::fs::create_directories(), createAArch64MCSubtargetInfo(), llvm::MDBuilder::createAnonymousAARoot(), llvm::ARM_MC::createARMMCSubtargetInfo(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createExternalTypeRef(), llvm::DIBuilder::createForwardDecl(), llvm::DIBuilder::createReplaceableCompositeType(), llvm::createSanitizerCtorAndInitFunctions(), createSparcMCSubtargetInfo(), llvm::DIBuilder::createStructType(), llvm::sys::fs::createTemporaryFile(), llvm::DIBuilder::createUnionType(), llvm::DIBuilder::createUnspecifiedType(), llvm::X86_MC::createX86MCSubtargetInfo(), decodeBase64StringEntry(), llvm::symbolize::demanglePE32ExternCFunc(), EatNumber(), llvm::MCDwarfLineTableHeader::Emit(), emitComments(), emitDebugValueComment(), EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), llvm::TargetLoweringObjectFileMachO::emitModuleFlags(), llvm::cl::Option::error(), llvm::DWARFFormValue::extractValue(), FoldBlockIntoPredecessor(), llvm::Attribute::get(), getARClassRegisterMask(), llvm::Triple::getARMCPUForArch(), getAsInteger(), llvm::getAsSignedInteger(), llvm::Attribute::getAsString(), llvm::getAsUnsignedInteger(), llvm::APInt::getBitsNeeded(), llvm::ARM::getCanonicalArchName(), llvm::DINode::getCanonicalMDString(), llvm::DIMacroNode::getCanonicalMDString(), getChompedLineBreaks(), llvm::MCContext::getCOFFSection(), llvm::DOTGraphTraits< const Function * >::getCompleteNodeLabel(), getELFKindForNamedSection(), llvm::MCContext::getELFSection(), llvm::SubtargetFeatures::getFeatureBits(), llvm::MCDwarfLineTableHeader::getFile(), llvm::getFuncNameWithoutPrefix(), getItineraryLatency(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::object::MachOObjectFile::getLibraryShortNameByIndex(), getMClassFlagsMask(), getMClassRegisterMask(), getMemcpyLoadsAndStores(), getMemsetStringVal(), getNameWithPrefixImpl(), llvm::DwarfUnit::getOrCreateModule(), llvm::DwarfUnit::getOrCreateNameSpace(), llvm::MCContext::getOrCreateSymbol(), llvm::DwarfUnit::getParentContextString(), llvm::getPGOFuncName(), llvm::GlobalValue::getRealLinkageName(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLibraryInfoImpl::getScalarizedFunction(), getSearchPaths(), llvm::DOTGraphTraits< const Function * >::getSimpleNodeLabel(), llvm::DataExtractor::getSLEB128(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::DataExtractor::getULEB128(), getValueStr(), llvm::TargetLibraryInfoImpl::getVectorizedFunction(), llvm::yaml::Node::getVerbatimTag(), llvm::sys::path::has_extension(), llvm::sys::path::has_filename(), llvm::sys::path::has_parent_path(), llvm::sys::path::has_relative_path(), llvm::sys::path::has_root_directory(), llvm::sys::path::has_root_name(), llvm::sys::path::has_root_path(), llvm::sys::path::has_stem(), llvm::cl::Option::hasArgStr(), hasFlag(), llvm::GlobalObject::hasSection(), llvm::GlobalValue::hasSection(), llvm::object::Archive::hasSymbolTable(), llvm::NVPTXSubtarget::initializeSubtargetDependencies(), llvm::MCSubtargetInfo::InitMCProcessorInfo(), llvm::StringSet< AllocatorTy >::insert(), isCanonical(), isEnabled(), llvm::TargetLibraryInfoImpl::isFunctionScalarizable(), llvm::TargetLibraryInfoImpl::isFunctionVectorizable(), isRepeatedByteSequence(), llvm::MCAsmInfo::isValidUnquotedName(), llvm::LoadAndStorePromoter::LoadAndStorePromoter(), loadBinaryFormat(), LookupNearestOption(), matchAsm(), llvm::FunctionInfoIndex::mergeFrom(), llvm::yaml::needsQuotes(), llvm::Triple::normalize(), parseARMArch(), llvm::ARM_MC::ParseARMTriple(), llvm::PassBuilder::parsePassPipeline(), parseSubArch(), parseVersionFromName(), llvm::DiagnosticInfoSampleProfile::print(), llvm::MCInstPrinter::printAnnotation(), PrintCFIEscape(), printExtendedName(), printFile(), llvm::printLLVMNameWithoutPrefix(), printMetadataIdentifier(), llvm::cl::generic_parser_base::printOptionInfo(), printSymbolizedStackTrace(), llvm::AttributeImpl::Profile(), llvm::GCOVBuffer::readArcTag(), llvm::GCOVBuffer::readBlockTag(), llvm::GCOVBuffer::readEdgeTag(), llvm::GCOVBuffer::readFunctionTag(), llvm::GCOVBuffer::readLineTag(), llvm::TextInstrProfReader::readNextRecord(), llvm::GCOVBuffer::readObjectTag(), llvm::GCOVBuffer::readProgramTag(), llvm::LessRecordRegister::RecordParts::RecordParts(), sanitizeFunctionName(), llvm::yaml::Output::scalarString(), llvm::HEXAGON_MC::selectHexagonCPU(), llvm::MIPS_MC::selectMipsCPU(), llvm::EngineBuilder::selectTarget(), setFunctionAttributes(), llvm::StructType::setName(), split(), split(), StripTypeNames(), llvm::Regex::sub(), llvm::ExecutionEngine::updateGlobalMapping(), UsesVectorABI(), llvm::InlineAsm::Verify(), WriteAttributeGroupTable(), and WriteTypeTable().

iterator llvm::StringRef::end ( ) const [inline]

Definition at line 94 of file StringRef.h.

Referenced by llvm::sys::path::append(), llvm::SmallString< 256 >::assign(), llvm::yaml::final::BlockScalarNode(), llvm::convertUTF8ToUTF16String(), llvm::ConvertUTF8toWide(), llvm::MachineFunction::createExternalSymbolName(), decodeUTF8(), llvm::symbolize::demanglePE32ExternCFunc(), llvm::MCObjectStreamer::EmitBytes(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::MDString::end(), endswith_lower(), llvm::yaml::escape(), llvm::MemoryBufferRef::getBufferEnd(), getHostID(), llvm::StringToOffsetTable::GetOrAddStringOffset(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::MachOObjectFile::getRelocationTypeName(), llvm::object::COFFObjectFile::getRelocationTypeName(), llvm::ConstantDataArray::getString(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::hash_value(), llvm::Timer::init(), isAllZeros(), llvm::AsmLexer::LexUntilEndOfLine(), llvm::AsmLexer::LexUntilEndOfStatement(), llvm::sys::fs::make_absolute(), mangleCoveragePath(), llvm::opt::OptTable::OptTable(), llvm::DWARFDebugLoc::parse(), llvm::DWARFDebugLocDWO::parse(), llvm::InlineAsm::ConstraintInfo::Parse(), llvm::InlineAsm::ParseConstraints(), parseDouble(), parsePhysicalReg(), parseRegisterNumber(), prependCompressionHeader(), printName(), llvm::Regex::Regex(), llvm::sys::path::replace_extension(), llvm::yaml::final::ScalarNode(), llvm::EngineBuilder::setMArch(), llvm::EngineBuilder::setMCPU(), llvm::TimerGroup::setName(), llvm::Regex::sub(), WriteAttributeGroupTable(), and WriteModuleMetadataStore().

Check if this string ends with the given Suffix, ignoring case.

Definition at line 67 of file StringRef.cpp.

References ascii_strncasecmp(), and end().

equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.

Definition at line 140 of file StringRef.h.

Referenced by count(), llvm::SmallString< 256 >::equals_lower(), llvm::GetUnrollMetadata(), llvm::yaml::isBool(), isGCSafepointPoll(), llvm::yaml::isNull(), llvm::yaml::isNumber(), llvm::yaml::isNumeric(), llvm::operator==(), parseBPFArch(), parseSegmentLoadCommand(), and rfind().

bool llvm::StringRef::equals_lower ( StringRef  RHS) const [inline]

equals_lower - Check for string equality, ignoring case.

Definition at line 146 of file StringRef.h.

Referenced by llvm::SmallString< 256 >::compare(), llvm::PPCTargetLowering::getRegForInlineAsmConstraint(), and llvm::StrInStrNoCase().

LLVM_ATTRIBUTE_ALWAYS_INLINE size_t llvm::StringRef::find ( char  C,
size_t  From = 0 
) const [inline]
size_t StringRef::find ( StringRef  Str,
size_t  From = 0 
) const

Search for the first string Str in the string.

find - Search for the first string

Returns:
The index of the first occurrence of Str, or npos if not found.
  • Str in the string.
Returns:
- The index of the first occurrence of
  • Str, or npos if not found.

Definition at line 142 of file StringRef.cpp.

References data(), fuzzer::memcmp, N, npos, and size().

StringRef::size_type StringRef::find_first_not_of ( char  C,
size_t  From = 0 
) const

Find the first character in the string that is not C or npos if not found.

find_first_not_of - Find the first character in the string that is not

  • C or npos if not found.

Definition at line 219 of file StringRef.cpp.

References fuzzer::min(), and npos.

Referenced by llvm::DWARFContextInMemory::DWARFContextInMemory(), llvm::SmallString< 256 >::find_first_not_of(), llvm::SmallString< 256 >::find_last_of(), llvm::symbolize::getGNUDebuglinkContents(), llvm::getToken(), llvm::yaml::isNumber(), matchAsm(), llvm::yaml::needsQuotes(), ParseLine(), printName(), and llvm::Regex::sub().

StringRef::size_type StringRef::find_first_not_of ( StringRef  Chars,
size_t  From = 0 
) const

Find the first character in the string that is not in the string Chars, or npos if not found.

find_first_not_of - Find the first character in the string that is not in the string

Complexity: O(size() + Chars.size())

  • Chars, or npos if not found.

Note: O(size() + Chars.size())

Definition at line 230 of file StringRef.cpp.

References fuzzer::min(), npos, and size().

size_t llvm::StringRef::find_first_of ( char  C,
size_t  From = 0 
) const [inline]
StringRef::size_type StringRef::find_first_of ( StringRef  Chars,
size_t  From = 0 
) const

Find the first character in the string that is in Chars, or npos if not found.

find_first_of - Find the first character in the string that is in

Complexity: O(size() + Chars.size())

  • Chars, or npos if not found.

Note: O(size() + Chars.size())

Definition at line 205 of file StringRef.cpp.

References fuzzer::min(), npos, and size().

StringRef::size_type StringRef::find_last_not_of ( char  C,
size_t  From = npos 
) const

Find the last character in the string that is not C, or npos if not found.

find_last_not_of - Find the last character in the string that is not

  • C, or npos if not found.

Definition at line 260 of file StringRef.cpp.

References fuzzer::min(), and npos.

StringRef::size_type StringRef::find_last_not_of ( StringRef  Chars,
size_t  From = npos 
) const

Find the last character in the string that is not in Chars, or npos if not found.

find_last_not_of - Find the last character in the string that is not in

Complexity: O(size() + Chars.size())

  • Chars, or npos if not found.

Note: O(size() + Chars.size())

Definition at line 271 of file StringRef.cpp.

References fuzzer::min(), npos, and size().

size_t llvm::StringRef::find_last_of ( char  C,
size_t  From = npos 
) const [inline]
StringRef::size_type StringRef::find_last_of ( StringRef  Chars,
size_t  From = npos 
) const

Find the last character in the string that is in C, or npos if not found.

find_last_of - Find the last character in the string that is in

Complexity: O(size() + Chars.size())

  • C, or npos if not found.

Note: O(size() + Chars.size())

Definition at line 246 of file StringRef.cpp.

References fuzzer::min(), npos, and size().

char llvm::StringRef::front ( ) const [inline]
template<typename T >
std::enable_if<std::numeric_limits<T>::is_signed, bool>::type llvm::StringRef::getAsInteger ( unsigned  Radix,
T Result 
) const [inline]

Parse the current string as an integer of the specified radix.

If Radix is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.

If the string is invalid or if only a subset of the string is valid, this returns true to signify the error. The string is considered erroneous if empty or if it overflows T.

Definition at line 345 of file StringRef.h.

Referenced by llvm::object::Archive::Child::Child(), EmitGCCInlineAsmStr(), llvm::X86FrameLowering::emitPrologue(), getInt(), llvm::AMDGPU::getIntegerAttribute(), llvm::object::Archive::Child::getName(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), makeStatepointExplicitImpl(), ParseHead(), ParseLine(), ReplaceWithStatepoint(), llvm::StackProtector::runOnFunction(), llvm::Regex::sub(), WindowsRequiresStackProbe(), and llvm::yaml::BinaryRef::writeAsBinary().

template<typename T >
std::enable_if<!std::numeric_limits<T>::is_signed, bool>::type llvm::StringRef::getAsInteger ( unsigned  Radix,
T Result 
) const [inline]

Definition at line 356 of file StringRef.h.

References llvm::getAsSignedInteger().

bool StringRef::getAsInteger ( unsigned  Radix,
APInt Result 
) const

Parse the current string as an integer of the specified Radix, or of an autosensed radix if the Radix given is 0.

The current value in Result is discarded, and the storage is changed to be wide enough to store the parsed integer.

Returns:
true if the string does not solely consist of a valid non-empty number in the appropriate base.

APInt::fromString is superficially similar but assumes the string is well-formed in the given radix.

Definition at line 445 of file StringRef.cpp.

References empty(), front(), GetAutoSenseRadix(), llvm::APInt::getBitWidth(), size(), substr(), and llvm::APInt::zext().

std::string StringRef::lower ( ) const
StringRef llvm::StringRef::ltrim ( StringRef  Chars = " \t\n\v\f\r") const [inline]

Return string with consecutive characters in Chars starting from the left removed.

Definition at line 526 of file StringRef.h.

Referenced by llvm::RuntimeDyldCheckerExprEval::evaluate(), and llvm::opt::OptTable::ParseOneArg().

llvm::StringRef::operator std::string ( ) const [inline]

Definition at line 207 of file StringRef.h.

char llvm::StringRef::operator[] ( size_t  Index) const [inline]

Definition at line 200 of file StringRef.h.

size_t llvm::StringRef::rfind ( char  C,
size_t  From = npos 
) const [inline]

Search for the last character C in the string.

Returns:
The index of the last occurrence of C, or npos if not found.

Definition at line 260 of file StringRef.h.

Referenced by llvm::symbolize::demanglePE32ExternCFunc(), llvm::SmallString< 256 >::find_first_of(), llvm::object::MachOObjectFile::guessLibraryShortName(), ParseHead(), llvm::SmallString< 256 >::rfind(), and rtrim().

size_t StringRef::rfind ( StringRef  Str) const

Search for the last string Str in the string.

rfind - Search for the last string

Returns:
The index of the last occurrence of Str, or npos if not found.
  • Str in the string.
Returns:
- The index of the last occurrence of
  • Str, or npos if not found.

Definition at line 189 of file StringRef.cpp.

References equals(), N, npos, size(), and substr().

std::pair<StringRef, StringRef> llvm::StringRef::rsplit ( char  Separator) const [inline]

Split into two substrings around the last occurrence of a separator character.

If Separator is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is minimal. If Separator is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").

Parameters:
Separator- The character to split on.
Returns:
- The split substrings.

Definition at line 517 of file StringRef.h.

StringRef llvm::StringRef::rtrim ( StringRef  Chars = " \t\n\v\f\r") const [inline]

Return string with consecutive characters in Chars starting from the right removed.

Definition at line 532 of file StringRef.h.

References npos, and rfind().

Referenced by llvm::object::Archive::Child::Child(), llvm::RuntimeDyldCheckerExprEval::evaluate(), llvm::object::Archive::Child::getName(), and llvm::object::ArchiveMemberHeader::getRawLastModified().

size - Get the string size.

Definition at line 116 of file StringRef.h.

Referenced by llvm::StringTableBuilder::add(), llvm::FoldingSetNodeID::AddString(), llvm::APSInt::APSInt(), llvm::StringSwitch< T, R >::Case(), llvm::StringSwitch< T, R >::Cases(), charTailAt(), llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(), llvm::sys::locale::columnWidth(), llvm::sys::unicode::columnWidthUTF8(), compareWithScalarFnName(), compareWithVectorFnName(), llvm::ConstantFoldLoadFromConstPtr(), llvm::APFloat::convertFromString(), llvm::convertUTF8ToUTF16String(), llvm::ConvertUTF8toWide(), CopyStringRef(), count(), llvm::StringMapEntry< MDString >::Create(), llvm::MachineFunction::createExternalSymbolName(), llvm::X86Operand::CreateToken(), decodeBase64StringEntry(), dumpPubSection(), edit_distance(), llvm::object::elf_hash(), llvm::object::ELFFile< ELFT >::ELFFile(), llvm::SizeReporterAsmStreamer::emitBytes(), llvm::AMDGPUTargetELFStreamer::EmitDirectiveHSACodeObjectISA(), llvm::InstrProfRecordWriterTrait::EmitKeyDataLength(), llvm::emitSourceFileHeader(), llvm::sys::path::end(), llvm::StringSwitch< T, R >::EndsWith(), llvm::Regex::escape(), llvm::sys::path::extension(), llvm::StringTableBuilder::finalize(), find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), llvm::DWARFUnit::getAddrOffsetSectionItem(), llvm::ConstantDataSequential::getAsCString(), getAsInteger(), llvm::APInt::getBitsNeeded(), llvm::MemoryBufferRef::getBufferSize(), llvm::ARM::getCanonicalArchName(), llvm::SparcTargetLowering::getConstraintType(), llvm::MSP430TargetLowering::getConstraintType(), llvm::SITargetLowering::getConstraintType(), llvm::ARMTargetLowering::getConstraintType(), llvm::SystemZTargetLowering::getConstraintType(), llvm::NVPTXTargetLowering::getConstraintType(), llvm::PPCTargetLowering::getConstraintType(), llvm::TargetLowering::getConstraintType(), llvm::object::getElfArchType(), llvm::AsmToken::getEndLoc(), llvm::DwarfStringPool::getEntry(), llvm::Triple::getEnvironmentVersion(), llvm::getFuncNameWithoutPrefix(), llvm::object::MachOObjectFile::getIndirectName(), llvm::ARMTargetLowering::getInlineAsmMemConstraint(), llvm::SystemZTargetLowering::getInlineAsmMemConstraint(), GetLazyPtr(), llvm::MDString::getLength(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::object::MachOObjectFile::getLibraryShortNameByIndex(), llvm::MemoryBuffer::getMemBufferCopy(), getMemsetStringVal(), llvm::object::Archive::Child::getName(), llvm::object::Elf_Sym_Impl< ELFT >::getName(), llvm::MemoryBuffer::getNewUninitMemBuffer(), getOptionPred(), llvm::cl::generic_parser_base::getOptionWidth(), llvm::cl::basic_parser_impl::getOptionWidth(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::Triple::getOSVersion(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::MSP430TargetLowering::getRegForInlineAsmConstraint(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), llvm::HexagonTargetLowering::getRegForInlineAsmConstraint(), llvm::ARMTargetLowering::getRegForInlineAsmConstraint(), llvm::SystemZTargetLowering::getRegForInlineAsmConstraint(), llvm::NVPTXTargetLowering::getRegForInlineAsmConstraint(), llvm::PPCTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::object::MachOObjectFile::getSectionSize(), llvm::ConstantDataArray::getString(), llvm::AsmToken::getStringContents(), GetStringLengthH(), llvm::DWARFUnit::getStringOffsetSectionItem(), getUnicodeEncoding(), getVarName(), llvm::object::MachOObjectFile::guessLibraryShortName(), HandlePrefixedOrGroupedOption(), llvm::HashString(), llvm::sys::fs::identify_magic(), llvm::ExecutionEngine::InitializeMemory(), llvm::NVPTXSubtarget::initializeSubtargetDependencies(), isIntrinsicSourceOfDivergence(), isRepeatedByteSequence(), llvm::DataExtractor::isValidOffset(), llvm::join_impl(), LLVMGetAsString(), LLVMTargetMachineEmitToMemoryBuffer(), loadTestingFormat(), lookupIntrinsicID(), lookupLLVMIntrinsicByName(), lower(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::MCGenDwarfLabelEntry::Make(), llvm::Regex::match(), MatchCoprocessorOperandName(), matchOption(), maybeLexIndex(), maybeLexIndexAndName(), maybeLexIRBlock(), maybeLexIRValue(), maybeLexMachineBasicBlock(), llvm::object::MachOUniversalBinary::ObjectForArch::ObjectForArch(), operator new(), llvm::raw_ostream::operator<<(), llvm::DWARFDebugLocDWO::parse(), parseBackslash(), parseRefinementStep(), parseRegisterNumber(), parseSectionFlags(), prependCompressionHeader(), llvm::MCExpr::print(), printBSDMemberHeader(), PrintCFIEscape(), PrintEscapedString(), llvm::cl::generic_parser_base::printGenericOptionDiff(), PrintHelpOptionList(), printLine(), llvm::printLLVMNameWithoutPrefix(), printMetadataIdentifier(), llvm::cl::generic_parser_base::printOptionInfo(), llvm::cl::basic_parser_impl::printOptionName(), PrintQuotedString(), printSourceLine(), llvm::sys::path::rbegin(), readCoverageMappingData(), VersionedCovMapFuncRecordReader< Version, IntPtrT, Endian >::readFunctionRecords(), llvm::GCOVBuffer::readInt(), llvm::readPGOFuncNameStrings(), llvm::GCOVBuffer::readString(), llvm::sampleprof::SampleProfileReaderBinary::readString(), llvm::codeview::MemoryTypeTableBuilder::Record::Record(), llvm::LessRecordRegister::RecordParts::RecordParts(), llvm::sys::path::relative_path(), llvm::sys::path::remove_leading_dotslash(), llvm::sys::path::replace_extension(), replaceSubString(), llvm::report_fatal_error(), RequiresVFPRegListValidation(), llvm::RuntimeDyldImpl::resolveExternalSymbols(), RewriteIntelBracExpression(), rfind(), llvm::yaml::Output::scalarString(), llvm::orc::remote::serialize(), llvm::StructType::setName(), llvm::X86Operand::setTokenValue(), slice(), split(), llvm::StringSwitch< T, R >::StartsWith(), llvm::sys::path::stem(), llvm::StrInStrNoCase(), llvm::Regex::sub(), llvm::cl::TokenizeGNUCommandLine(), llvm::cl::TokenizeWindowsCommandLine(), unescapeQuotedString(), llvm::MD5::update(), UpgradeIntrinsicFunction1(), upper(), useStringTable(), llvm::raw_ostream::write_escaped(), WriteCombinedValueSymbolTable(), llvm::codeview::TypeRecordBuilder::writeNullTerminatedString(), llvm::MachObjectWriter::writeSegmentLoadCommand(), WriteStringRecord(), and writeSymbolTable().

LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef llvm::StringRef::slice ( size_t  Start,
size_t  End 
) const [inline]

Return a reference to the substring from [Start, End).

Parameters:
StartThe 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.
EndThe 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 432 of file StringRef.h.

References N, size(), and substr().

Referenced by llvm::SmallString< 256 >::c_str(), llvm::object::ObjectFile::createMachOObjectFile(), llvm::DWARFUnit::DWARFUnit(), getObjCClassCategory(), getObjCMethodName(), llvm::AsmToken::getStringContents(), llvm::getToken(), llvm::object::MachOObjectFile::guessLibraryShortName(), parseRegisterNumber(), llvm::GCOVBuffer::readArcTag(), llvm::GCOVBuffer::readBlockTag(), llvm::GCOVBuffer::readEdgeTag(), llvm::GCOVBuffer::readFunctionTag(), llvm::GCOVBuffer::readGCDAFormat(), llvm::GCOVBuffer::readGCNOFormat(), llvm::GCOVBuffer::readGCOVVersion(), llvm::GCOVBuffer::readInt(), llvm::GCOVBuffer::readLineTag(), llvm::GCOVBuffer::readObjectTag(), llvm::GCOVBuffer::readProgramTag(), llvm::GCOVBuffer::readString(), split(), and llvm::Regex::sub().

std::pair<StringRef, StringRef> llvm::StringRef::split ( char  Separator) const [inline]

Split into two substrings around the first occurrence of a separator character.

If Separator is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is maximal. If Separator is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").

Parameters:
SeparatorThe character to split on.
Returns:
The split substrings.

Definition at line 448 of file StringRef.h.

References fuzzer::min(), and StringRef().

Referenced by addForcedAttributes(), llvm::Triple::getArchName(), llvm::Triple::getEnvironmentName(), getIntOperandFromRegisterString(), getIntOperandsFromRegisterString(), llvm::Triple::getOSAndEnvironmentName(), llvm::Triple::getOSName(), getSearchPaths(), llvm::Triple::getVendorName(), LookupNearestOption(), llvm::Triple::normalize(), printHelpStr(), printSymbolizedStackTrace(), llvm::readPGOFuncNameStrings(), llvm::GCOVBuffer::readString(), Split(), split(), llvm::Regex::sub(), llvm::Triple::Triple(), and UsesVectorABI().

std::pair<StringRef, StringRef> llvm::StringRef::split ( StringRef  Separator) const [inline]

Split into two substrings around the first occurrence of a separator string.

If Separator is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is maximal. If Separator is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").

Parameters:
Separator- The string to split on.
Returns:
- The split substrings.

Definition at line 465 of file StringRef.h.

References find(), npos, slice(), and StringRef().

void StringRef::split ( SmallVectorImpl< StringRef > &  A,
StringRef  Separator,
int  MaxSplit = -1,
bool  KeepEmpty = true 
) const

Split into substrings around the occurrences of a separator string.

Each substring is stored in A. If MaxSplit is >= 0, at most MaxSplit splits are done and consequently <= MaxSplit + 1 elements are added to A. If KeepEmpty is false, empty strings are not added to A. They still count when considering MaxSplit An useful invariant is that Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true

Parameters:
A- Where to put the substrings.
Separator- The string to split on.
MaxSplit- The maximum number of times the string is split.
KeepEmpty- True if empty substring should be added.

Definition at line 283 of file StringRef.cpp.

References empty(), find(), npos, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), size(), and slice().

void StringRef::split ( SmallVectorImpl< StringRef > &  A,
char  Separator,
int  MaxSplit = -1,
bool  KeepEmpty = true 
) const

Split into substrings around the occurrences of a separator character.

Each substring is stored in A. If MaxSplit is >= 0, at most MaxSplit splits are done and consequently <= MaxSplit + 1 elements are added to A. If KeepEmpty is false, empty strings are not added to A. They still count when considering MaxSplit An useful invariant is that Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true

Parameters:
A- Where to put the substrings.
Separator- The string to split on.
MaxSplit- The maximum number of times the string is split.
KeepEmpty- True if empty substring should be added.

Definition at line 310 of file StringRef.cpp.

References empty(), find(), npos, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and slice().

Check if this string starts with the given Prefix.

Definition at line 215 of file StringRef.h.

References str().

Referenced by llvm::object::Archive::Archive(), llvm::ARMBuildAttrs::AttrTypeFromString(), llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(), llvm::object::Archive::Child::Child(), CloneLoopBlocks(), llvm::MipsABIInfo::computeTargetABI(), computeTargetABI(), consumeCompressedDebugSectionHeader(), doesIgnoreDataTypeSuffix(), llvm::DWARFContextInMemory::DWARFContextInMemory(), llvm::SmallString< 256 >::endswith(), llvm::ARM::getArchExtFeature(), GetAutoSenseRadix(), llvm::ARM::getCanonicalArchName(), getELFKindForNamedSection(), llvm::Triple::getEnvironmentVersion(), llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), llvm::getFuncNameWithoutPrefix(), getName(), llvm::object::Archive::Child::getName(), llvm::Mangler::getNameWithPrefix(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::Triple::getOSVersion(), llvm::object::IRObjectFile::getSymbolFlags(), llvm::object::ELFObjectFile< ELFT >::getSymbolFlags(), llvm::WinEH::getUnwindInfoSection(), llvm::yaml::Node::getVerbatimTag(), llvm::object::MachOObjectFile::guessLibraryShortName(), INITIALIZE_PASS(), llvm::LTOModule::isBitcodeForTarget(), isInput(), llvm::Function::isIntrinsic(), llvm::yaml::isNumber(), isObjCClass(), llvm::objcarc::IsObjCIdentifiedObject(), lookupLLVMIntrinsicByName(), llvm::MCGenDwarfLabelEntry::Make(), matchAsm(), matchOption(), llvm::orc::GlobalRenamer::needsRenaming(), llvm::Triple::normalize(), parseArch(), llvm::ARM::parseArchEndian(), parseARMArch(), parseVersionFromName(), printSymbolizedStackTrace(), llvm::TextInstrProfReader::readNextRecord(), RequiresVFPRegListValidation(), SetLoopAlreadyUnrolled(), llvm::StripDebugInfo(), StripSymtab(), StripTypeNames(), llvm::UpgradeIntrinsicCall(), and UpgradeIntrinsicFunction1().

Check if this string starts with the given Prefix, ignoring case.

Definition at line 61 of file StringRef.cpp.

References ascii_strncasecmp().

Referenced by matchOption().

std::string llvm::StringRef::str ( ) const [inline]
LLVM_ATTRIBUTE_ALWAYS_INLINE StringRef llvm::StringRef::substr ( size_t  Start,
size_t  N = npos 
) const [inline]

Return a reference to the substring from [Start, Start + N).

Parameters:
StartThe 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.
NThe 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 400 of file StringRef.h.

Referenced by llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(), llvm::object::Archive::Child::Child(), CommaSeparateAndAddOccurrence(), consumeCompressedDebugSectionHeader(), count(), decodeBase64StringEntry(), llvm::symbolize::demanglePE32ExternCFunc(), llvm::DWARFContextInMemory::DWARFContextInMemory(), EatNumber(), emitComments(), llvm::emitSourceFileHeader(), llvm::RuntimeDyldCheckerExprEval::evaluate(), llvm::sys::path::extension(), llvm::DWARFFormValue::extractValue(), llvm::ARM::getArchExtFeature(), llvm::object::MachOUniversalBinary::ObjectForArch::getAsArchive(), llvm::ConstantDataSequential::getAsCString(), getAsInteger(), llvm::object::MachOUniversalBinary::ObjectForArch::getAsObjectFile(), llvm::getAsSignedInteger(), llvm::getAsUnsignedInteger(), GetAutoSenseRadix(), llvm::ARM::getCanonicalArchName(), llvm::getConstantStringInfo(), llvm::TargetLowering::getConstraintType(), llvm::Triple::getEnvironmentVersion(), llvm::symbolize::getGNUDebuglinkContents(), GetLazyPtr(), getMemcpyLoadsAndStores(), getName(), llvm::object::Archive::Child::getName(), getNameWithPrefixImpl(), getOptionPred(), llvm::Triple::getOSVersion(), llvm::getPGOFuncName(), llvm::GlobalValue::getRealLinkageName(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), llvm::object::MachOObjectFile::getSectionContents(), llvm::object::MachOObjectFile::getStringTableData(), GetSymbolFromOperand(), llvm::getToken(), llvm::WinEH::getUnwindInfoSection(), getVarName(), llvm::yaml::Node::getVerbatimTag(), HandlePrefixedOrGroupedOption(), loadTestingFormat(), llvm::MCGenDwarfLabelEntry::Make(), matchAsm(), matchOption(), llvm::sys::path::parent_path(), llvm::DWARFDebugLoc::parse(), llvm::DWARFDebugLocDWO::parse(), llvm::yaml::Document::parseBlockNode(), ParseHead(), ParseLine(), llvm::PassBuilder::parsePassPipeline(), parseRefinementStep(), parseVersionFromName(), llvm::sys::path::relative_path(), llvm::sys::path::remove_leading_dotslash(), llvm::sys::path::rend(), RequiresVFPRegListValidation(), rfind(), llvm::sys::path::root_path(), llvm::SmallString< 256 >::slice(), slice(), llvm::sys::path::stem(), llvm::StrInStrNoCase(), StripFlag(), llvm::Regex::sub(), unescapeQuotedString(), llvm::UpgradeIntrinsicCall(), and UpgradeIntrinsicFunction1().

StringRef llvm::StringRef::trim ( StringRef  Chars = " \t\n\v\f\r") const [inline]

Return string with consecutive characters in Chars starting from the left and right removed.

Definition at line 538 of file StringRef.h.

Referenced by llvm::RuntimeDyldCheckerImpl::check(), and llvm::RuntimeDyldCheckerExprEval::evaluate().

std::string StringRef::upper ( ) const

Member Data Documentation

const size_t StringRef::npos = ~size_t(0) [static]

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