StringRef - Represent a constant reference to a string, i.e.More...
#include "llvm/ADT/StringRef.h"
Public Types | |
using | iterator =constchar * |
using | const_iterator =constchar * |
using | size_type = size_t |
using | value_type =char |
using | reverse_iterator = std::reverse_iterator<iterator > |
using | const_reverse_iterator = std::reverse_iterator<const_iterator > |
Public Member Functions | |
Constructors | |
StringRef ()=default | |
Construct an empty string ref. | |
StringRef (std::nullptr_t)=delete | |
Disable conversion from nullptr. | |
constexpr | StringRef (constchar *StrLLVM_LIFETIME_BOUND) |
Construct a string ref from a cstring. | |
constexpr | StringRef (constchar *dataLLVM_LIFETIME_BOUND, size_t length) |
Construct a string ref from a pointer and length. | |
StringRef (const std::string &Str) | |
Construct a string ref from an std::string. | |
constexpr | StringRef (std::string_view Str) |
Construct a string ref from an std::string_view. | |
Iterators | |
iterator | begin ()const |
iterator | end ()const |
reverse_iterator | rbegin ()const |
reverse_iterator | rend ()const |
constunsignedchar * | bytes_begin ()const |
constunsignedchar * | bytes_end ()const |
iterator_range<constunsignedchar * > | bytes ()const |
String Operations | |
constexprconstchar * | data ()const |
data - Get a pointer to the start of the string (which may not be null terminated). | |
constexprbool | empty ()const |
empty -Check if the string is empty. | |
constexpr 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<typenameAllocator > | |
StringRef | copy (Allocator &A)const |
bool | equals_insensitive (StringRefRHS)const |
Check for string equality, ignoring case. | |
int | compare (StringRefRHS)const |
compare - Compare two strings; the result is negative, zero, or positive if this string is lexicographically less than, equal to, or greater than theRHS . | |
int | compare_insensitive (StringRefRHS)const |
Compare two strings, ignoring case. | |
int | compare_numeric (StringRefRHS)const |
compare_numeric - Compare two strings, treating sequences of digits as numbers. | |
unsigned | edit_distance (StringRefOther,bool AllowReplacements=true,unsigned MaxEditDistance=0)const |
Determine the edit distance between this string and another string. | |
unsigned | edit_distance_insensitive (StringRefOther,bool AllowReplacements=true,unsigned MaxEditDistance=0)const |
std::string | str ()const |
str - Get the contents as an std::string. | |
std::string | lower ()const |
std::string | upper ()const |
Convert the given ASCII string to uppercase. | |
Operator Overloads | |
char | operator[] (size_tIndex)const |
template<typenameT > | |
std::enable_if_t< std::is_same<T, std::string >::value,StringRef > & | operator= (T &&Str)=delete |
Disallow accidental assignment from a temporary std::string. | |
Type Conversions | |
constexpr | operator std::string_view ()const |
String Predicates | |
bool | starts_with (StringRef Prefix)const |
Check if this string starts with the givenPrefix . | |
bool | starts_with (char Prefix)const |
bool | starts_with_insensitive (StringRef Prefix)const |
Check if this string starts with the givenPrefix , ignoring case. | |
bool | ends_with (StringRef Suffix)const |
Check if this string ends with the givenSuffix . | |
bool | ends_with (char Suffix)const |
bool | ends_with_insensitive (StringRef Suffix)const |
Check if this string ends with the givenSuffix , ignoring case. | |
String Searching | |
size_t | find (charC, size_tFrom=0)const |
Search for the first characterC in the string. | |
size_t | find_insensitive (charC, size_tFrom=0)const |
Search for the first characterC in the string, ignoring case. | |
size_t | find_if (function_ref<bool(char)>F, size_tFrom=0)const |
Search for the first character satisfying the predicateF . | |
size_t | find_if_not (function_ref<bool(char)>F, size_tFrom=0)const |
Search for the first character not satisfying the predicateF . | |
size_t | find (StringRef Str, size_tFrom=0)const |
Search for the first stringStr in the string. | |
size_t | find_insensitive (StringRef Str, size_tFrom=0)const |
Search for the first stringStr in the string, ignoring case. | |
size_t | rfind (charC, size_tFrom=npos)const |
Search for the last characterC in the string. | |
size_t | rfind_insensitive (charC, size_tFrom=npos)const |
Search for the last characterC in the string, ignoring case. | |
size_t | rfind (StringRef Str)const |
Search for the last stringStr in the string. | |
size_t | rfind_insensitive (StringRef Str)const |
Search for the last stringStr in the string, ignoring case. | |
size_t | find_first_of (charC, size_tFrom=0)const |
Find the first character in the string that isC , or npos if not found. | |
size_t | find_first_of (StringRef Chars, size_tFrom=0)const |
Find the first character in the string that is inChars , or npos if not found. | |
size_t | find_first_not_of (charC, size_tFrom=0)const |
Find the first character in the string that is notC or npos if not found. | |
size_t | find_first_not_of (StringRef Chars, size_tFrom=0)const |
Find the first character in the string that is not in the stringChars , or npos if not found. | |
size_t | find_last_of (charC, size_tFrom=npos)const |
Find the last character in the string that isC , or npos if not found. | |
size_t | find_last_of (StringRef Chars, size_tFrom=npos)const |
Find the last character in the string that is inC , or npos if not found. | |
size_t | find_last_not_of (charC, size_tFrom=npos)const |
Find the last character in the string that is notC , or npos if not found. | |
size_t | find_last_not_of (StringRef Chars, size_tFrom=npos)const |
Find the last character in the string that is not inChars , or npos if not found. | |
bool | contains (StringRefOther)const |
Return true if the given string is a substring of *this, and false otherwise. | |
bool | contains (charC)const |
Return true if the given character is contained in *this, and false otherwise. | |
bool | contains_insensitive (StringRefOther)const |
Return true if the given string is a substring of *this, and false otherwise. | |
bool | contains_insensitive (charC)const |
Return true if the given character is contained in *this, and false otherwise. | |
Helpful Algorithms | |
size_t | count (charC)const |
Return the number of occurrences ofC in the string. | |
size_t | count (StringRef Str)const |
Return the number of non-overlapped occurrences ofStr in the string. | |
template<typenameT > | |
bool | getAsInteger (unsigned Radix,T &Result)const |
Parse the current string as an integer of the specified radix. | |
template<typenameT > | |
bool | consumeInteger (unsigned Radix,T &Result) |
Parse the current string as an integer of the specified radix. | |
bool | getAsInteger (unsigned Radix,APInt &Result)const |
Parse the current string as an integer of the specifiedRadix , or of an autosensed radix if theRadix given is 0. | |
bool | consumeInteger (unsigned Radix,APInt &Result) |
Parse the current string as an integer of the specifiedRadix . | |
bool | getAsDouble (double &Result,bool AllowInexact=true)const |
Parse the current string as an IEEE double-precision floating point value. | |
Substring Operations | |
constexprStringRef | substr (size_t Start, size_tN=npos)const |
Return a reference to the substring from [Start, Start + N). | |
StringRef | take_front (size_tN=1)const |
Return aStringRef equal to 'this' but with only the firstN elements remaining. | |
StringRef | take_back (size_tN=1)const |
Return aStringRef equal to 'this' but with only the lastN elements remaining. | |
StringRef | take_while (function_ref<bool(char)>F)const |
Return the longest prefix of 'this' such that every character in the prefix satisfies the given predicate. | |
StringRef | take_until (function_ref<bool(char)>F)const |
Return the longest prefix of 'this' such that no character in the prefix satisfies the given predicate. | |
StringRef | drop_front (size_tN=1)const |
Return aStringRef equal to 'this' but with the firstN elements dropped. | |
StringRef | drop_back (size_tN=1)const |
Return aStringRef equal to 'this' but with the lastN elements dropped. | |
StringRef | drop_while (function_ref<bool(char)>F)const |
Return aStringRef equal to 'this', but with all characters satisfying the given predicate dropped from the beginning of the string. | |
StringRef | drop_until (function_ref<bool(char)>F)const |
Return aStringRef equal to 'this', but with all characters not satisfying the given predicate dropped from the beginning of the string. | |
bool | consume_front (StringRef Prefix) |
Returns true if thisStringRef has the given prefix and removes that prefix. | |
bool | consume_front_insensitive (StringRef Prefix) |
Returns true if thisStringRef has the given prefix, ignoring case, and removes that prefix. | |
bool | consume_back (StringRef Suffix) |
Returns true if thisStringRef has the given suffix and removes that suffix. | |
bool | consume_back_insensitive (StringRef Suffix) |
Returns true if thisStringRef has the given suffix, ignoring case, and removes that suffix. | |
StringRef | slice (size_t Start, size_tEnd)const |
Return a reference to the substring from [Start, End). | |
std::pair<StringRef,StringRef > | split (char Separator)const |
Split into two substrings around the first occurrence of a separator character. | |
std::pair<StringRef,StringRef > | split (StringRef Separator)const |
Split into two substrings around the first occurrence of a separator string. | |
std::pair<StringRef,StringRef > | rsplit (StringRef Separator)const |
Split into two substrings around the last 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,StringRef > | rsplit (char Separator)const |
Split into two substrings around the last occurrence of a separator character. | |
StringRef | ltrim (char Char)const |
Return string with consecutiveChar characters starting from the the left removed. | |
StringRef | ltrim (StringRef Chars=" \t\n\v\f\r")const |
Return string with consecutive characters inChars starting from the left removed. | |
StringRef | rtrim (char Char)const |
Return string with consecutiveChar characters starting from the right removed. | |
StringRef | rtrim (StringRef Chars=" \t\n\v\f\r")const |
Return string with consecutive characters inChars starting from the right removed. | |
StringRef | trim (char Char)const |
Return string with consecutiveChar characters starting from the left and right removed. | |
StringRef | trim (StringRef Chars=" \t\n\v\f\r")const |
Return string with consecutive characters inChars starting from the left and right removed. | |
StringRef | detectEOL ()const |
Detect the line ending style of the string. | |
Static Public Attributes | |
static constexpr size_t | npos = ~size_t(0) |
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 theStringRef. For this reason, it is not in general safe to store aStringRef.
Definition at line51 of fileStringRef.h.
Definition at line56 of fileStringRef.h.
usingllvm::StringRef::const_reverse_iterator = std::reverse_iterator<const_iterator> |
Definition at line60 of fileStringRef.h.
usingllvm::StringRef::iterator =constchar * |
Definition at line55 of fileStringRef.h.
usingllvm::StringRef::reverse_iterator = std::reverse_iterator<iterator> |
Definition at line59 of fileStringRef.h.
usingllvm::StringRef::size_type = size_t |
Definition at line57 of fileStringRef.h.
Definition at line58 of fileStringRef.h.
| default |
Construct an empty string ref.
| delete |
Disable conversion from nullptr.
This prevents things like if (S == nullptr)
Construct a string ref from a cstring.
Definition at line88 of fileStringRef.h.
Referencesllvm::Length.
| inlineconstexpr |
Construct a string ref from a pointer and length.
Definition at line100 of fileStringRef.h.
Referencesllvm::Length.
| inline |
Construct a string ref from an std::string.
Definition at line105 of fileStringRef.h.
Referencesllvm::Length.
| inlineconstexpr |
Construct a string ref from an std::string_view.
Definition at line109 of fileStringRef.h.
Referencesllvm::Length, andllvm::size().
| inline |
back - Get the last character in the string.
Definition at line159 of fileStringRef.h.
Referencesassert(),data, andllvm::size().
Referenced byllvm::decodeBase64(),llvm::ELFYAML::dropUniqueSuffix(),FindFirstMatchingPrefix(),llvm::getObjCNamesIfSelector(),getQualifiedNameIndex(),llvm::SparcTargetLowering::getRegForInlineAsmConstraint(),handleCompressedSection(),lookup(),llvm::sys::path::reverse_iterator::operator++(), andoptimizeDoubleFP().
| inline |
Definition at line116 of fileStringRef.h.
Referencesdata.
Referenced byllvm::sys::path::append(),llvm::MDString::begin(),llvm::object::ViewArray< T >::begin(),llvm::object::BigArchive::BigArchive(),llvm::yaml::BlockScalarNode::BlockScalarNode(),chopOneUTF32(),llvm::dwarf_linker::parallel::CompileUnit::cloneDieAttrExpression(),llvm::detail::IEEEFloat::convertFromString(),llvm::convertUTF8ToUTF16String(),llvm::object::Archive::ec_symbols(),llvm::yaml::escape(),llvm::APInt::getBitsNeeded(),llvm::MemoryBufferRef::getBufferStart(),llvm::sys::detail::getHostCPUNameForPowerPC(),getHostID(),llvm::object::Archive::Symbol::getName(),llvm::object::ArchiveMemberHeader::getName(),llvm::object::Archive::getNumberOfECSymbols(),llvm::object::Archive::getNumberOfSymbols(),llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::getRecords(),llvm::object::COFFObjectFile::getRelocationTypeName(),llvm::object::MachOObjectFile::getRelocationTypeName(),llvm::object::WasmObjectFile::getRelocationTypeName(),llvm::object::XCOFFObjectFile::getRelocationTypeName(),llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(),llvm::TextInstrProfReader::hasFormat(),llvm::hash_value(),llvm::Timer::init(),llvm::RewriteBuffer::Initialize(),llvm::object::DirectX::Signature::initialize(),llvm::TGLexer::Lex(),llvm::LLLexer::LLLexer(),llvm::pdb::NamedStreamMap::load(),lower(),llvm::object::MachOUniversalBinary::MachOUniversalBinary(),llvm::sys::fs::make_absolute(),makeAbsolute(),llvm::symbolize::MarkupParser::nextNode(),llvm::object::MachOUniversalBinary::ObjectForArch::ObjectForArch(),llvm::SmallString< InternalLen >::operator+=(),llvm::object::ViewArray< T >::iterator::operator--(),llvm::object::Archive::Child::operator==(),llvm::sys::path::const_iterator::operator==(),llvm::sys::path::reverse_iterator::operator==(),llvm::InlineAsm::ParseConstraints(),parseMaybeMangledName(),readInteger(),readStruct(),llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::reconstituteName(),llvm::sys::path::replace_extension(),llvm::RewriteBuffer::ReplaceText(),llvm::yaml::ScalarNode::ScalarNode(),llvm::AsmLexer::setBuffer(),llvm::EngineBuilder::setMArch(),llvm::EngineBuilder::setMCPU(),llvm::TimerGroup::setName(),llvm::sys::unicode::startsWith(),llvm::object::Archive::symbol_begin(),llvm::TGLexer::TGLexer(),updateLoadCommandPayloadString(), andupper().
| inline |
Definition at line128 of fileStringRef.h.
Referenced byllvm::object::ELFFile< ELFT >::base(),llvm::MDString::bytes_begin(),llvm::logicalview::LVSymbolVisitorDelegate::getRecordOffset(),loadObj(),promoteToConstantPool(),llvm::readAndDecodeStrings(),llvm::xray::readBinaryFormatHeader(),llvm::coverage::RawCoverageReader::readULEB128(),llvm::orc::ELFDebugObjectSection< ELFT >::validateInBounds(), andllvm::object::WasmObjectFile::WasmObjectFile().
| inline |
compare - Compare two strings; the result is negative, zero, or positive if this string is lexicographically less than, equal to, or greater than theRHS
.
Definition at line183 of fileStringRef.h.
Referencesdata,RHS, andllvm::size().
Referenced byllvm::AttributeImpl::cmp(),llvm::SmallString< InternalLen >::compare(),compareNames(),SortAuthStubPair(), andSortSymbolPair().
int StringRef::compare_insensitive | ( | StringRef | RHS | ) | const |
Compare two strings, ignoring case.
Definition at line37 of fileStringRef.cpp.
Referencesascii_strncasecmp(),data(),RHS, andsize().
Referenced byllvm::SmallString< InternalLen >::compare_insensitive(), andllvm::DetectRoundChange::runOnMachineFunction().
int StringRef::compare_numeric | ( | StringRef | RHS | ) | const |
compare_numeric - Compare two strings, treating sequences of digits as numbers.
compare_numeric - Compare strings, handle embedded numbers.
Definition at line63 of fileStringRef.cpp.
Referencesdata(),I,isDigit(),RHS, andsize().
Referenced byllvm::SmallString< InternalLen >::compare_numeric(), andllvm::LessRecord::operator()().
Returns true if thisStringRef has the given suffix and removes that suffix.
Definition at line655 of fileStringRef.h.
Referencessize(),llvm::size(), andsubstr().
Referenced byllvm::Triple::getEnvironmentVersionString(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),llvm::SPIRV::parseBuiltinCallArgumentType(), andllvm::VFABI::tryDemangleForVFABI().
Returns true if thisStringRef has the given suffix, ignoring case, and removes that suffix.
Definition at line665 of fileStringRef.h.
Referencessize(),llvm::size(), andsubstr().
Returns true if thisStringRef has the given prefix and removes that prefix.
Definition at line635 of fileStringRef.h.
Referencesstarts_with(), andsubstr().
Referenced byFindCheckType(),llvm::Triple::getDXILVersion(),llvm::Triple::getEnvironmentVersionString(),getLiteralSectionName(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),llvm::Triple::getOSVersion(),llvm::object::Lexer::lex(),llvm::GlobPattern::match(),parseAMDGPUAtomicOptimizerStrategy(),llvm::RISCVISAInfo::parseArchString(),llvm::SPIRV::parseBuiltinCallArgumentType(),parseMagic(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),parseReplacementItem(),llvm::MCContext::setGenDwarfRootFile(),llvm::VFABI::tryDemangleForVFABI(), andllvm::VersionTuple::tryParse().
Returns true if thisStringRef has the given prefix, ignoring case, and removes that prefix.
Definition at line645 of fileStringRef.h.
Referencessubstr().
Parse the current string as an integer of the specifiedRadix
.
IfRadix
is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.
If the string does not begin with a number of the specified radix, this returns true to signify the error. The string is considered erroneous if empty. The portion of the string representing the discovered numeric value is removed from the beginning of the string.
Definition at line508 of fileStringRef.cpp.
Referencesassert(),llvm::BitWidth,GetAutoSenseRadix(), andsize().
Parse the current string as an integer of the specified radix.
IfRadix
is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.
If the string does not begin with a number of the specified radix, this returns true to signify the error. The string is considered erroneous if empty or if it overflows T. The portion of the string representing the discovered numeric value is removed from the beginning of the string.
Definition at line499 of fileStringRef.h.
Referencesllvm::consumeSignedInteger(), andllvm::consumeUnsignedInteger().
Referenced byllvm::AMDGPUMachineFunction::AMDGPUMachineFunction(),FindCheckType(),llvm::HexagonSubtarget::initializeSubtargetDependencies(),llvm::yaml::ScalarTraits< FrameIndex >::input(),llvm::Pattern::parseNumericSubstitutionBlock(),parseReplacementItem(),llvm::AMDGPUPALMetadata::setFromString(), andllvm::SIMachineFunctionInfo::SIMachineFunctionInfo().
Return true if the given character is contained in *this, and false otherwise.
Definition at line430 of fileStringRef.h.
Return true if the given string is a substring of *this, and false otherwise.
Definition at line424 of fileStringRef.h.
Referencesllvm::find(),npos, andOther.
Referenced byllvm::Hexagon_MC::addArchSubtarget(),llvm::Hexagon_MC::createHexagonMCSubtargetInfo(),llvm::MachO::createRegexFromGlob(),llvm::AsmPrinter::emitPCSections(),llvm::generateSampleImageInst(),llvm::generateVectorLoadStoreInst(),llvm::Triple::getEnvironmentVersionString(),llvm::object::getNameType(),llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::getValueKind(),llvm::offloading::amdgpu::isImageCompatibleWithEnv(),isSmallDataSection(),llvm::gsym::operator<<(),parseBraceExpansions(),llvm::SPIRV::parseBuiltinTypeNameToTargetExtType(),llvm::Pattern::parsePattern(),printSymbolizedStackTrace(), andsanitizeFunctionName().
Return true if the given character is contained in *this, and false otherwise.
Definition at line442 of fileStringRef.h.
Return true if the given string is a substring of *this, and false otherwise.
Definition at line436 of fileStringRef.h.
Referenced byllvm::generateReadImageInst().
Definition at line166 of fileStringRef.h.
ReferencesA, andllvm::size().
Referenced byllvm::yaml::Document::parseBlockNode().
| inline |
Return the number of occurrences ofC
in the string.
Definition at line451 of fileStringRef.h.
ReferencesC,data,I, andllvm::size().
Referenced byllvm::SmallString< InternalLen >::count(),FindFirstMatchingPrefix(),getGridValue(),llvm::HexagonInstrInfo::getInlineAsmLength(),llvm::DOTGraphTraits< DOTFuncMSSAInfo * >::getNodeLabel(), andllvm::yaml::MappingTraits< Argument >::mapping().
size_t StringRef::count | ( | StringRef | Str | ) | const |
Return the number of non-overlapped occurrences ofStr
in the string.
count - Return the number of non-overlapped occurrences of
Definition at line373 of fileStringRef.cpp.
data - Get a pointer to the start of the string (which may not be null terminated).
Definition at line144 of fileStringRef.h.
Referenced byllvm::msgpack::Document::addString(),annotateAllFunctions(),appendGlobalSymbolTableInfo(),llvm::object::ArchiveMemberHeader::ArchiveMemberHeader(),llvm::object::BigArchive::BigArchive(),llvm::CachedHashString::CachedHashString(),llvm::FileCheckString::CheckDag(),llvm::FileCheckString::CheckNext(),llvm::FileCheckString::CheckSame(),llvm::object::Archive::Child::Child(),compare_insensitive(),compare_numeric(),constructSegment(),constructSymbolEntry(),llvm::objcopy::coff::createGnuDebugLinkSectionContents(),llvm::jitlink::createLinkGraphFromELFObject(),createMemberHeaderParseError(),llvm::MachO::createRegexFromGlob(),llvm::DWARFListTableHeader::dump(),llvm::DWARFDebugPubTable::dump(),llvm::DWARFDebugLoclists::dumpRawEntry(),edit_distance(),edit_distance_insensitive(),llvm::DIEAbbrev::Emit(),llvm::BitstreamWriter::emitBlob(),llvm::DWARFYAML::emitDebugAbbrev(),llvm::DWARFYAML::emitDebugLine(),llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::emitFDE(),ends_with(),ends_with_insensitive(),llvm::cl::Option::error(),ExpandBasePaths(),llvm::SelectionDAG::expandMultipleResultFPLibCall(),llvm::DWARFListType< ListEntryType >::extract(),find(),find_first_not_of(),find_first_of(),find_last_not_of(),find_last_of(),FindFirstMatchingPrefix(),llvm::json::fixUTF8(),llvm::RuntimeDyldCOFFAArch64::generateRelocationStub(),llvm::RuntimeDyldCOFFX86_64::generateRelocationStub(),llvm::ErrorDiagnostic::get(),llvm::irsymtab::storage::Str::get(),llvm::irsymtab::storage::Range< T >::get(),llvm::DataExtractor::getCStr(),llvm::DataExtractor::getCStrRef(),llvm::LTOModule::getDependentLibrary(),llvm::AsmToken::getEndLoc(),llvm::objcopy::elf::SRecord::getHeader(),llvm::HexagonInstrInfo::getInlineAsmLength(),getInstructionID(),llvm::dwarf_linker::parallel::SectionDescriptor::getIntVal(),llvm::AsmToken::getLoc(),llvm::DWARFDie::getLocations(),llvm::GCOVFunction::getName(),llvm::object::Elf_Sym_Impl< ELFT >::getName(),llvm::object::ArchiveMemberHeader::getName(),llvm::NVPTXRegisterInfo::getName(),llvm::object::BigArchiveMemberHeader::getNextChildLoc(),getNextLoadCommandInfo(),llvm::opt::ArgList::GetOrMakeJoinedArgString(),llvm::object::ArchiveMemberHeader::getRawName(),llvm::object::BigArchiveMemberHeader::getRawName(),llvm::TargetLowering::getRegForInlineAsmConstraint(),llvm::SITargetLowering::getRegForInlineAsmConstraint(),llvm::PPCTargetLowering::getRegForInlineAsmConstraint(),llvm::SparcTargetLowering::getRegForInlineAsmConstraint(),llvm::RuntimeDyldMachO::getRelocationValueRef(),llvm::object::ELFFile< ELFT >::getSectionName(),getUUID(),llvm::object::ELFFile< ELFT >::getVersionDependencies(),gsiRecordCmp(),llvm::dwarf_linker::guessDeveloperDir(),isAsmComment(),llvm::json::isUTF8(),LLVMGetBasicBlockName(),LLVMGetDebugLocDirectory(),LLVMGetDebugLocFilename(),LLVMGetNamedMetadataName(),LLVMGetValueName(),LLVMOrcSymbolStringPoolEntryStr(),lookupLLVMIntrinsicByName(),llvm::NVPTXTargetLowering::LowerCall(),llvm::VETargetLowering::LowerCustomJumpTableEntry(),llvm::LegalizerHelper::lowerReadWriteRegister(),llvm::remarks::magicToFormat(),PrefixMatcher::match(),llvm::Pattern::match(),llvm::sys::path::native(),llvm::MCJIT::notifyFreeingObject(),llvm::MCJIT::notifyObjectLoaded(),llvm::StringTable::operator[](),llvm::remarks::ParsedStringTable::operator[](),llvm::jitlink::COFFDirectiveParser::parse(),llvm::remarks::ParsedStringTable::ParsedStringTable(),llvm::remarks::parseFormat(),llvm::remarks::parseHotnessThresholdOption(),parseMaybeMangledName(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),parseRD(),parseStrTab(),parseStrTabSize(),parseTypeIdSummaryRecord(),parseV2DirFileTables(),parseVersion(),parseWholeProgramDevirtResolution(),llvm::PGOCtxProfileWriter::PGOCtxProfileWriter(),ProcessMatchResult(),llvm::RuntimeDyldELF::processRelocationRef(),llvm::xray::FileBasedRecordProducer::produce(),llvm::TextCodeGenDataReader::read(),llvm::irsymtab::readBitcode(),llvm::FileCheck::readCheckFile(),readCoverageMappingData(),llvm::jitlink::readTargetMachineArch(),llvm::LessRecordRegister::RecordParts::RecordParts(),llvm::Regex::Regex(),llvm::report_fatal_error(),reportError(),rfind_insensitive(),llvm::StringSaver::save(),llvm::orc::MachOBuilder< MachOTraits >::Section::Section(),llvm::orc::MachOBuilder< MachOTraits >::Segment::Segment(),llvm::orc::shared::SPSSerializationTraits< SPSString, StringRef >::serialize(),starts_with_insensitive(),llvm::StringTable::StringTable(),llvm::cl::TokenizeGNUCommandLine(),llvm::codeview::TypeServer2Record::TypeServer2Record(),llvm::objcopy::wasm::Writer::write(), andllvm::yaml::yaml2archive().
| inline |
Detect the line ending style of the string.
If the string contains a line ending, return the line ending character sequence that is detected. Otherwise return '
' for unix line endings.
Definition at line831 of fileStringRef.h.
Referencesdata,llvm::find(),npos, andllvm::size().
| inline |
Return aStringRef equal to 'this' but with the lastN
elements dropped.
Definition at line616 of fileStringRef.h.
Referencesassert(),N,llvm::size(), andsubstr().
Referenced byllvm::OpenMPIRBuilder::createTargetDeinit(),llvm::OpenMPIRBuilder::createTargetInit(),llvm::AMDGPU::getArchFamilyNameAMDGCN(),llvm::getObjCNamesIfSelector(),llvm::yaml::Document::parseBlockNode(),llvm::omp::prettifyFunctionName(), andllvm::GCOVBuffer::readString().
| inline |
Return aStringRef equal to 'this' but with the firstN
elements dropped.
Definition at line609 of fileStringRef.h.
Referencesassert(),N,llvm::size(), andsubstr().
Referenced byllvm::objcopy::elf::OwnedDataSection::appendHexData(),llvm::ELFAttrs::attrTypeAsString(),llvm::ELFAttrs::attrTypeFromString(),chopOneUTF32(),llvm::omp::deconstructOpenMPKernelName(),find_if(),FindCheckType(),FindFirstMatchingPrefix(),llvm::AArch64::getArchExtFeature(),llvm::objcopy::elf::IHexRecord::getChecksum(),getDXILArchNameFromShaderModel(),llvm::getFuncNameWithoutPrefix(),getLiteralSectionName(),llvm::opt::OptTable::Info::getName(),llvm::getObjCNamesIfSelector(),llvm::codeview::getSymbolName(),llvm::object::ELFFile< ELFT >::getVersionDependencies(),llvm::HexagonSubtarget::initializeSubtargetDependencies(),llvm::object::Lexer::lex(),llvm::symbolize::MarkupParser::nextNode(),llvm::RISCVISAInfo::parseArchString(),llvm::yaml::parseBool(),llvm::DebugCounter::parseChunks(),llvm::RISCVISAInfo::parseFeatures(),llvm::AArch64::ExtensionSet::parseModifier(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::Pattern::parseNumericSubstitutionBlock(),parsePredicateRegAsConstraint(),parseScalarValue(),parseStrTab(),parseStrTabSize(),llvm::MachO::parseSymbol(),parseThunkName(),parseVersion(),popFront(),printSourceLine(),llvm::TextCodeGenDataReader::read(),llvm::FileCheck::readCheckFile(),llvm::sys::path::remove_dots(),llvm::MCContext::setGenDwarfRootFile(),splitLiteralAndReplacement(),llvm::orc::DLLImportDefinitionGenerator::tryToGenerate(), andupgradeLoopTag().
| inline |
Return aStringRef equal to 'this', but with all characters not satisfying the given predicate dropped from the beginning of the string.
Definition at line629 of fileStringRef.h.
ReferencesF,llvm::find_if(), andsubstr().
| inline |
Return aStringRef equal to 'this', but with all characters satisfying the given predicate dropped from the beginning of the string.
Definition at line623 of fileStringRef.h.
ReferencesF,llvm::find_if_not(), andsubstr().
Referenced byllvm::omp::deconstructOpenMPKernelName().
unsigned StringRef::edit_distance | ( | llvm::StringRef | Other, |
bool | AllowReplacements =true , | ||
unsigned | MaxEditDistance =0 | ||
) | const |
Determine the edit distance between this string and another string.
Other | the string to compare this string against. |
AllowReplacements | whether to allow character replacements (change one character into another) as a single operation, rather than as two operations (an insertion and a removal). |
MaxEditDistance | If non-zero, the maximum edit distance that this routine is allowed to compute. If the edit distance will exceed that maximum, returnsMaxEditDistance+1 . |
AllowReplacements
istrue
) replacements needed to transform one of the given strings into the other. If zero, the strings are identical.Definition at line94 of fileStringRef.cpp.
Referencesllvm::ComputeEditDistance(),data(),llvm::Other, andsize().
Referenced byLookupNearestOption().
unsigned llvm::StringRef::edit_distance_insensitive | ( | StringRef | Other, |
bool | AllowReplacements =true , | ||
unsigned | MaxEditDistance =0 | ||
) | const |
Definition at line102 of fileStringRef.cpp.
Referencesllvm::ComputeMappedEditDistance(),data(),llvm::Other, andsize().
| inlineconstexpr |
empty -Check if the string is empty.
Definition at line147 of fileStringRef.h.
Referencesllvm::size().
Referenced byllvm::MachO::InterfaceFile::addAllowableClient(),llvm::DwarfDebug::addDwarfTypeUnitType(),addMappingsFromTLI(),llvm::MachO::InterfaceFile::addParentUmbrella(),llvm::MachO::InterfaceFile::addReexportedLibrary(),llvm::MachO::InterfaceFile::addRPath(),llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(),llvm::dwarf_linker::parallel::CompileUnit::analyzeImportedModule(),llvm::analyzeImportedModule(),llvm::objcopy::elf::OwnedDataSection::appendHexData(),llvm::object::applyNameType(),llvm::DwarfUnit::applySubprogramAttributes(),llvm::DwarfUnit::applySubprogramDefinitionAttributes(),llvm::BinaryStreamError::BinaryStreamError(),buildDWODescription(),llvm::caseFoldingDjbHash(),llvm::checkDebugInfoMetadata(),chopOneUTF32(),llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::cloneAndEmitDebugFrame(),llvm::InlineAsm::collectAsmStrs(),collectMetadataInfo(),llvm::DIEHash::computeCUSignature(),computeDefaultCPU(),llvm::ARM::computeDefaultTargetABI(),llvm::MCSchedModel::computeInstrLatency(),llvm::LoongArchABI::computeTargetABI(),llvm::RISCVABI::computeTargetABI(),computeTargetABI(),llvm::DwarfUnit::constructTypeDIE(),llvm::consumeUnsignedInteger(),llvm::detail::IEEEFloat::convertFromString(),llvm::convertUTF8ToUTF16String(),llvm::sampleprof::SampleProfileReader::create(),llvm::vfs::RedirectingFileSystem::create(),llvm::memprof::RawMemProfReader::create(),llvm::sys::fs::create_directories(),createAArch64MCSubtargetInfo(),llvm::sampleprof::SampleContext::createCtxVectorFromStr(),createLoongArchMCSubtargetInfo(),createProfileFileNameVar(),llvm::createProfileFileNameVar(),createRISCVMCSubtargetInfo(),llvm::createSanitizerCtorAndInitFunctions(),createSparcMCSubtargetInfo(),llvm::sys::fs::createTemporaryFile(),createVEMCSubtargetInfo(),llvm::X86_MC::createX86MCSubtargetInfo(),llvm::declareSanitizerInitFunction(),llvm::FileCheckPatternContext::defineCmdlineVariables(),llvm::DWARFUnit::determineStringOffsetsTableContributionDWO(),llvm::ELFYAML::dropUniqueSuffix(),llvm::gsym::GsymReader::dump(),llvm::DWARFDebugLoclists::dumpRawEntry(),llvm::object::Archive::ec_symbols(),llvm::emitAMDGPUPrintfCall(),emitComments(),EmitGenDwarfAbbrev(),EmitGenDwarfInfo(),llvm::TargetLoweringObjectFileMachO::emitModuleMetadata(),llvm::ARMTargetStreamer::emitTargetAttributes(),llvm::cl::Option::error(),ExpandBasePaths(),llvm::cl::ExpansionContext::expandResponseFiles(),llvm::memprof::extractCallsFromIR(),llvm::CodeExtractor::extractCodeRegion(),llvm::AMDGPU::fillAMDGPUFeatureMap(),find_if(),FindFirstMatchingPrefix(),llvm::sampleprof::FunctionSamples::findFunctionSamplesAt(),llvm::finishBuildOpDecorate(),llvm::format_provider< std::chrono::duration< Rep, Period > >::format(),llvm::JITSymbolFlags::fromGlobalValue(),llvm::Attribute::get(),llvm::get_threadpool_strategy(),llvm::AMDGPU::getArchFamilyNameAMDGCN(),llvm::ARM::getARMCPUForArch(),llvm::DINode::getCanonicalMDString(),llvm::DIMacroNode::getCanonicalMDString(),llvm::objcopy::elf::IHexRecord::getChecksum(),llvm::dwarf_linker::classic::DeclContextTree::getChildDeclContext(),llvm::objcopy::ConfigManager::getCOFFConfig(),llvm::MCContext::getCOFFSection(),getCommonClassOptions(),llvm::getCPU(),llvm::dwarf_linker::parallel::CompileUnit::getDirAndFilenameFromLineTable(),llvm::MCContext::getELFSection(),llvm::json::Path::Root::getError(),getExtensionVersion(),getFeatures(),llvm::DWARFDebugLine::Prologue::getFileNameByIndex(),llvm::coverage::CovMapFunctionRecordV1< IntPtrT >::getFuncName(),llvm::getFuncNameWithoutPrefix(),llvm::InstrProfSymtab::getFuncOrVarNameIfDefined(),llvm::gsym::GsymReader::getFunctionInfoDataAtIndex(),llvm::object::AbstractArchiveMemberHeader::getGID(),llvm::GlobalValue::getGlobalIdentifier(),getGPUOrDefault(),llvm::AMDGPU::getIntegerVecAttribute(),llvm::X86TargetLowering::getIRStackGuard(),llvm::TargetLibraryInfoImpl::getLibFunc(),llvm::object::MachOObjectFile::getLibraryShortNameByIndex(),llvm::objcopy::ConfigManager::getMachOConfig(),llvm::PPC::getNormalizedPPCTargetCPU(),getOpEnabled(),getOpRefinementSteps(),llvm::DwarfCompileUnit::getOrCreateCommonBlock(),llvm::DwarfCompileUnit::getOrCreateGlobalVariableDIE(),llvm::symbolize::LLVMSymbolizer::getOrCreateModuleInfo(),llvm::getOrCreateSanitizerCtorAndInitFunctions(),llvm::MCContext::getOrCreateSymbol(),getPassNameAndInstanceNum(),llvm::getPGOFuncName(),getPrettyScopeName(),llvm::MCObjectFileInfo::getPseudoProbeDescSection(),getQualifiedNameIndex(),llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::getRecords(),llvm::SparcTargetLowering::getRegForInlineAsmConstraint(),getSearchPaths(),getStackGuard(),llvm::getSubDirectoryPath(),llvm::M68kMCInstLower::GetSymbolFromOperand(),llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(),llvm::lto::getThinLTOOutputFile(),getUnicodeEncoding(),llvm::MCSymbolXCOFF::getUnqualifiedName(),getUUID(),llvm::VecDesc::getVectorFunctionABIVariantString(),llvm::VFABI::getVectorVariantNames(),llvm::yaml::Node::getVerbatimTag(),llvm::objcopy::ConfigManager::getWasmConfig(),llvm::TargetLibraryInfoImpl::getWidestVF(),llvm::objcopy::ConfigManager::getXCOFFConfig(),llvm::DWARFVerifier::handleDebugAbbrev(),HandlePrefixedOrGroupedOption(),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(),llvm::IntelExpr::hasBaseReg(),llvm::SubtargetFeatures::hasFlag(),llvm::IntelExpr::hasIndexReg(),llvm::MCAsmInfo::hasLinkerPrivateGlobalPrefix(),llvm::IntelExpr::hasOffset(),llvm::GlobalValue::hasSection(),llvm::X86TargetLowering::hasStackProbeSymbol(),llvm::object::Archive::hasSymbolTable(),llvm::CSKYSubtarget::initializeSubtargetDependencies(),llvm::MSP430Subtarget::initializeSubtargetDependencies(),llvm::SparcSubtarget::initializeSubtargetDependencies(),llvm::MCSubtargetInfo::InitMCProcessorInfo(),llvm::X86TargetLowering::insertSSPDeclarations(),llvm::gsym::GsymCreator::insertString(),llvm::AMDGPU::insertWaveSizeFeature(),llvm::SampleProfileProber::instrumentOneFunc(),llvm::ELFAttributeParser::integerAttribute(),isCanonical(),llvm::object::ViewArray< T >::isEmpty(),llvm::SubtargetFeatures::isEnabled(),llvm::TargetLibraryInfoImpl::isFunctionVectorizable(),llvm::RISCVISAInfo::isSupportedExtensionWithVersion(),llvm::GlobPattern::isTrivialMatchAll(),llvm::sys::unicode::Node::isValid(),llvm::AMDGPU::SendMsg::isValidMsgOp(),llvm::AMDGPU::MTBUFFormat::isValidNfmt(),llvm::object::Lexer::lex(),llvm::LoadAndStorePromoter::LoadAndStorePromoter(),loadBinaryFormat(),llvm::OpenMPIRBuilder::loadOffloadInfoMetadata(),LookupNearestOption(),llvm::TargetRegistry::lookupTarget(),llvm::codeview::CodeViewRecordIO::mapStringZVectorZ(),llvm::Pattern::match(),llvm::GlobPattern::match(),matchAsm(),llvm::logicalview::LVPatterns::matchPattern(),llvm::symbolize::MarkupParser::nextNode(),llvm::Triple::normalize(),llvm::sys::path::reverse_iterator::operator++(),llvm::gsym::operator<<(),optimizeDoubleFP(),optimizeNaN(),llvm::DWARFDebugFrame::parse(),llvm::AMDGPULibFunc::parse(),llvm::PassBuilder::parseAAPipeline(),llvm::MachO::parseAliasList(),parseAMDGPUAtomicOptimizerStrategy(),parseAMDGPUAttributorPassOptions(),llvm::AArch64::parseArchExtension(),llvm::RISCVISAInfo::parseArchString(),parseARMArch(),llvm::ARM_MC::ParseARMTriple(),parseCC(),llvm::DebugCounter::parseChunks(),llvm::parseDenormalFPAttribute(),llvm::remarks::ParsedStringTable::ParsedStringTable(),llvm::formatv_object_base::parseFormatString(),parseInt(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),llvm::remarks::YAMLRemarkParser::parseRemark(),parseReplacementItem(),llvm::MCSectionMachO::ParseSectionSpecifier(),llvm::PassBuilder::parseSinglePassOption(),parseSubArch(),parseV2DirFileTables(),llvm::DiagnosticInfoSampleProfile::print(),llvm::DWARFExpression::Operation::print(),llvm::MCInstPrinter::printAnnotation(),llvm::ELFAttributeParser::printAttribute(),printCFI(),PrintCFIEscape(),printExtendedName(),PrintExtension(),printFile(),llvm::AMDGPUInstPrinter::printHwreg(),llvm::NVPTXInstPrinter::printMmaCode(),llvm::cl::generic_parser_base::printOptionInfo(),llvm::AMDGPUInstPrinter::printSendMsg(),llvm::MCSectionMachO::printSwitchToSection(),printSymbolizedStackTrace(),processLoadCommands(),llvm::AttributeImpl::Profile(),llvm::TextCodeGenDataReader::read(),llvm::irsymtab::readBitcode(),llvm::FileCheck::readCheckFile(),llvm::GCOVFile::readGCNO(),llvm::TextInstrProfReader::readNextRecord(),llvm::coverage::RawCoverageReader::readULEB128(),llvm::LessRecordRegister::RecordParts::RecordParts(),llvm::sys::path::remove_dots(),llvm::sys::path::replace_path_prefix(),runOnFunction(),llvm::sampleprof::SampleContext::SampleContext(),sanitizeFunctionName(),llvm::dwarf_linker::parallel::AcceleratorRecordsSaver::save(),llvm::StringSaver::save(),saveTempBitcode(),llvm::Hexagon_MC::selectHexagonCPU(),selectM68kCPU(),llvm::MIPS_MC::selectMipsCPU(),llvm::EngineBuilder::selectTarget(),llvm::orc::shared::SPSSerializationTraits< SPSString, StringRef >::serialize(),llvm::MachO::InterfaceFile::setFromBinaryAttrs(),llvm::codegen::setFunctionAttributes(),llvm::MCContext::setGenDwarfRootFile(),llvm::GlobalValue::setPartition(),llvm::sandboxir::PassManager< ParentPass, ContainedPass >::setPassPipeline(),llvm::GlobalObject::setSection(),llvm::lto::setupStatsFile(),llvm::VFABI::setVectorVariantNames(),shouldAlwaysEmitCompleteClassType(),shouldPrintOption(),llvm::MachO::shouldSkipSymLink(),llvm::SIMachineFunctionInfo::SIMachineFunctionInfo(),llvm::SIModeRegisterDefaults::SIModeRegisterDefaults(),llvm::SPIRVTranslate(),split(),splitLiteralAndReplacement(),llvm::sys::unicode::startsWith(),llvm::ELFAttributeParser::stringAttribute(),llvm::StringTable::StringTable(),llvm::Regex::sub(),llvm::BTFParser::symbolize(),llvm::symbolize::toJSON(),llvm::AArch64::ExtensionSet::toLLVMFeatureList(),llvm::InlineAdvisorAnalysis::Result::tryCreate(),llvm::VFABI::tryDemangleForVFABI(),llvm::MCDwarfLineTableHeader::tryGetFile(),llvm::VersionTuple::tryParse(),llvm::DwarfUnit::updateAcceleratorTables(),llvm::UpgradeAttributes(),llvm::InlineAsm::verify(),verifyFuncBFI(),llvm::write(),writeDWARFExpression(),llvm::ThinLTOCodeGenerator::writeGeneratedObject(), andllvm::writeStringsAndOffsets().
| inline |
Definition at line118 of fileStringRef.h.
Referencesdata, andllvm::size().
Referenced byllvm::sys::path::append(),llvm::object::BigArchiveMemberHeader::BigArchiveMemberHeader(),llvm::yaml::BlockScalarNode::BlockScalarNode(),llvm::FileCheckString::CheckNext(),llvm::FileCheckString::CheckSame(),chopOneUTF32(),llvm::dwarf_linker::parallel::CompileUnit::cloneDieAttrExpression(),llvm::convertUTF8ToUTF16String(),llvm::MDString::end(),llvm::object::ViewArray< T >::end(),ends_with_insensitive(),llvm::yaml::escape(),llvm::MemoryBufferRef::getBufferEnd(),llvm::sys::detail::getHostCPUNameForPowerPC(),getHostID(),getLoadCommandInfo(),llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::getRecords(),llvm::TargetLowering::getRegForInlineAsmConstraint(),llvm::object::COFFObjectFile::getRelocationTypeName(),llvm::object::MachOObjectFile::getRelocationTypeName(),llvm::object::WasmObjectFile::getRelocationTypeName(),llvm::object::XCOFFObjectFile::getRelocationTypeName(),llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(),llvm::hash_value(),llvm::Timer::init(),llvm::RewriteBuffer::Initialize(),llvm::AsmLexer::LexToken(),llvm::AsmLexer::LexUntilEndOfStatement(),llvm::pdb::NamedStreamMap::load(),lower(),llvm::sys::fs::make_absolute(),llvm::symbolize::MarkupParser::nextNode(),llvm::object::ViewArray< T >::iterator::operator*(),llvm::object::ViewArray< T >::iterator::operator++(),llvm::InlineAsm::ParseConstraints(),parseMaybeMangledName(),parseRD(),parseRegisterNumber(),readInteger(),readStruct(),llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::reconstituteName(),llvm::Regex::Regex(),llvm::sys::path::replace_extension(),llvm::RewriteBuffer::ReplaceText(),llvm::yaml::ScalarNode::ScalarNode(),llvm::EngineBuilder::setMArch(),llvm::EngineBuilder::setMCPU(),llvm::TimerGroup::setName(),llvm::sys::unicode::startsWith(),updateLoadCommandPayloadString(), andupper().
Definition at line282 of fileStringRef.h.
Check if this string ends with the givenSuffix
.
Definition at line277 of fileStringRef.h.
Referencesdata(),size(), andllvm::size().
Referenced byllvm::DWARFTypePrinter< DieType >::appendTypeTagName(),llvm::OpenMPIRBuilder::createTargetDeinit(),llvm::OpenMPIRBuilder::createTargetInit(),llvm::X86TargetLowering::EmitKCFICheck(),llvm::SmallString< InternalLen >::ends_with(),llvm::sys::detail::getHostCPUNameForARM(),llvm::opt::ArgList::GetOrMakeJoinedArgString(),llvm::object::BigArchiveMemberHeader::getRawName(),llvm::SITargetLowering::getRegForInlineAsmConstraint(),llvm::AMDGPU::IsaInfo::getTargetIDSettingFromFeatureString(),isDwoSection(),isDWOSection(),llvm::MachO::isPrivateLibrary(),llvm::sys::path::const_iterator::operator++(),llvm::parseAnalysisUtilityPasses(),llvm::ARM::parseArchEndian(),llvm::SPIRV::parseBuiltinCallArgumentType(),parsePredicateRegAsConstraint(),parseSubArch(), andllvm::omp::prettifyFunctionName().
Check if this string ends with the givenSuffix
, ignoring case.
Definition at line51 of fileStringRef.cpp.
Referencesascii_strncasecmp(),data(),end(), andsize().
Referenced byllvm::orc::LoadAndLinkDynLibrary::operator()().
Check for string equality, ignoring case.
Definition at line176 of fileStringRef.h.
ReferencesRHS, andllvm::size().
Referenced byllvm::SmallString< InternalLen >::equals_insensitive(),llvm::findVCToolChainViaEnvironment(),llvm::X86TargetLowering::isInlineAsmTargetBranch(),llvm::HexagonMCInstrInfo::isOrderedDuplexPair(),llvm::logicalview::LVPatterns::matchPattern(), andrfind_insensitive().
| inline |
Search for the first characterC
in the string.
C
, or npos if not found.Definition at line297 of fileStringRef.h.
Referenced bycheckLinkerOptCommand(),CommaSeparateAndAddOccurrence(),count(),llvm::object::Archive::ec_symbols(),emitComments(),llvm::AsmPrinter::emitPCSections(),llvm::RuntimeDyldCheckerExprEval::evaluate(),llvm::ELFObjectWriter::executePostLayoutBinding(),ExpandBasePaths(),llvm::SmallString< InternalLen >::find(),llvm::BTFParser::findString(),llvm::DataExtractor::getCStrRef(),llvm::PGOContextualProfile::getFunctionName(),getLiteralSectionName(),llvm::object::ArchiveMemberHeader::getName(),llvm::getObjCNamesIfSelector(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),llvm::object::ArchiveMemberHeader::getRawName(),llvm::gsym::StringTable::getString(),llvm::isSpecialPass(),llvm::object::Lexer::lex(),llvm::lookupBuiltin(),PrefixMatcher::match(),llvm::Pattern::match(),llvm::RISCVISAInfo::parseArchString(),parseBraceExpansions(),llvm::SPIRV::parseBuiltinCallArgumentType(),llvm::SPIRV::parseBuiltinTypeNameToTargetExtType(),llvm::SPIRV::parseBuiltinTypeStr(),ParseLine(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),PrefixMatcher::PrefixMatcher(),printSourceLine(),llvm::object::replace(),singleLetterExtensionRank(),split(), andllvm::Regex::sub().
size_t StringRef::find | ( | StringRef | Str, |
size_t | From =0 | ||
) | const |
Search for the first stringStr
in the string.
find - Search for the first string
Str
, or npos if not found.Definition at line132 of fileStringRef.cpp.
Referencesdata(),From,llvm::Last,LLVM_UNLIKELY,N,npos,Ptr,size(), andSize.
StringRef::size_type StringRef::find_first_not_of | ( | char | C, |
size_t | From =0 | ||
) | const |
Find the first character in the string that is notC
or npos if not found.
find_first_not_of - Find the first character in the string that is not
Definition at line253 of fileStringRef.cpp.
Referencesllvm::CallingConv::C, andFrom.
Referenced byllvm::SmallString< InternalLen >::find_first_not_of(),matchAsm(),llvm::dwarf_linker::parseDebugTableName(),ParseLine(),llvm::FileCheck::readCheckFile(),llvm::sampleprof::SampleProfileReaderText::readImpl(), andllvm::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 stringChars
, 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())
Note: O(size() + Chars.size())
Definition at line261 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,data(),From,npos, andsize().
| inline |
Find the first character in the string that isC
, or npos if not found.
Same as find.
Definition at line377 of fileStringRef.h.
ReferencesC,llvm::find(), andFrom.
Referenced byllvm::GlobPattern::create(),llvm::SmallString< InternalLen >::find_first_of(),llvm::generateConvertInst(),llvm::object::Lexer::lex(),llvm::sys::path::const_iterator::operator++(),llvm::SPIRV::parseBuiltinCallArgumentType(),ParseLine(),llvm::Pattern::parsePattern(),parseScalarValue(),llvm::sys::printArg(),printPTERNLOGComments(),llvm::FileCheck::readCheckFile(),llvm::BinaryStreamReader::readCString(),llvm::sys::path::remove_dots(), andsplitLiteralAndReplacement().
StringRef::size_type StringRef::find_first_of | ( | StringRef | Chars, |
size_t | From =0 | ||
) | const |
Find the first character in the string that is inChars
, or npos if not found.
find_first_of - Find the first character in the string that is in
Complexity: O(size() + Chars.size())
Note: O(size() + Chars.size())
Definition at line239 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,data(),From,npos, andsize().
| inline |
Search for the first character satisfying the predicateF
.
F
starting fromFrom
, or npos if not found.Definition at line311 of fileStringRef.h.
Referencesdrop_front(),empty(),F,From,front(),npos,size(), andllvm::size().
Referenced byfind_insensitive().
| inline |
Search for the first character not satisfying the predicateF
.
F
starting fromFrom
, or npos if not found.Definition at line326 of fileStringRef.h.
ReferencesF,llvm::find_if(), andFrom.
size_t StringRef::find_insensitive | ( | char | C, |
size_t | From =0 | ||
) | const |
Search for the first characterC
in the string, ignoring case.
C
, or npos if not found.Definition at line57 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,D,find_if(), andFrom.
Referenced byllvm::Pattern::match().
size_t StringRef::find_insensitive | ( | StringRef | Str, |
size_t | From =0 | ||
) | const |
Search for the first stringStr
in the string, ignoring case.
Str
, or npos if not found.Definition at line193 of fileStringRef.cpp.
StringRef::size_type StringRef::find_last_not_of | ( | char | C, |
size_t | From =npos | ||
) | const |
Find the last character in the string that is notC
, or npos if not found.
find_last_not_of - Find the last character in the string that is not
Definition at line291 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,data(),From,npos, andsize().
Referenced byparseScalarValue().
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 inChars
, 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())
Note: O(size() + Chars.size())
Definition at line302 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,data(),From,npos, andsize().
Find the last character in the string that isC
, or npos if not found.
Definition at line400 of fileStringRef.h.
Referenced byllvm::sys::path::extension(),llvm::SmallString< InternalLen >::find_last_of(),llvm::SourceMgr::getLineAndColumn(),llvm::yaml::Node::getVerbatimTag(),ParseLine(), andllvm::sys::path::stem().
StringRef::size_type StringRef::find_last_of | ( | StringRef | Chars, |
size_t | From =npos | ||
) | const |
Find the last character in the string that is inC
, or npos if not found.
find_last_of - Find the last character in the string that is in
Complexity: O(size() + Chars.size())
Note: O(size() + Chars.size())
Definition at line277 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,data(),From,npos, andsize().
| inline |
front - Get the first character in the string.
Definition at line153 of fileStringRef.h.
Referenced byfind_if(),FindCheckType(),llvm::JITSymbolFlags::fromGlobalValue(),getQualifiedNameIndex(),llvm::SparcTargetLowering::getRegForInlineAsmConstraint(),llvm::RISCVISAInfo::parseArchString(),llvm::yaml::parseBool(),llvm::PassBuilder::parsePassPipeline(),popFront(),llvm::sys::path::remove_dots(),llvm::MCContext::setGenDwarfRootFile(),splitLiteralAndReplacement(), andllvm::write().
Parse the current string as an IEEE double-precision floating point value.
The string must be a well-formed double.
IfAllowInexact
is false, the function will fail if the string cannot be represented exactly. Otherwise, the function only fails in case of an overflow or underflow, or an invalid floating point representation.
Definition at line599 of fileStringRef.cpp.
Referencesllvm::errorToBool(),F,llvm::APFloatBase::opInexact,llvm::APFloatBase::opOK, andllvm::APFloatBase::rmNearestTiesToEven.
Parse the current string as an integer of the specifiedRadix
, or of an autosensed radix if theRadix
given is 0.
The current value inResult
is discarded, and the storage is changed to be wide enough to store the parsed integer.
APInt::fromString is superficially similar but assumes the string is well-formed in the given radix.
Definition at line589 of fileStringRef.cpp.
Parse the current string as an integer of the specified radix.
IfRadix
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 line470 of fileStringRef.h.
Referencesllvm::getAsSignedInteger(), andllvm::getAsUnsignedInteger().
Referenced byadjustCallerStackProbeSize(),adjustMinLegalVectorWidth(),llvm::object::BigArchive::BigArchive(),checkedGetHex(),llvm::object::Archive::Child::Child(),llvm::get_threadpool_strategy(),getArchiveMemberDecField(),getArchiveMemberOctField(),getExtensionVersion(),getGlobalSymtabLocAndSize(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),getPassNameAndInstanceNum(),llvm::getStringFnAttrAsInt(),llvm::X86TargetMachine::getSubtargetImpl(),llvm::AMDGPU::Exp::getTgtId(),llvm::remarks::Argument::getValAsInt(),llvm::yaml::isInteger(),optimizeNaN(),llvm::vfs::RedirectingFileSystemParser::parse(),llvm::SPIRV::parseBuiltinCallArgumentType(),llvm::parseCachePruningPolicy(),parseDuration(),ParseHead(),llvm::remarks::parseHotnessThresholdOption(),ParseLine(),parseMetadata(),llvm::RISCVISAInfo::parseNormalizedArchString(),parsePredicateRegAsConstraint(),parseRegisterNumber(),parseSectionFlags(),llvm::MCSectionMachO::ParseSectionSpecifier(),llvm::parseStatepointDirectivesFromAttrs(),llvm::AttributeFuncs::updateMinLegalVectorWidthAttr(), andllvm::writeArchiveToStream().
std::string StringRef::lower | ( | ) | const |
Definition at line113 of fileStringRef.cpp.
Referencesbegin(),end(), andllvm::map_iterator().
Referenced byllvm::ELF::convertArchNameToEMachine(),llvm::MipsTargetAsmStreamer::emitDirectiveCpAdd(),llvm::MipsTargetAsmStreamer::emitDirectiveCpLoad(),llvm::MipsTargetAsmStreamer::emitDirectiveCpLocal(),llvm::MipsTargetAsmStreamer::emitDirectiveCpsetup(),llvm::MipsTargetAsmStreamer::emitFrame(),llvm::SparcTargetAsmStreamer::emitSparcRegisterIgnore(),llvm::SparcTargetAsmStreamer::emitSparcRegisterScratch(),llvm::VETargetAsmStreamer::emitVERegisterIgnore(),llvm::VETargetAsmStreamer::emitVERegisterScratch(),getBankedRegisterMask(),llvm::getMachineType(),llvm::RISCVTargetLowering::getRegForInlineAsmConstraint(),getRegisterName(),llvm::ELFAttributeParser::parseSubsection(),parseVectorKind(),llvm::MIPrinter::print(),llvm::MipsAsmPrinter::printOperand(),llvm::printRegClassOrBank(),llvm::ARCInstPrinter::printRegName(),llvm::LanaiInstPrinter::printRegName(),llvm::MipsInstPrinter::printRegName(), andllvm::XCoreInstPrinter::printRegName().
Return string with consecutiveChar
characters starting from the the left removed.
Definition at line791 of fileStringRef.h.
Referencesllvm::size().
Referenced byllvm::RuntimeDyldCheckerExprEval::evaluate(),FindCheckType(),llvm::Pattern::parseNumericSubstitutionBlock(),parseReplacementItem(),parseScalarValue(), andllvm::VFABI::tryDemangleForVFABI().
Return string with consecutive characters inChars
starting from the left removed.
Definition at line797 of fileStringRef.h.
Referencesllvm::size().
| inlineconstexpr |
Definition at line256 of fileStringRef.h.
Referencesdata, andllvm::size().
| delete |
Disallow accidental assignment from a temporary std::string.
The declaration here is extra complicated so thatstringRef = {}
andstringRef = "abc"
continue to select the move assignment operator.
| inline |
Definition at line239 of fileStringRef.h.
Referencesassert(),data,Index, andllvm::size().
| inline |
Definition at line120 of fileStringRef.h.
| inline |
Definition at line124 of fileStringRef.h.
Search for the last characterC
in the string.
C
, or npos if not found.Definition at line347 of fileStringRef.h.
ReferencesC,data,From,I,npos, andllvm::size().
Referenced byllvm::omp::deconstructOpenMPKernelName(),llvm::ELFYAML::dropUniqueSuffix(),llvm::sampleprof::FunctionSamples::getCanonicalFnName(),getStringIndex(),llvm::object::MachOObjectFile::guessLibraryShortName(),llvm::SPIRV::lookupBuiltinNameHelper(),ParseHead(), andllvm::SmallString< InternalLen >::rfind().
size_t StringRef::rfind | ( | StringRef | Str | ) | const |
Search for the last stringStr
in the string.
rfind - Search for the last string
Str
, or npos if not found.Definition at line219 of fileStringRef.cpp.
Search for the last characterC
in the string, ignoring case.
C
, or npos if not found.Definition at line204 of fileStringRef.cpp.
Referencesllvm::CallingConv::C,data(),From,npos, andsize().
size_t StringRef::rfind_insensitive | ( | StringRef | Str | ) | const |
Search for the last stringStr
in the string, ignoring case.
Str
, or npos if not found.Definition at line223 of fileStringRef.cpp.
Referencesequals_insensitive(),N,npos,size(), andsubstr().
Split into two substrings around the last occurrence of a separator character.
IfSeparator
is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is minimal. IfSeparator
is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
Separator | - The character to split on. |
Definition at line785 of fileStringRef.h.
Split into two substrings around the last occurrence of a separator string.
IfSeparator
is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is minimal. IfSeparator
is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
Separator | - The string to split on. |
Definition at line733 of fileStringRef.h.
Return string with consecutiveChar
characters starting from the right removed.
Definition at line803 of fileStringRef.h.
Referencesllvm::size().
Referenced byllvm::VPlanPrinter::dump(),llvm::RuntimeDyldCheckerExprEval::evaluate(),getFieldRawString(),llvm::object::ArchiveMemberHeader::getName(),getPayloadString(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),llvm::X86InstPrinterCommon::printCondFlags(),llvm::TextCodeGenDataReader::read(), andtrim().
Return string with consecutive characters inChars
starting from the right removed.
Definition at line809 of fileStringRef.h.
Referencesllvm::size().
| inlineconstexpr |
size - Get the string size.
Definition at line150 of fileStringRef.h.
Referencesllvm::Length.
Referenced byllvm::AArch64FunctionInfo::AArch64FunctionInfo(),llvm::json::abbreviate(),llvm::Hexagon_MC::addArchSubtarget(),addSection(),llvm::msgpack::Document::addString(),llvm::BTFStringTable::addString(),angleBracketString(),llvm::objcopy::elf::OwnedDataSection::appendHexData(),llvm::DWARFTypePrinter< DieType >::appendTypeTagName(),argPlusPrefixesSize(),argPrefix(),llvm::CachedHashString::CachedHashString(),llvm::CachedHashStringRef::CachedHashStringRef(),callBufferedPrintfStart(),charTailAt(),llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(),checkArchVersion(),llvm::SITargetLowering::checkAsmConstraintVal(),checkDyldInfoCommand(),checkDysymtabCommand(),checkEncryptCommand(),checkLinkeditDataCommand(),checkNoteCommand(),checkSymtabCommand(),checkTwoLevelHintsCommand(),llvm::object::Archive::Child::Child(),compare_insensitive(),compare_numeric(),llvm::ComputeCrossModuleImport(),computeStringTable(),constructSegment(),constructSymbolEntry(),consume_back(),consume_back_insensitive(),consumeInteger(),llvm::consumeUnsignedInteger(),llvm::detail::IEEEFloat::convertFromString(),llvm::convertUTF8ToUTF16String(),llvm::coverage::BinaryCoverageReader::create(),llvm::StringMapEntry< ValueTy >::create(),llvm::sampleprof::SampleContext::createCtxVectorFromStr(),llvm::objcopy::coff::createGnuDebugLinkSectionContents(),llvm::jitlink::createLinkGraphFromELFObject(),llvm::MachO::createRegexFromGlob(),llvm::decodeBase64(),llvm::DWARFUnit::determineStringOffsetsTableContributionDWO(),llvm::DWARFListTableBase< DWARFListType >::dump(),dumpStringOffsetsSection(),llvm::object::Archive::ec_symbols(),edit_distance(),edit_distance_insensitive(),llvm::BitstreamWriter::emitBlob(),llvm::dwarf_linker::classic::DwarfStreamer::emitCIE(),llvm::DWARFYAML::emitDebugAbbrev(),llvm::DWARFYAML::emitDebugLine(),llvm::dwarf_linker::classic::DwarfStreamer::emitFDE(),llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::emitFDE(),llvm::MCObjectStreamer::emitFileDirective(),emitPPA1Name(),llvm::emitSourceFileHeader(),llvm::dwarf_linker::parallel::DWARFLinkerImpl::emitStringSections(),llvm::CodeViewContext::encodeDefRange(),llvm::DWARFExpression::end(),ends_with(),ends_with_insensitive(),expand(),ExpandBasePaths(),llvm::sys::path::extension(),find(),find_first_not_of(),find_first_of(),find_if(),find_last_not_of(),find_last_of(),FindCheckType(),FindFirstMatchingPrefix(),llvm::sys::unicode::findSyllable(),fixupIndexV4(),fixupIndexV5(),llvm::json::fixUTF8(),for(),formatPax(),llvm::ErrorDiagnostic::get(),llvm::DWARFUnit::getAddrOffsetSectionItem(),llvm::APInt::getBitsNeeded(),llvm::MemoryBufferRef::getBufferSize(),llvm::object::ELFFile< ELFT >::getBufSize(),llvm::sampleprof::FunctionSamples::getCanonicalFnName(),llvm::objcopy::elf::IHexRecord::getChecksum(),llvm::TargetLowering::getConstraintType(),llvm::SITargetLowering::getConstraintType(),llvm::ARMTargetLowering::getConstraintType(),llvm::AVRTargetLowering::getConstraintType(),llvm::BPFTargetLowering::getConstraintType(),llvm::HexagonTargetLowering::getConstraintType(),llvm::MSP430TargetLowering::getConstraintType(),llvm::NVPTXTargetLowering::getConstraintType(),llvm::PPCTargetLowering::getConstraintType(),llvm::RISCVTargetLowering::getConstraintType(),llvm::SparcTargetLowering::getConstraintType(),llvm::SystemZTargetLowering::getConstraintType(),llvm::VETargetLowering::getConstraintType(),llvm::X86TargetLowering::getConstraintType(),llvm::XtensaTargetLowering::getConstraintType(),llvm::M68kTargetLowering::getConstraintType(),llvm::LTOModule::getDependentLibrary(),llvm::MCContext::getELFSection(),llvm::AsmToken::getEndLoc(),llvm::NonRelocatableStringpool::getEntry(),getErrorForInvalidExt(),getExtensionVersion(),llvm::getFuncNameWithoutPrefix(),llvm::objcopy::elf::SRecord::getHeader(),llvm::HexagonInstrInfo::getInlineAsmLength(),llvm::ARMTargetLowering::getInlineAsmMemConstraint(),llvm::RISCVTargetLowering::getInlineAsmMemConstraint(),llvm::SystemZTargetLowering::getInlineAsmMemConstraint(),llvm::MDString::getLength(),getMemBufferCopyImpl(),llvm::opt::OptTable::Info::getName(),llvm::object::Elf_Sym_Impl< ELFT >::getName(),llvm::object::ArchiveMemberHeader::getName(),llvm::WritableMemoryBuffer::getNewUninitMemBuffer(),llvm::object::Archive::getNumberOfECSymbols(),llvm::getObjCNamesIfSelector(),getOptionPrefixesSize(),llvm::cl::generic_parser_base::getOptionWidth(),llvm::cl::basic_parser_impl::getOptionWidth(),llvm::OpenMPIRBuilder::getOrCreateSrcLocStr(),llvm::opt::ArgList::GetOrMakeJoinedArgString(),llvm::Triple::getOSVersion(),getQualifiedNameIndex(),llvm::object::BigArchiveMemberHeader::getRawName(),llvm::TargetLowering::getRegForInlineAsmConstraint(),llvm::SITargetLowering::getRegForInlineAsmConstraint(),llvm::ARMTargetLowering::getRegForInlineAsmConstraint(),llvm::AVRTargetLowering::getRegForInlineAsmConstraint(),llvm::BPFTargetLowering::getRegForInlineAsmConstraint(),llvm::HexagonTargetLowering::getRegForInlineAsmConstraint(),llvm::LanaiTargetLowering::getRegForInlineAsmConstraint(),llvm::M68kTargetLowering::getRegForInlineAsmConstraint(),llvm::MSP430TargetLowering::getRegForInlineAsmConstraint(),llvm::NVPTXTargetLowering::getRegForInlineAsmConstraint(),llvm::PPCTargetLowering::getRegForInlineAsmConstraint(),llvm::RISCVTargetLowering::getRegForInlineAsmConstraint(),llvm::SparcTargetLowering::getRegForInlineAsmConstraint(),llvm::SystemZTargetLowering::getRegForInlineAsmConstraint(),llvm::VETargetLowering::getRegForInlineAsmConstraint(),llvm::X86TargetLowering::getRegForInlineAsmConstraint(),llvm::XtensaTargetLowering::getRegForInlineAsmConstraint(),llvm::logicalview::getScopedName(),llvm::object::ELFFile< ELFT >::getSectionContentsAsArray(),llvm::object::ELFFile< ELFT >::getSectionName(),llvm::object::MachOObjectFile::getSectionSize(),llvm::object::ELFFile< ELFT >::getSegmentContents(),llvm::gsym::StringTable::getString(),llvm::DWARFUnit::getStringOffsetSectionItem(),llvm::AMDGPU::Exp::getTgtId(),getUnicodeEncoding(),getUUID(),getVarName(),llvm::object::ELFFile< ELFT >::getVersionDependencies(),llvm::CodeViewYAML::GlobalHash::GlobalHash(),gsiRecordCmp(),llvm::object::MachOObjectFile::guessLibraryShortName(),HandlePrefixedOrGroupedOption(),llvm::handleSection(),llvm::jitlink::identifyELFSectionStartAndEndSymbols(),llvm::jitlink::identifyMachOSectionStartAndEndSymbols(),llvm::object::DirectX::Signature::initialize(),llvm::codeview::DebugStringTableSubsection::insert(),isAsmComment(),isImmConstraint(),llvm::json::isUTF8(),LLVMGetDebugLocDirectory(),LLVMGetDebugLocFilename(),LLVMGetNamedMetadataName(),llvm::gsym::FunctionInfo::lookup(),lookupLLVMIntrinsicByName(),llvm::TargetLowering::LowerAsmOperandForConstraint(),llvm::ARMTargetLowering::LowerAsmOperandForConstraint(),llvm::AVRTargetLowering::LowerAsmOperandForConstraint(),llvm::LanaiTargetLowering::LowerAsmOperandForConstraint(),llvm::M68kTargetLowering::LowerAsmOperandForConstraint(),llvm::NVPTXTargetLowering::LowerAsmOperandForConstraint(),llvm::PPCTargetLowering::LowerAsmOperandForConstraint(),llvm::RISCVTargetLowering::LowerAsmOperandForConstraint(),llvm::SparcTargetLowering::LowerAsmOperandForConstraint(),llvm::SystemZTargetLowering::LowerAsmOperandForConstraint(),llvm::XtensaTargetLowering::LowerAsmOperandForConstraint(),llvm::InlineAsmLowering::lowerAsmOperandForConstraint(),llvm::object::MachOUniversalBinary::MachOUniversalBinary(),llvm::opt::DerivedArgList::MakeJoinedArg(),mapNameAndUniqueName(),PrefixMatcher::match(),llvm::Pattern::match(),maybeLexIndex(),maybeLexIndexAndName(),maybeLexIRBlock(),maybeLexIRValue(),maybeLexMCSymbol(),maybeLexSubRegisterIndex(),llvm::symbolize::MarkupParser::nextNode(),operator new(),llvm::jitlink::CompactUnwindSplitter::operator()(),llvm::DWARFExpression::iterator::operator++(),llvm::sys::path::const_iterator::operator++(),llvm::sys::path::reverse_iterator::operator++(),llvm::gsym::operator<<(),llvm::StringTable::operator[](),llvm::remarks::ParsedStringTable::operator[](),optimizeDoubleFP(),optimizeMemCmpVarSize(),llvm::DWARFDebugFrame::parse(),llvm::object::DirectX::PSVRuntimeInfo::parse(),llvm::parseAnalysisUtilityPasses(),llvm::RISCVISAInfo::parseArchString(),llvm::yaml::parseBool(),parseBraceExpansions(),llvm::RISCVISAInfo::parseFeatures(),parseHeader(),ParseLine(),parseMagic(),parseMaybeMangledName(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::Pattern::parsePattern(),parsePredicateRegAsConstraint(),parseRefinementStep(),parseRegisterNumber(),parseScalarValue(),parseSegmentLoadCommand(),parseStrTab(),parseStrTabSize(),llvm::MachO::parseSymbol(),parseThunkName(),parseVersion(),llvm::PGOCtxProfileWriter::PGOCtxProfileWriter(),printCFI(),PrintCFIEscape(),llvm::cl::Option::printEnumValHelpStr(),llvm::Pattern::printFuzzyMatch(),llvm::cl::generic_parser_base::printGenericOptionDiff(),printLine(),printNoMatch(),llvm::cl::generic_parser_base::printOptionInfo(),printSourceLine(),promoteToConstantPool(),llvm::irsymtab::readBitcode(),llvm::FileCheck::readCheckFile(),readCoverageMappingData(),llvm::coverage::RawCoverageReader::readSize(),llvm::coverage::RawCoverageReader::readULEB128(),llvm::InstrProfReaderItaniumRemapper< HashTableImpl >::reconstituteName(),llvm::LessRecordRegister::RecordParts::RecordParts(),llvm::sys::path::relative_path(),llvm::sys::path::remove_dots(),llvm::sys::path::replace_extension(),llvm::sys::path::replace_path_prefix(),llvm::RewriteBuffer::ReplaceText(),llvm::report_fatal_error(),llvm::logicalview::LVElement::resolveFullname(),rfind_insensitive(),llvm::RISCVMachineFunctionInfo::RISCVMachineFunctionInfo(),rsplit(),llvm::StringSaver::save(),llvm::orc::MachOBuilder< MachOTraits >::Section::Section(),llvm::object::ELFFile< ELFT >::sections(),llvm::orc::MachOBuilder< MachOTraits >::Segment::Segment(),llvm::orc::shared::SPSSerializationTraits< SPSString, StringRef >::serialize(),llvm::cl::Option::setArgStr(),singleLetterExtensionRank(),llvm::StringTable::size(),llvm::object::ViewArray< T >::size(),llvm::orc::shared::SPSSerializationTraits< SPSString, StringRef >::size(),llvm::DIEInlineString::sizeOf(),split(),splitLiteralAndReplacement(),starts_with_insensitive(),llvm::sys::unicode::startsWith(),llvm::sys::path::stem(),llvm::StringTable::StringTable(),llvm::Regex::sub(),llvm::BTFParser::symbolize(),llvm::StringAttributeImpl::totalSizeToAlloc(),llvm::codeview::TypeServer2Record::TypeServer2Record(),updateLoadCommandPayloadString(),updateSection(),upgradeLoopTag(),llvm::orc::ELFDebugObjectSection< ELFT >::validateInBounds(),llvm::DWARFVerifier::verifyDebugStrOffsets(),llvm::logicalview::LVLogicalVisitor::visitKnownMember(),llvm::object::WasmObjectFile::WasmObjectFile(),wordsOfString(),llvm::objcopy::wasm::Writer::write(),llvm::coverage::TestingFormatWriter::write(),llvm::msgpack::Writer::write(),llvm::writeStringsAndOffsets(), andllvm::yaml::yaml2archive().
| 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 exceeds the number of characters remaining in the string, the string suffix (starting withStart ) will be returned. If this is less thanStart , an empty string will be returned. |
Definition at line684 of fileStringRef.h.
Referencesdata,End, andllvm::size().
Referenced byllvm::FileCheckString::CheckDag(),llvm::dwarf_linker::parallel::CompileUnit::cloneDieAttrExpression(),llvm::object::ObjectFile::createMachOObjectFile(),llvm::BTFParser::findString(),llvm::objcopy::elf::SRecord::getHeader(),llvm::object::ArchiveMemberHeader::getName(),llvm::object::MachOObjectFile::guessLibraryShortName(),llvm::lookupBuiltin(),llvm::sys::path::const_iterator::operator++(),llvm::sys::path::reverse_iterator::operator++(),llvm::RISCVISAInfo::parseArchString(),llvm::SPIRV::parseBuiltinCallArgumentType(),llvm::SPIRV::parseBuiltinTypeStr(),llvm::RISCVISAInfo::parseNormalizedArchString(),parseRegisterNumber(),printSourceLine(),llvm::sandboxir::PassManager< ParentPass, ContainedPass >::setPassPipeline(),llvm::SmallString< InternalLen >::slice(),split(),splitLiteralAndReplacement(), andllvm::Regex::sub().
Split into two substrings around the first occurrence of a separator character.
IfSeparator
is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is maximal. IfSeparator
is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
Separator | The character to split on. |
Definition at line700 of fileStringRef.h.
Referenced byaddSection(),llvm::InlineAsm::collectAsmStrs(),collectMetadataInfo(),llvm::MachO::Target::create(),llvm::sampleprof::SampleContext::createCtxVectorFromStr(),llvm::sampleprof::SampleContext::decodeContextString(),llvm::FileCheckPatternContext::defineCmdlineVariables(),llvm::VPlanPrinter::dump(),llvm::AMDGPU::HSAMD::MetadataStreamerMsgPackV4::emitKernelArg(),findSection(),llvm::findVCToolChainViaEnvironment(),forceAttributes(),llvm::Triple::getArchName(),llvm::codeview::getBytesAsCString(),llvm::sampleprof::FunctionSamples::getCanonicalFnName(),llvm::object::COFFObjectFile::getDebugPDBInfo(),llvm::getDefaultDebuginfodUrls(),llvm::Triple::getEnvironmentName(),llvm::object::COFFImportFile::getExportName(),llvm::AArch64TTIImpl::getFeatureMask(),llvm::sys::detail::getHostCPUNameForARM(),llvm::sys::detail::getHostCPUNameForRISCV(),llvm::sys::detail::getHostCPUNameForS390x(),llvm::AMDGPU::getIntegerVecAttribute(),getIntOperandFromRegisterString(),getIntOperandsFromRegisterString(),getOpEnabled(),getOpRefinementSteps(),llvm::Triple::getOSAndEnvironmentName(),llvm::Triple::getOSName(),llvm::getParsedIRPGOName(),llvm::LoongArchTargetLowering::getRegisterByName(),getSearchPaths(),llvm::object::COFFObjectFile::getSectionName(),llvm::GCOVBuffer::getString(),llvm::VFABI::getVectorVariantNames(),llvm::Triple::getVendorName(),llvm::handleExecNameEncodedBEOpts(),llvm::handleExecNameEncodedOptimizerOpts(),llvm::isHeader(),llvm::offloading::amdgpu::isImageCompatibleWithEnv(),isThumbFunction(),llvm::object::Lexer::lex(),llvm::lookupBuiltin(),LookupNearestOption(),llvm::SPIRVExtensionsParser::parse(),llvm::PassBuilder::parseAAPipeline(),parseAMDGPUAttributorPassOptions(),llvm::SPIRV::parseBuiltinTypeStr(),parseCHRFilterFiles(),llvm::remarks::ParsedStringTable::ParsedStringTable(),parseNamePrefix(),llvm::PassBuilder::parseSinglePassOption(),parseThunkName(),llvm::cl::Option::printEnumValHelpStr(),llvm::cl::Option::printHelpStr(),printSymbolizedStackTrace(),llvm::DebugCounter::push_back(),llvm::readAndDecodeStrings(),llvm::GCOVBuffer::readString(),llvm::OpenMPIRBuilder::readThreadBoundsForKernel(),llvm::ForceFunctionAttrsPass::run(),llvm::Hexagon_MC::selectHexagonCPU(),llvm::AMDGPU::IsaInfo::AMDGPUTargetID::setTargetIDFromTargetIDStream(),llvm::SubtargetFeatures::Split(),llvm::Regex::sub(),llvm::opt::OptTable::suggestValueCompletions(), andllvm::Triple::Triple().
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 inA
. IfMaxSplit
is >= 0, at mostMaxSplit
splits are done and consequently <=MaxSplit
+ 1 elements are added to A. IfKeepEmpty
is false, empty strings are not added toA
. They still count when consideringMaxSplit
An useful invariant is that Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true
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 line341 of fileStringRef.cpp.
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 inA
. IfMaxSplit
is >= 0, at mostMaxSplit
splits are done and consequently <=MaxSplit
+ 1 elements are added to A. IfKeepEmpty
is false, empty strings are not added toA
. They still count when consideringMaxSplit
An useful invariant is that Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true
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 line314 of fileStringRef.cpp.
ReferencesA,empty(),find(),Idx,npos,size(),slice(), andsubstr().
Split into two substrings around the first occurrence of a separator string.
IfSeparator
is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is maximal. IfSeparator
is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
Separator | - The string to split on. |
Definition at line715 of fileStringRef.h.
Referencesllvm::find(),Idx,npos,size(), andsubstr().
Definition at line269 of fileStringRef.h.
Check if this string starts with the givenPrefix
.
Definition at line265 of fileStringRef.h.
Referencesdata, andllvm::size().
Referenced byllvm::DWARFTypePrinter< DieType >::appendTypeTagName(),llvm::object::Archive::Archive(),llvm::AsmLexer::AsmLexer(),llvm::ELFAttrs::attrTypeFromString(),llvm::objcopy::elf::Object::compressOrDecompressSections(),llvm::RISCVABI::computeTargetABI(),computeTargetABI(),llvm::object::Archive::create(),llvm::remarks::createYAMLParserFromMeta(),llvm::omp::deconstructOpenMPKernelName(),doesIgnoreDataTypeSuffix(),llvm::Attributor::emitRemark(),llvm::ARMTargetStreamer::emitTargetAttributes(),llvm::NVPTXTargetStreamer::emitValue(),llvm::ELFObjectWriter::executePostLayoutBinding(),llvm::opt::OptTable::findByPrefix(),FindCheckType(),llvm::JITSymbolFlags::fromGlobalValue(),llvm::generateGroupInst(),llvm::AArch64::getArchExtFeature(),llvm::getFuncNameWithoutPrefix(),llvm::GCOVFunction::getName(),llvm::object::getNameType(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),llvm::MCContext::getOrCreateSymbol(),llvm::opt::ArgList::GetOrMakeJoinedArgString(),llvm::Triple::getOSVersion(),getPointeeTypeByCallInst(),llvm::TargetLowering::getRegForInlineAsmConstraint(),llvm::SITargetLowering::getRegForInlineAsmConstraint(),llvm::SPIRVTargetLowering::getRegForInlineAsmConstraint(),llvm::SystemZTargetLowering::getRegForInlineAsmConstraint(),llvm::TargetLoweringObjectFileELF::getSectionForMachineBasicBlock(),llvm::yaml::Node::getVerbatimTag(),llvm::MVT::getVT(),hasAnyUnrollPragma(),llvm::memprof::YAMLMemProfReader::hasFormat(),llvm::HexagonSubtarget::initializeSubtargetDependencies(),llvm::RISCV::CPUInfo::is64Bit(),llvm::LTOModule::isBitcodeForTarget(),llvm::orc::isCOFFInitializerSection(),llvm::objcopy::coff::isDebugSection(),llvm::objcopy::wasm::isDebugSection(),isDebugSection(),llvm::MCSectionCOFF::isImplicitlyDiscardable(),llvm::objcopy::wasm::isLinkerSection(),llvm::MachO::isPrivateLibrary(),llvm::objcopy::macho::SymbolEntry::isSwiftSymbol(),llvm::SPIRV::lookupBuiltinNameHelper(),llvm::makeFollowupLoopID(),matchAsm(),matchOption(),llvm::Triple::normalize(),optimizeDoubleFP(),llvm::SpecialCaseList::parse(),llvm::parseAnalysisUtilityPasses(),parseArch(),llvm::ARM::parseArchEndian(),llvm::RISCVISAInfo::parseArchString(),parseARMArch(),llvm::SPIRV::parseBuiltinTypeNameToTargetExtType(),llvm::DebugCounter::parseChunks(),parseMaybeMangledName(),parseMetadata(),llvm::AArch64::ExtensionSet::parseModifier(),llvm::Pattern::parsePattern(),parsePredicateRegAsConstraint(),parseSubArch(),llvm::MachO::parseSymbol(),parseThunkName(),printSymbolizedStackTrace(),processGlobal(),llvm::RuntimeDyldCOFFAArch64::processRelocationRef(),llvm::RuntimeDyldCOFFI386::processRelocationRef(),llvm::RuntimeDyldCOFFThumb::processRelocationRef(),llvm::RuntimeDyldCOFFX86_64::processRelocationRef(),llvm::pruneCache(),llvm::TextCodeGenDataReader::read(),llvm::TextInstrProfReader::readHeader(),llvm::TextInstrProfReader::readNextRecord(),llvm::object::replace(),replaceAndRemoveSections(),llvm::ThunkInserter< Derived, InsertedThunksTy >::run(),llvm::runFuzzerOnInputs(),llvm::sampleprof::SampleContext::SampleContext(),llvm::pdb::NativeSession::searchForPdb(),llvm::HexagonTargetObjectFile::SelectSectionForGlobal(),llvm::cl::Option::setArgStr(),shouldCheckArgs(),llvm::SmallString< InternalLen >::starts_with(),llvm::orc::DLLImportDefinitionGenerator::tryToGenerate(),updateAndRemoveSymbols(), andupgradeLoopTag().
Check if this string starts with the givenPrefix
, ignoring case.
Definition at line46 of fileStringRef.cpp.
Referencesascii_strncasecmp(),data(), andsize().
Referenced bymatchOption().
| inline |
str - Get the contents as an std::string.
Definition at line229 of fileStringRef.h.
Referencesdata, andllvm::size().
Referenced byllvm::DwarfCompileUnit::addGlobalTypeImpl(),llvm::DwarfCompileUnit::addGlobalTypeUnitType(),llvm::vfs::InMemoryFileSystem::addHardLink(),llvm::DCData::addSuccessorLabel(),llvm::GlobalMergeFunc::analyze(),buildFrameDebugInfo(),llvm::cacheAnnotationFromMD(),checkOperandCount(),llvm::dwarf_linker::parallel::CompileUnit::CompileUnit(),constructSymbolEntry(),llvm::sys::path::convert_to_slash(),llvm::Hexagon_MC::createHexagonMCSubtargetInfo(),createMergedFunction(),llvm::logicalview::LVDWARFReader::createScopes(),llvm::MachO::Symbol::dump(),dumpSectionToFile(),llvm::objcopy::wasm::dumpSectionToFile(),llvm::emitAMDGPUPrintfCall(),llvm::AMDGPUAsmPrinter::emitFunctionEntryLabel(),llvm::CodeExtractor::extractCodeRegion(),llvm::MCJIT::finalizeLoadedModules(),llvm::object::MachOObjectFile::findDsymObjectMembers(),findSection(),llvm::generateSampleImageInst(),llvm::DiagnosticLocation::getAbsolutePath(),llvm::RecordKeeper::getAllDerivedDefinitions(),llvm::DWARFFormValue::getAsCString(),llvm::FieldInit::getAsString(),llvm::Attribute::getAsString(),llvm::bfi_detail::getBlockName(),llvm::pdb::NativeSourceFile::getChecksum(),getExtensionVersion(),llvm::DOTGraphTraits< DOTFuncInfo * >::getGraphName(),llvm::DOTGraphTraits< DOTFuncMSSAInfo * >::getGraphName(),llvm::DOTGraphTraits< DOTMachineFuncInfo * >::getGraphName(),getHighestNumericTupleInDirectory(),llvm::vfs::File::getName(),llvm::DOTGraphTraits< AttributorCallGraph * >::getNodeLabel(),llvm::SDNode::getOperationName(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),llvm::getPGOFuncName(),getQualifiedNameIndex(),llvm::pdb::DbiModuleDescriptor::getRecordLength(),llvm::pdb::PDBSymbolCompiland::getSourceFileName(),llvm::SystemZTargetMachine::getSubtargetImpl(),llvm::ARMBaseTargetMachine::getSubtargetImpl(),llvm::CSKYTargetMachine::getSubtargetImpl(),llvm::HexagonTargetMachine::getSubtargetImpl(),llvm::LoongArchTargetMachine::getSubtargetImpl(),llvm::M68kTargetMachine::getSubtargetImpl(),llvm::MipsTargetMachine::getSubtargetImpl(),llvm::PPCTargetMachine::getSubtargetImpl(),llvm::RISCVTargetMachine::getSubtargetImpl(),llvm::SparcTargetMachine::getSubtargetImpl(),llvm::WebAssemblyTargetMachine::getSubtargetImpl(),llvm::XtensaTargetMachine::getSubtargetImpl(),llvm::getSymbolicOperandMnemonic(),llvm::dwarf_linker::classic::CompileUnit::getSysRoot(),llvm::Record::getValueAsBitOrUnset(),llvm::objcopy::coff::handleArgs(),INITIALIZE_PASS(),llvm::M68kSubtarget::initializeSubtargetDependencies(),LiveDebugValues::MLocTracker::LocIdxToName(),llvm::lookupPGONameFromMetadata(),llvm::SPIRV::lowerBuiltinType(),llvm::XtensaTargetLowering::LowerCall(),mangleCoveragePath(),llvm::yaml::MappingTraits< const InterfaceFile * >::NormalizedTBD::NormalizedTBD(),llvm::vfs::RedirectingFileSystem::openFileForRead(),llvm::orc::LoadAndLinkDynLibrary::operator()(),llvm::objcopy::elf::OwnedDataSection::OwnedDataSection(),llvm::SPIRVExtensionsParser::parse(),llvm::cl::parser< std::string >::parse(),llvm::MachO::parseAliasList(),llvm::RISCVISAInfo::parseArchString(),parseBraceExpansions(),llvm::SPIRV::parseBuiltinCallArgumentType(),llvm::RISCVISAInfo::parseFeatures(),parseIRConstant(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::omp::prettifyFunctionName(),llvm::dxil::ResourceBase::print(),llvm::MCDecodedPseudoProbe::print(),llvm::dxil::ResourceBase::printKind(),printNoMatch(),processConstantStringArg(),processLoadCommands(),replaceWithCallToVeclib(),llvm::logicalview::LVScopeArray::resolveExtra(),llvm::PseudoProbeVerifier::runAfterPass(),runImpl(),llvm::IRSimilarity::IRInstructionData::setCalleeName(),llvm::MCContext::setCompilationDir(),llvm::setKCFIType(),llvm::vfs::YAMLVFSWriter::setOverlayDir(),llvm::vfs::RedirectingFileSystem::setOverlayFileDir(),setSocketAddr(),smallData(),llvm::SPIRVTranslate(),llvm::OutlinableRegion::splitCandidate(),llvm::Twine::str(),llvm::json::ObjectKey::str(),suffixed_name_or(),llvm::timeTraceProfilerWrite(),llvm::symbolize::toJSON(),llvm::AMDGPU::IsaInfo::AMDGPUTargetID::toString(),llvm::cgdata::warn(),writeListEntryAddress(), andwriteTimestampFile().
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 withStart ) will be returned. |
Definition at line571 of fileStringRef.h.
Referencesdata,N, andllvm::size().
Referenced byllvm::Hexagon_MC::addArchSubtarget(),llvm::DWARFTypePrinter< DieType >::appendTypeTagName(),llvm::object::applyNameType(),llvm::FileCheckString::Check(),llvm::FileCheckString::CheckDag(),llvm::FileCheck::checkInput(),llvm::dwarf_linker::parallel::DWARFLinkerImpl::LinkContext::cloneAndEmitDebugFrame(),CommaSeparateAndAddOccurrence(),llvm::consumeUnsignedInteger(),llvm::GlobPattern::create(),llvm::sampleprof::SampleContext::createCtxVectorFromStr(),llvm::FileCheckPatternContext::defineCmdlineVariables(),llvm::ELFYAML::dropUniqueSuffix(),emitComments(),llvm::AsmPrinter::emitPCSections(),emitPPA1Name(),llvm::RuntimeDyldCheckerExprEval::evaluate(),llvm::ELFObjectWriter::executePostLayoutBinding(),expand(),ExpandBasePaths(),llvm::sys::path::extension(),find_insensitive(),FindFirstMatchingPrefix(),llvm::MCJIT::findModuleForSymbol(),for(),llvm::format_provider< T, std::enable_if_t< support::detail::use_string_formatter< T >::value > >::format(),llvm::JITSymbolFlags::fromGlobalValue(),llvm::object::MachOUniversalBinary::ObjectForArch::getAsArchive(),llvm::object::MachOUniversalBinary::ObjectForArch::getAsIRObject(),llvm::object::MachOUniversalBinary::ObjectForArch::getAsObjectFile(),llvm::DataExtractor::getBytes(),llvm::sampleprof::FunctionSamples::getCanonicalFnName(),llvm::TargetLowering::getConstraintType(),llvm::object::COFFImportFile::getExportName(),getHexUint(),getLiteralSectionName(),getOpEnabled(),getOpRefinementSteps(),llvm::SPIRVGlobalRegistry::getOrCreateSPIRVTypeByName(),llvm::Triple::getOSVersion(),getQualifiedNameIndex(),llvm::gsym::StringTable::getString(),getStringIndex(),llvm::object::MachOObjectFile::getStringTableData(),llvm::AArch64::ArchInfo::getSubArch(),llvm::ARM::ArchNames::getSubArch(),getVarName(),llvm::yaml::Node::getVerbatimTag(),llvm::object::MachOObjectFile::guessLibraryShortName(),HandlePrefixedOrGroupedOption(),llvm::object::DirectX::Signature::initialize(),llvm::isSpecialPass(),llvm::object::Lexer::lex(),llvm::SPIRV::lookupBuiltinNameHelper(),PrefixMatcher::match(),matchAsm(),llvm::sys::path::const_iterator::operator++(),llvm::sys::path::reverse_iterator::operator++(),llvm::sys::path::parent_path(),llvm::SPIRVExtensionsParser::parse(),llvm::parseAnalysisUtilityPasses(),llvm::RISCVISAInfo::parseArchString(),llvm::yaml::Document::parseBlockNode(),parseBraceExpansions(),llvm::SPIRV::parseBuiltinCallArgumentType(),llvm::SPIRV::parseBuiltinTypeNameToTargetExtType(),llvm::dwarf_linker::parseDebugTableName(),ParseHead(),parseInt(),ParseLine(),parseMetadata(),llvm::RISCVISAInfo::parseNormalizedArchString(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),parsePredicateRegAsConstraint(),parseScalarValue(),llvm::Pattern::printFuzzyMatch(),llvm::coverage::RawCoverageFilenamesReader::read(),llvm::FileCheck::readCheckFile(),llvm::GCOVBuffer::readGCDAFormat(),llvm::GCOVBuffer::readGCNOFormat(),llvm::TextInstrProfReader::readHeader(),llvm::coverage::RawCoverageReader::readString(),llvm::coverage::RawCoverageReader::readULEB128(),llvm::sys::path::relative_path(),llvm::object::replace(),llvm::sys::path::replace_path_prefix(),rfind_insensitive(),llvm::sys::path::root_path(),llvm::DWARFDebugNames::NameTableEntry::sameNameAs(),split(),splitLiteralAndReplacement(),llvm::sys::path::stem(),llvm::stripDirPrefix(),llvm::SubtargetFeatures::StripFlag(),llvm::Regex::sub(),llvm::SmallString< InternalLen >::substr(),llvm::BTFParser::symbolize(),llvm::VersionTuple::tryParse(), andllvm::object::WasmObjectFile::WasmObjectFile().
| inline |
Return aStringRef equal to 'this' but with only the lastN
elements remaining.
IfN
is greater than the length of the string, the entire string is returned.
Definition at line589 of fileStringRef.h.
ReferencesN, andllvm::size().
Referenced byllvm::dwarf_linker::classic::DWARFLinker::link(), andllvm::dwarf_linker::parallel::DWARFLinkerImpl::printStatistic().
| inline |
Return aStringRef equal to 'this' but with only the firstN
elements remaining.
IfN
is greater than the length of the string, the entire string is returned.
Definition at line580 of fileStringRef.h.
ReferencesN, andllvm::size().
Referenced byllvm::json::abbreviate(),llvm::objcopy::elf::OwnedDataSection::appendHexData(),emitNullTerminatedSymbolName(),llvm::objcopy::elf::IHexRecord::getChecksum(),llvm::MCContext::getELFSection(),llvm::getObjCNamesIfSelector(),llvm::ThreadSafeTrieRawHashMapBase::getTriePrefixAsString(),llvm::TextCodeGenDataReader::hasFormat(),mapNameAndUniqueName(),llvm::Pattern::parseNumericSubstitutionBlock(),parseScalarValue(),llvm::sys::path::remove_dots(), andsplitLiteralAndReplacement().
| inline |
Return the longest prefix of 'this' such that no character in the prefix satisfies the given predicate.
Definition at line603 of fileStringRef.h.
ReferencesF,llvm::find_if(), andsubstr().
Referenced byllvm::DebugCounter::parseChunks().
| inline |
Return the longest prefix of 'this' such that every character in the prefix satisfies the given predicate.
Definition at line597 of fileStringRef.h.
ReferencesF,llvm::find_if_not(), andsubstr().
Referenced bysplitLiteralAndReplacement(), andllvm::VFABI::tryDemangleForVFABI().
Return string with consecutiveChar
characters starting from the left and right removed.
Definition at line815 of fileStringRef.h.
Referencesrtrim().
Referenced byllvm::MachO::TextAPIReader::canRead(),llvm::RuntimeDyldCheckerImpl::check(),llvm::logicalview::LVBinaryReader::createInstructions(),llvm::RuntimeDyldCheckerExprEval::evaluate(),llvm::DataExtractor::getFixedLengthString(),llvm::object::Lexer::lex(),llvm::MachO::parseAliasList(),parseMetadata(),llvm::Pattern::parseNumericSubstitutionBlock(),parseReplacementItem(), andllvm::TextCodeGenDataReader::read().
Return string with consecutive characters inChars
starting from the left and right removed.
Definition at line821 of fileStringRef.h.
Referencesrtrim().
std::string StringRef::upper | ( | ) | const |
Convert the given ASCII string to uppercase.
Definition at line118 of fileStringRef.cpp.
Referencesbegin(),end(), andllvm::map_iterator().
| staticconstexpr |
Definition at line53 of fileStringRef.h.
Referenced byllvm::X86FrameLowering::adjustForHiPEPrologue(),llvm::DWARFTypePrinter< DieType >::appendUnqualifiedNameBefore(),buildFixItLine(),llvm::FileCheckString::Check(),llvm::FileCheckString::CheckDag(),checkIfSupported(),llvm::FileCheck::checkInput(),CommaSeparateAndAddOccurrence(),count(),llvm::sys::fs::createTemporaryFile(),llvm::X86_MC::createX86MCSubtargetInfo(),llvm::omp::deconstructOpenMPKernelName(),llvm::FileCheckPatternContext::defineCmdlineVariables(),llvm::ELFYAML::dropUniqueSuffix(),llvm::object::Archive::ec_symbols(),llvm::ELFObjectWriter::executePostLayoutBinding(),ExpandBasePaths(),llvm::sys::path::extension(),find(),find_first_not_of(),find_first_of(),find_insensitive(),find_last_not_of(),find_last_of(),llvm::SourceMgr::FindLocForLineAndColumn(),llvm::format_provider< T, std::enable_if_t< support::detail::use_string_formatter< T >::value > >::format(),llvm::symbolize::SourceCode::format(),llvm::ARM::getCanonicalArchName(),llvm::sampleprof::FunctionSamples::getCanonicalFnName(),llvm::DataExtractor::getCStrRef(),llvm::sys::detail::getHostCPUNameForS390x(),getInstrStrFromOpNo(),llvm::SourceMgr::getLineAndColumn(),llvm::object::ArchiveMemberHeader::getName(),llvm::getObjCNamesIfSelector(),llvm::object::ArchiveMemberHeader::getRawName(),llvm::detail::getTypeNameImpl(),getTypeNamePrefix(),llvm::object::MachOObjectFile::guessLibraryShortName(),llvm::isArm64ECMangledFunctionName(),llvm::Regex::isLiteralERE(),llvm::isSpecialPass(),llvm::object::Lexer::lex(),locateCStrings(),lookupLLVMIntrinsicByName(),PrefixMatcher::match(),llvm::Pattern::match(),llvm::sys::path::reverse_iterator::operator++(),llvm::sys::path::parent_path(),llvm::SPIRV::parseBuiltinTypeStr(),ParseLine(),llvm::Pattern::parseNumericSubstitutionBlock(),llvm::Pattern::parsePattern(),parseRefinementStep(),parseScalarValue(),llvm::sys::printArg(),llvm::Pattern::printFuzzyMatch(),printSourceLine(),llvm::BinaryStreamReader::readCString(),llvm::sampleprof::SampleProfileReaderText::readImpl(),llvm::sys::path::remove_dots(),llvm::sys::path::remove_filename(),llvm::object::replace(),llvm::sys::path::replace_extension(),rfind_insensitive(),singleLetterExtensionRank(),split(),splitLiteralAndReplacement(),splitUstar(),llvm::sys::path::stem(),llvm::Regex::sub(),llvm::ifs::terminatedSubstr(), andllvm::UpgradeDataLayoutString().