|
LLVM
3.7.0
|
StringRef - Represent a constant reference to a string, i.e. More...
#include <StringRef.h>
Public Types | |
| typedef const char * | iterator |
| typedef const char * | const_iterator |
| typedef size_t | size_type |
Public Member Functions | |
Constructors | |
| StringRef () | |
| Construct an empty string ref. More... | |
| StringRef (const char *Str) | |
| Construct a string ref from a cstring. More... | |
| StringRef (const char *data, size_t length) | |
| Construct a string ref from a pointer and length. More... | |
| StringRef (const std::string &Str) | |
| Construct a string ref from an std::string. More... | |
Iterators | |
| iterator | begin () const |
| iterator | end () const |
| const unsigned char * | bytes_begin () const |
| const unsigned char * | bytes_end () const |
String Operations | |
| const char * | data () const |
| data - Get a pointer to the start of the string (which may not be null terminated). More... | |
| bool | empty () const |
| empty - Check if the string is empty. More... | |
| size_t | size () const |
| size - Get the string size. More... | |
| char | front () const |
| front - Get the first character in the string. More... | |
| char | back () const |
| back - Get the last character in the string. More... | |
| template<typename Allocator > | |
| StringRef | copy (Allocator &A) const |
| bool | equals (StringRef RHS) const |
| equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed. More... | |
| bool | equals_lower (StringRef RHS) const |
| equals_lower - Check for string equality, ignoring case. More... | |
| int | compare (StringRef RHS) const |
compare - Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less than, equal to, or greater than the RHS. More... | |
| int | compare_lower (StringRef RHS) const |
| compare_lower - Compare two strings, ignoring case. More... | |
| int | compare_numeric (StringRef RHS) const |
| compare_numeric - Compare two strings, treating sequences of digits as numbers. More... | |
| unsigned | edit_distance (StringRef Other, bool AllowReplacements=true, unsigned MaxEditDistance=0) const |
| Determine the edit distance between this string and another string. More... | |
| std::string | str () const |
| str - Get the contents as an std::string. More... | |
| std::string | lower () const |
| std::string | upper () const |
| Convert the given ASCII string to uppercase. More... | |
Operator Overloads | |
| char | operator[] (size_t Index) const |
Type Conversions | |
| operator std::string () const | |
String Predicates | |
| bool | startswith (StringRef Prefix) const |
Check if this string starts with the given Prefix. More... | |
| bool | startswith_lower (StringRef Prefix) const |
Check if this string starts with the given Prefix, ignoring case. More... | |
| bool | endswith (StringRef Suffix) const |
Check if this string ends with the given Suffix. More... | |
| bool | endswith_lower (StringRef Suffix) const |
Check if this string ends with the given Suffix, ignoring case. More... | |
String Searching | |
| size_t | find (char C, size_t From=0) const |
Search for the first character C in the string. More... | |
| size_t | find (StringRef Str, size_t From=0) const |
Search for the first string Str in the string. More... | |
| size_t | rfind (char C, size_t From=npos) const |
Search for the last character C in the string. More... | |
| size_t | rfind (StringRef Str) const |
Search for the last string Str in the string. More... | |
| size_t | find_first_of (char C, size_t From=0) const |
Find the first character in the string that is C, or npos if not found. More... | |
| size_t | find_first_of (StringRef Chars, size_t From=0) const |
Find the first character in the string that is in Chars, or npos if not found. More... | |
| size_t | find_first_not_of (char C, size_t From=0) const |
Find the first character in the string that is not C or npos if not found. More... | |
| size_t | find_first_not_of (StringRef Chars, size_t From=0) const |
Find the first character in the string that is not in the string Chars, or npos if not found. More... | |
| size_t | find_last_of (char C, size_t From=npos) const |
Find the last character in the string that is C, or npos if not found. More... | |
| size_t | find_last_of (StringRef Chars, size_t From=npos) const |
Find the last character in the string that is in C, or npos if not found. More... | |
| size_t | find_last_not_of (char C, size_t From=npos) const |
Find the last character in the string that is not C, or npos if not found. More... | |
| size_t | find_last_not_of (StringRef Chars, size_t From=npos) const |
Find the last character in the string that is not in Chars, or npos if not found. More... | |
Helpful Algorithms | |
| size_t | count (char C) const |
Return the number of occurrences of C in the string. More... | |
| size_t | count (StringRef Str) const |
Return the number of non-overlapped occurrences of Str in the string. More... | |
| template<typename T > | |
| std::enable_if < std::numeric_limits< T > ::is_signed, bool >::type | getAsInteger (unsigned Radix, T &Result) const |
| Parse the current string as an integer of the specified radix. More... | |
| template<typename T > | |
| std::enable_if <!std::numeric_limits< T > ::is_signed, bool >::type | getAsInteger (unsigned Radix, T &Result) const |
| bool | getAsInteger (unsigned Radix, APInt &Result) const |
Parse the current string as an integer of the specified Radix, or of an autosensed radix if the Radix given is 0. More... | |
Substring Operations | |
| StringRef | substr (size_t Start, size_t N=npos) const |
| Return a reference to the substring from [Start, Start + N). More... | |
| StringRef | drop_front (size_t N=1) const |
Return a StringRef equal to 'this' but with the first N elements dropped. More... | |
| StringRef | drop_back (size_t N=1) const |
Return a StringRef equal to 'this' but with the last N elements dropped. More... | |
| StringRef | slice (size_t Start, size_t End) const |
| Return a reference to the substring from [Start, End). More... | |
| std::pair< StringRef, StringRef > | split (char Separator) const |
| Split into two substrings around the first occurrence of a separator character. More... | |
| std::pair< StringRef, StringRef > | split (StringRef Separator) const |
| Split into two substrings around the first occurrence of a separator string. More... | |
| void | split (SmallVectorImpl< StringRef > &A, StringRef Separator, int MaxSplit=-1, bool KeepEmpty=true) const |
| Split into substrings around the occurrences of a separator string. More... | |
| std::pair< StringRef, StringRef > | rsplit (char Separator) const |
| Split into two substrings around the last occurrence of a separator character. More... | |
| StringRef | ltrim (StringRef Chars=" \t\n\v\f\r") const |
Return string with consecutive characters in Chars starting from the left removed. More... | |
| StringRef | rtrim (StringRef Chars=" \t\n\v\f\r") const |
Return string with consecutive characters in Chars starting from the right removed. More... | |
| StringRef | trim (StringRef Chars=" \t\n\v\f\r") const |
Return string with consecutive characters in Chars starting from the left and right removed. More... | |
Static Public Attributes | |
| static const 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 the StringRef. For this reason, it is not in general safe to store a StringRef.
Definition at line 40 of file StringRef.h.
| typedef const char* llvm::StringRef::const_iterator |
Definition at line 43 of file StringRef.h.
| typedef const char* llvm::StringRef::iterator |
Definition at line 42 of file StringRef.h.
| typedef size_t llvm::StringRef::size_type |
Definition at line 45 of file StringRef.h.
|
inline |
|
inline |
Construct a string ref from a cstring.
Definition at line 69 of file StringRef.h.
|
inline |
Construct a string ref from a pointer and length.
Definition at line 76 of file StringRef.h.
|
inline |
Construct a string ref from an std::string.
Definition at line 83 of file StringRef.h.
|
inline |
back - Get the last character in the string.
Definition at line 122 of file StringRef.h.
References empty().
Referenced by llvm::ConstantDataSequential::isCString(), llvm::yaml::needsQuotes(), and parsePhysicalReg().
|
inline |
Definition at line 90 of file StringRef.h.
Referenced by llvm::SmallString< 256 >::append(), llvm::sys::path::append(), llvm::SmallString< 256 >::assign(), llvm::MDString::begin(), llvm::yaml::BlockScalarNode::BlockScalarNode(), bytes_begin(), llvm::APFloat::convertFromString(), llvm::convertUTF8ToUTF16String(), llvm::ConvertUTF8toWide(), copy(), llvm::sys::fs::createTemporaryFile(), decodeUTF8(), llvm::MCObjectStreamer::EmitBytes(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::yaml::escape(), llvm::APInt::getBitsNeeded(), llvm::MemoryBufferRef::getBufferStart(), getHostID(), llvm::object::Archive::Symbol::getName(), llvm::object::Archive::getNumberOfSymbols(), llvm::StringToOffsetTable::GetOrAddStringOffset(), llvm::object::MachOObjectFile::getRelocationTypeName(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::COFFObjectFile::getRelocationTypeName(), llvm::ConstantDataArray::getString(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::yaml::ScalarNode::getValue(), llvm::hash_value(), llvm::Timer::init(), isAllZeros(), llvm::LLLexer::LLLexer(), llvm::MIToken::location(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::sys::fs::make_absolute(), mangleCoveragePath(), llvm::object::MachOUniversalBinary::ObjectForArch::ObjectForArch(), llvm::SmallString< 256 >::operator+=(), llvm::object::Archive::Child::operator<(), llvm::sys::path::const_iterator::operator==(), llvm::object::Archive::Child::operator==(), llvm::sys::path::reverse_iterator::operator==(), llvm::opt::OptTable::OptTable(), llvm::DWARFDebugLoc::parse(), llvm::DWARFDebugLocDWO::parse(), llvm::InlineAsm::ConstraintInfo::Parse(), llvm::InlineAsm::ParseConstraints(), parseDouble(), parsePhysicalReg(), prependCompressionHeader(), printName(), llvm::sys::path::replace_extension(), llvm::yaml::ScalarNode::ScalarNode(), llvm::AsmLexer::setBuffer(), llvm::EngineBuilder::setMArch(), llvm::EngineBuilder::setMCPU(), llvm::TimerGroup::setName(), SimplifyCondBranchToCondBranch(), llvm::Regex::sub(), llvm::object::Archive::symbol_begin(), llvm::TGLexer::TGLexer(), WriteAttributeGroupTable(), and WriteModuleMetadataStore().
Definition at line 94 of file StringRef.h.
References begin().
Referenced by llvm::MDString::bytes_begin(), and WriteModuleMetadata().
Definition at line 97 of file StringRef.h.
References end().
Referenced by llvm::MDString::bytes_end(), and WriteModuleMetadata().
compare - Compare two strings; the result is -1, 0, or 1 if this string is lexicographically less than, equal to, or greater than the RHS.
Definition at line 148 of file StringRef.h.
References fuzzer::min().
Referenced by llvm::SmallString< 256 >::compare(), llvm::operator<(), llvm::operator<=(), llvm::operator>(), llvm::operator>=(), order_by_name(), and SortSymbolPair().
compare_lower - Compare two strings, ignoring case.
compare_lower - Compare strings, ignoring case.
Definition at line 52 of file StringRef.cpp.
References ascii_strncasecmp(), and fuzzer::min().
Referenced by llvm::SmallString< 256 >::compare_lower(), and equals_lower().
compare_numeric - Compare two strings, treating sequences of digits as numbers.
compare_numeric - Compare strings, handle embedded numbers.
Definition at line 73 of file StringRef.cpp.
References ascii_isdigit(), I, and fuzzer::min().
Referenced by llvm::SmallString< 256 >::compare_numeric().
|
inline |
Definition at line 128 of file StringRef.h.
References begin(), end(), and StringRef().
Referenced by llvm::yaml::Document::parseBlockNode().
|
inline |
Return the number of occurrences of C in the string.
Definition at line 326 of file StringRef.h.
Referenced by llvm::SmallString< 256 >::count(), and llvm::InlineAsm::ConstraintInfo::Parse().
| size_t StringRef::count | ( | StringRef | Str | ) | const |
|
inline |
data - Get a pointer to the start of the string (which may not be null terminated).
Definition at line 107 of file StringRef.h.
Referenced by llvm::SourceMgr::AddIncludeFile(), llvm::FoldingSetNodeID::AddString(), llvm::StringSwitch< T, R >::Case(), llvm::sys::unicode::columnWidthUTF8(), compareWithScalarFnName(), compareWithVectorFnName(), llvm::zlib::compress(), llvm::ConvertUTF8toWide(), CopyStringRef(), llvm::zlib::crc32(), llvm::StringMapEntry< bool >::Create(), llvm::X86Operand::CreateToken(), llvm::dumpBlock(), edit_distance(), llvm::RuntimeDyldImpl::emitSection(), llvm::StringSwitch< T, R >::EndsWith(), llvm::cl::Option::error(), ExecGraphViewer(), llvm::DWARFFormValue::extractValue(), llvm::DataExtractor::getCStr(), llvm::AsmToken::getEndLoc(), llvm::DenseMapInfo< StringRef >::getHashValue(), llvm::object::MachOObjectFile::getIndirectName(), llvm::getInst(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::AsmToken::getLoc(), llvm::MemoryBuffer::getMemBufferCopy(), llvm::object::Elf_Sym_Impl< ELFT >::getName(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::RuntimeDyldMachO::getRelocationValueRef(), llvm::ConstantDataVector::getSplatValue(), llvm::ConstantDataArray::getString(), llvm::object::MachOObjectFile::getSymbolName(), llvm::DataExtractor::getU16(), llvm::DataExtractor::getU32(), llvm::DataExtractor::getU64(), llvm::DataExtractor::getU8(), llvm::sys::fs::identify_magic(), llvm::ExecutionEngine::InitializeMemory(), llvm::DenseMapInfo< StringRef >::isEqual(), LLVMGetAsString(), LLVMGetSectionContents(), LLVMGetSectionName(), LLVMGetStructName(), LLVMTargetMachineEmitToMemoryBuffer(), loadTestingFormat(), llvm::Regex::match(), llvm::sys::path::native(), llvm::raw_ostream::operator<<(), llvm::opt::OptTable::ParseOneArg(), llvm::RuntimeDyldELF::processRelocationRef(), ProvideOption(), readCoverageMappingData(), llvm::GCOVBuffer::readInt(), llvm::RawInstrProfReader< IntPtrT >::readNextRecord(), llvm::LessRecordRegister::RecordParts::RecordParts(), llvm::Regex::Regex(), replaceSubString(), llvm::report_fatal_error(), llvm::RuntimeDyldImpl::resolveExternalSymbols(), RewriteIntelBracExpression(), llvm::StringSaver::saveImpl(), llvm::yaml::Output::scalarString(), llvm::X86Operand::setTokenValue(), sortOpts(), split(), llvm::StringSwitch< T, R >::StartsWith(), llvm::zlib::uncompress(), and llvm::MD5::update().
|
inline |
Return a StringRef equal to 'this' but with the last N elements dropped.
Definition at line 419 of file StringRef.h.
References N, size(), and substr().
Referenced by llvm::ConstantDataSequential::isCString(), llvm::yaml::Document::parseBlockNode(), and rtrim().
|
inline |
Return a StringRef equal to 'this' but with the first N elements dropped.
Definition at line 412 of file StringRef.h.
References N, size(), and substr().
Referenced by getFuncNameWithoutPrefix(), llvm::yaml::isNumber(), llvm::yaml::isNumeric(), ltrim(), MatchCoprocessorOperandName(), and llvm::MIToken::stringValue().
| 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, returns MaxEditDistance+1. |
AllowReplacements is true) replacements needed to transform one of the given strings into the other. If zero, the strings are identical. Definition at line 104 of file StringRef.cpp.
References llvm::ComputeEditDistance(), data(), llvm::makeArrayRef(), and size().
Referenced by LookupNearestOption().
|
inline |
empty - Check if the string is empty.
Definition at line 110 of file StringRef.h.
Referenced by llvm::SubtargetFeatures::AddFeature(), llvm::ExecutionEngine::addGlobalMapping(), llvm::DwarfUnit::addLinkageName(), llvm::DwarfUnit::applySubprogramAttributes(), llvm::DwarfUnit::applySubprogramDefinitionAttributes(), llvm::DwarfCompileUnit::applyVariableAttributes(), llvm::APSInt::APSInt(), back(), CloneInstructionInExitBlock(), llvm::MipsABIInfo::computeTargetABI(), computeTargetABI(), llvm::ConstantFoldLoadFromConstPtr(), llvm::DwarfCompileUnit::constructImportedEntityDIE(), llvm::DwarfUnit::constructTypeDIE(), llvm::APFloat::convertFromString(), llvm::convertUTF8ToUTF16String(), CopyStringRef(), llvm::StructType::create(), llvm::sys::fs::create_directories(), createAArch64MCSubtargetInfo(), llvm::MDBuilder::createAnonymousAARoot(), llvm::ARM_MC::createARMMCSubtargetInfo(), llvm::DIBuilder::createBasicType(), llvm::DIBuilder::createClassType(), llvm::DIBuilder::createCompileUnit(), llvm::DIBuilder::createEnumerationType(), llvm::DIBuilder::createEnumerator(), llvm::DIBuilder::createForwardDecl(), llvm::DIBuilder::createReplaceableCompositeType(), llvm::createSanitizerCtorAndInitFunctions(), createSparcMCSubtargetInfo(), llvm::DIBuilder::createStructType(), llvm::sys::fs::createTemporaryFile(), llvm::DIBuilder::createUnionType(), llvm::DIBuilder::createUnspecifiedType(), llvm::X86_MC::createX86MCSubtargetInfo(), decodeBase64StringEntry(), llvm::DISubprogram::describes(), EatNumber(), emitComments(), emitDebugValueComment(), EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), llvm::TargetLoweringObjectFileMachO::emitModuleFlags(), llvm::cl::Option::error(), llvm::DWARFFormValue::extractValue(), FoldBlockIntoPredecessor(), front(), llvm::Attribute::get(), getARClassRegisterMask(), llvm::Triple::getARMCPUForArch(), getAsInteger(), llvm::getAsSignedInteger(), llvm::Attribute::getAsString(), llvm::getAsUnsignedInteger(), llvm::APInt::getBitsNeeded(), llvm::ARMTargetParser::getCanonicalArchName(), llvm::DINode::getCanonicalMDString(), getChompedLineBreaks(), llvm::MCContext::getCOFFSection(), llvm::DOTGraphTraits< const Function * >::getCompleteNodeLabel(), getELFKindForNamedSection(), llvm::MCContext::getELFSection(), llvm::SubtargetFeatures::getFeatureBits(), llvm::MCDwarfLineTableHeader::getFile(), getItineraryLatency(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::object::MachOObjectFile::getLibraryShortNameByIndex(), getMClassFlagsMask(), getMClassRegisterMask(), getMemcpyLoadsAndStores(), getMemsetStringVal(), getNameWithPrefixImpl(), llvm::DwarfUnit::getOrCreateModule(), llvm::DwarfUnit::getOrCreateNameSpace(), llvm::MCContext::getOrCreateSymbol(), llvm::DwarfUnit::getParentContextString(), llvm::GlobalValue::getRealLinkageName(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLibraryInfoImpl::getScalarizedFunction(), getSearchPaths(), llvm::DOTGraphTraits< const Function * >::getSimpleNodeLabel(), llvm::DataExtractor::getSLEB128(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), GetSymbolFromOperand(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::DataExtractor::getULEB128(), llvm::TargetLibraryInfoImpl::getVectorizedFunction(), llvm::yaml::Node::getVerbatimTag(), llvm::MachineModuleInfo::getWinEHParent(), 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(), hasFlag(), llvm::GlobalObject::hasSection(), llvm::GlobalValue::hasSection(), llvm::NVPTXSubtarget::initializeSubtargetDependencies(), llvm::MCSubtargetInfo::InitMCProcessorInfo(), llvm::StringSet< AllocatorTy >::insert(), isCanonical(), isEnabled(), llvm::TargetLibraryInfoImpl::isFunctionScalarizable(), llvm::TargetLibraryInfoImpl::isFunctionVectorizable(), isRepeatedByteSequence(), llvm::MCAsmInfo::isValidUnquotedName(), llvm::LineEditor::LineEditor(), llvm::LoadAndStorePromoter::LoadAndStorePromoter(), loadBinaryFormat(), LookupNearestOption(), matchAsm(), llvm::yaml::needsQuotes(), llvm::Triple::normalize(), parseARMArch(), llvm::ARM_MC::ParseARMTriple(), llvm::PassBuilder::parsePassPipeline(), llvm::MCSectionMachO::ParseSectionSpecifier(), parseSubArch(), parseVersionFromName(), llvm::MCInstPrinter::printAnnotation(), printExtendedName(), printFile(), PrintLLVMName(), printMetadataIdentifier(), llvm::AttributeImpl::Profile(), llvm::GCOVBuffer::readArcTag(), llvm::GCOVBuffer::readBlockTag(), llvm::GCOVBuffer::readEdgeTag(), llvm::GCOVBuffer::readFunctionTag(), llvm::GCOVBuffer::readLineTag(), llvm::TextInstrProfReader::readNextRecord(), llvm::GCOVBuffer::readObjectTag(), llvm::GCOVBuffer::readProgramTag(), llvm::LessRecordRegister::RecordParts::RecordParts(), sanitizeFunctionName(), llvm::yaml::Output::scalarString(), llvm::MIPS_MC::selectMipsCPU(), llvm::EngineBuilder::selectTarget(), setFunctionAttributes(), llvm::StructType::setName(), split(), StripTypeNames(), llvm::Regex::sub(), llvm::ExecutionEngine::updateGlobalMapping(), UsesVectorABI(), llvm::InlineAsm::Verify(), WriteAttributeGroupTable(), WriteTypeTable(), and llvm::yaml::yamlize().
|
inline |
Definition at line 92 of file StringRef.h.
Referenced by llvm::SmallString< 256 >::append(), llvm::sys::path::append(), llvm::SmallString< 256 >::assign(), llvm::yaml::BlockScalarNode::BlockScalarNode(), bytes_end(), llvm::convertUTF8ToUTF16String(), llvm::ConvertUTF8toWide(), copy(), decodeUTF8(), llvm::MCObjectStreamer::EmitBytes(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::MDString::end(), endswith(), endswith_lower(), llvm::yaml::escape(), llvm::MemoryBufferRef::getBufferEnd(), getHostID(), llvm::StringToOffsetTable::GetOrAddStringOffset(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::object::MachOObjectFile::getRelocationTypeName(), llvm::object::ELFFile< ELFT >::getRelocationTypeName(), llvm::object::COFFObjectFile::getRelocationTypeName(), llvm::ConstantDataArray::getString(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::yaml::ScalarNode::getValue(), llvm::hash_value(), llvm::Timer::init(), isAllZeros(), llvm::AsmLexer::LexUntilEndOfLine(), llvm::AsmLexer::LexUntilEndOfStatement(), llvm::sys::fs::make_absolute(), mangleCoveragePath(), llvm::SmallString< 256 >::operator+=(), llvm::opt::OptTable::OptTable(), llvm::DWARFDebugLoc::parse(), llvm::DWARFDebugLocDWO::parse(), llvm::InlineAsm::ConstraintInfo::Parse(), llvm::InlineAsm::ParseConstraints(), parseDouble(), parsePhysicalReg(), parseRegisterNumber(), prependCompressionHeader(), printName(), llvm::Regex::Regex(), llvm::sys::path::replace_extension(), llvm::yaml::ScalarNode::ScalarNode(), llvm::EngineBuilder::setMArch(), llvm::EngineBuilder::setMCPU(), llvm::TimerGroup::setName(), llvm::Regex::sub(), WriteAttributeGroupTable(), and WriteModuleMetadataStore().
Check if this string ends with the given Suffix.
Definition at line 224 of file StringRef.h.
References end().
Referenced by llvm::SmallString< 256 >::endswith(), llvm::StringTableBuilder::finalize(), llvm::ARMTargetParser::getCanonicalArchName(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::ARMTargetParser::parseArch(), llvm::ARMTargetParser::parseArchEndian(), and llvm::UpgradeIntrinsicCall().
Check if this string ends with the given Suffix, ignoring case.
Definition at line 67 of file StringRef.cpp.
References ascii_strncasecmp(), and end().
equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.
Definition at line 136 of file StringRef.h.
Referenced by count(), llvm::SmallString< 256 >::equals(), find(), llvm::GetUnrollMetadata(), llvm::yaml::isBool(), isGCLeafFunction(), isGCSafepointPoll(), llvm::yaml::isNull(), llvm::yaml::isNumber(), llvm::yaml::isNumeric(), llvm::operator==(), parseBPFArch(), parseSegmentLoadCommand(), and rfind().
equals_lower - Check for string equality, ignoring case.
Definition at line 142 of file StringRef.h.
References compare_lower().
Referenced by llvm::SmallString< 256 >::equals_lower(), llvm::PPCTargetLowering::getRegForInlineAsmConstraint(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), and llvm::StrInStrNoCase().
|
inline |
Search for the first character C in the string.
C, or npos if not found. Definition at line 240 of file StringRef.h.
References fuzzer::min(), npos, and P.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), CommaSeparateAndAddOccurrence(), emitComments(), llvm::RuntimeDyldCheckerExprEval::evaluate(), llvm::SmallString< 256 >::find(), find_first_of(), llvm::ARMTargetParser::getCanonicalArchName(), llvm::getConstantStringInfo(), llvm::DataExtractor::getCStr(), llvm::object::ArchiveMemberHeader::getName(), llvm::object::Archive::Child::getName(), getObjCClassCategory(), getObjCMethodName(), llvm::object::ELFFile< ELFT >::getSymbolVersion(), llvm::yaml::ScalarNode::getValue(), GlobalWasGeneratedByAsan(), llvm::object::MachOObjectFile::guessLibraryShortName(), hasObjCCategory(), llvm::ConstantDataSequential::isCString(), llvm::objcarc::IsObjCIdentifiedObject(), parseRefinementStep(), sanitizeFunctionName(), and split().
| size_t StringRef::find | ( | StringRef | Str, |
| size_t | From = 0 |
||
| ) | const |
Search for the first string Str in the string.
find - Search for the first string
Str, or npos if not found.Definition at line 142 of file StringRef.cpp.
References equals(), fuzzer::min(), N, npos, size(), and substr().
| StringRef::size_type StringRef::find_first_not_of | ( | char | C, |
| size_t | From = 0 |
||
| ) | const |
Find the first character in the string that is not C or npos if not found.
find_first_not_of - Find the first character in the string that is not
Definition at line 212 of file StringRef.cpp.
References fuzzer::min(), and npos.
Referenced by llvm::DWARFContextInMemory::DWARFContextInMemory(), llvm::SmallString< 256 >::find_first_not_of(), llvm::getToken(), llvm::yaml::isNumber(), ltrim(), matchAsm(), llvm::yaml::needsQuotes(), printName(), and llvm::Regex::sub().
| StringRef::size_type StringRef::find_first_not_of | ( | StringRef | Chars, |
| size_t | From = 0 |
||
| ) | const |
Find the first character in the string that is not in the string Chars, or npos if not found.
find_first_not_of - Find the first character in the string that is not in the string
Complexity: O(size() + Chars.size())
Note: O(size() + Chars.size())
Definition at line 223 of file StringRef.cpp.
References fuzzer::min(), npos, and size().
|
inline |
Find the first character in the string that is C, or npos if not found.
Same as find.
Definition at line 279 of file StringRef.h.
References find().
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), llvm::sys::fs::createTemporaryFile(), llvm::SmallString< 256 >::find_first_of(), llvm::getToken(), llvm::yaml::ScalarNode::getValue(), llvm::Regex::isLiteralERE(), and llvm::PassBuilder::parsePassPipeline().
| StringRef::size_type StringRef::find_first_of | ( | StringRef | Chars, |
| size_t | From = 0 |
||
| ) | const |
Find the first character in the string that is in Chars, or npos if not found.
find_first_of - Find the first character in the string that is in
Complexity: O(size() + Chars.size())
Note: O(size() + Chars.size())
Definition at line 198 of file StringRef.cpp.
References fuzzer::min(), npos, and size().
| StringRef::size_type StringRef::find_last_not_of | ( | char | C, |
| size_t | From = npos |
||
| ) | const |
Find the last character in the string that is not C, or npos if not found.
find_last_not_of - Find the last character in the string that is not
Definition at line 253 of file StringRef.cpp.
References fuzzer::min(), and npos.
Referenced by rtrim().
| StringRef::size_type StringRef::find_last_not_of | ( | StringRef | Chars, |
| size_t | From = npos |
||
| ) | const |
Find the last character in the string that is not in Chars, or npos if not found.
find_last_not_of - Find the last character in the string that is not in
Complexity: O(size() + Chars.size())
Note: O(size() + Chars.size())
Definition at line 264 of file StringRef.cpp.
References fuzzer::min(), npos, and size().
|
inline |
Find the last character in the string that is C, or npos if not found.
Definition at line 301 of file StringRef.h.
References rfind().
Referenced by llvm::sys::path::extension(), llvm::SmallString< 256 >::find_last_of(), llvm::SourceMgr::getLineAndColumn(), llvm::yaml::Node::getVerbatimTag(), llvm::sys::path::replace_extension(), and llvm::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 in C, or npos if not found.
find_last_of - Find the last character in the string that is in
Complexity: O(size() + Chars.size())
Note: O(size() + Chars.size())
Definition at line 239 of file StringRef.cpp.
References fuzzer::min(), npos, and size().
|
inline |
front - Get the first character in the string.
Definition at line 116 of file StringRef.h.
References empty().
Referenced by getAsInteger(), llvm::getAsSignedInteger(), llvm::yaml::isNumeric(), llvm::yaml::needsQuotes(), and parsePhysicalReg().
|
inline |
Parse the current string as an integer of the specified radix.
If Radix is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.
If the string is invalid or if only a subset of the string is valid, this returns true to signify the error. The string is considered erroneous if empty or if it overflows T.
Definition at line 347 of file StringRef.h.
References llvm::getAsSignedInteger().
Referenced by llvm::AMDGPUMachineFunction::AMDGPUMachineFunction(), llvm::object::Archive::Child::Child(), EmitGCCInlineAsmStr(), llvm::X86FrameLowering::emitPrologue(), getInt(), llvm::object::Archive::Child::getName(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), llvm::MCSectionMachO::ParseSectionSpecifier(), ReplaceWithStatepoint(), llvm::StackProtector::runOnFunction(), llvm::Regex::sub(), WindowsRequiresStackProbe(), and llvm::yaml::BinaryRef::writeAsBinary().
|
inline |
Definition at line 358 of file StringRef.h.
References llvm::getAsUnsignedInteger().
Parse the current string as an integer of the specified Radix, or of an autosensed radix if the Radix given is 0.
The current value in Result is discarded, and the storage is changed to be wide enough to store the parsed integer.
APInt::fromString is superficially similar but assumes the string is well-formed in the given radix.
Definition at line 406 of file StringRef.cpp.
References empty(), front(), GetAutoSenseRadix(), llvm::APInt::getBitWidth(), size(), substr(), and llvm::APInt::zext().
| std::string StringRef::lower | ( | ) | const |
Definition at line 117 of file StringRef.cpp.
References ascii_tolower(), and size().
Referenced by llvm::SubtargetFeatures::AddFeature(), llvm::MipsTargetAsmStreamer::emitDirectiveCpLoad(), llvm::MipsTargetAsmStreamer::emitDirectiveCpsetup(), llvm::MipsTargetAsmStreamer::emitFrame(), llvm::SparcTargetAsmStreamer::emitSparcRegisterIgnore(), llvm::SparcTargetAsmStreamer::emitSparcRegisterScratch(), llvm::AArch64NamedImmMapper::fromString(), llvm::AArch64SysReg::SysRegMapper::fromString(), getBankedRegisterMask(), getMClassRegisterSYSmValueMask(), llvm::MipsAsmPrinter::printOperand(), llvm::SparcInstPrinter::printRegName(), llvm::XCoreInstPrinter::printRegName(), and llvm::MipsInstPrinter::printRegName().
Return string with consecutive characters in Chars starting from the left removed.
Definition at line 511 of file StringRef.h.
References drop_front(), find_first_not_of(), and fuzzer::min().
Referenced by llvm::RuntimeDyldCheckerExprEval::evaluate(), llvm::opt::OptTable::ParseOneArg(), and trim().
|
inline |
Definition at line 206 of file StringRef.h.
References str().
|
inline |
Definition at line 197 of file StringRef.h.
|
inline |
Search for the last character C in the string.
C, or npos if not found. Definition at line 260 of file StringRef.h.
References fuzzer::min(), and npos.
Referenced by find_last_of(), llvm::object::MachOObjectFile::guessLibraryShortName(), llvm::SmallString< 256 >::rfind(), and rsplit().
| size_t StringRef::rfind | ( | StringRef | Str | ) | const |
Search for the last string Str in the string.
rfind - Search for the last string
Str, or npos if not found.Definition at line 182 of file StringRef.cpp.
Split into two substrings around the last occurrence of a separator character.
If Separator is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is minimal. If Separator is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
| Separator | - The character to split on. |
Definition at line 502 of file StringRef.h.
References npos, rfind(), slice(), and StringRef().
Referenced by llvm::HexagonAsmInstPrinter::printInst().
Return string with consecutive characters in Chars starting from the right removed.
Definition at line 517 of file StringRef.h.
References drop_back(), find_last_not_of(), and fuzzer::min().
Referenced by llvm::object::Archive::Child::Child(), llvm::RuntimeDyldCheckerExprEval::evaluate(), llvm::object::Archive::Child::getName(), llvm::object::ArchiveMemberHeader::getRawLastModified(), and trim().
|
inline |
size - Get the string size.
Definition at line 113 of file StringRef.h.
Referenced by llvm::FoldingSetNodeID::AddString(), llvm::APSInt::APSInt(), llvm::StringSwitch< T, R >::Case(), llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(), llvm::sys::locale::columnWidth(), llvm::sys::unicode::columnWidthUTF8(), compareBySuffix(), compareWithScalarFnName(), compareWithVectorFnName(), llvm::zlib::compress(), llvm::ConstantFoldLoadFromConstPtr(), llvm::APFloat::convertFromString(), llvm::convertUTF8ToUTF16String(), llvm::ConvertUTF8toWide(), CopyStringRef(), count(), llvm::zlib::crc32(), llvm::StringMapEntry< bool >::Create(), llvm::X86Operand::CreateToken(), decodeBase64StringEntry(), drop_back(), drop_front(), dumpPubSection(), edit_distance(), llvm::object::elf_hash(), llvm::object::ELFFile< ELFT >::ELFFile(), llvm::AMDGPUTargetELFStreamer::EmitDirectiveHSACodeObjectISA(), llvm::emitSourceFileHeader(), llvm::sys::path::end(), llvm::StringSwitch< T, R >::EndsWith(), llvm::Regex::escape(), llvm::sys::path::extension(), find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), llvm::DWARFUnit::getAddrOffsetSectionItem(), llvm::ConstantDataSequential::getAsCString(), getAsInteger(), llvm::APInt::getBitsNeeded(), llvm::MemoryBufferRef::getBufferSize(), llvm::ARMTargetParser::getCanonicalArchName(), llvm::SparcTargetLowering::getConstraintType(), llvm::MSP430TargetLowering::getConstraintType(), llvm::ARMTargetLowering::getConstraintType(), llvm::SystemZTargetLowering::getConstraintType(), llvm::NVPTXTargetLowering::getConstraintType(), llvm::PPCTargetLowering::getConstraintType(), llvm::X86TargetLowering::getConstraintType(), llvm::TargetLowering::getConstraintType(), llvm::object::getElfArchType(), llvm::AsmToken::getEndLoc(), llvm::DwarfStringPool::getEntry(), llvm::Triple::getEnvironmentVersion(), getFuncNameWithoutPrefix(), llvm::object::MachOObjectFile::getIndirectName(), llvm::ARMTargetLowering::getInlineAsmMemConstraint(), llvm::SystemZTargetLowering::getInlineAsmMemConstraint(), GetLazyPtr(), llvm::MDString::getLength(), llvm::TargetLibraryInfoImpl::getLibFunc(), llvm::object::MachOObjectFile::getLibraryShortNameByIndex(), llvm::MemoryBuffer::getMemBufferCopy(), getMemsetStringVal(), llvm::object::Archive::Child::getName(), llvm::object::Elf_Sym_Impl< ELFT >::getName(), llvm::MemoryBuffer::getNewUninitMemBuffer(), getOptionPred(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::Triple::getOSVersion(), llvm::SparcTargetLowering::getRegForInlineAsmConstraint(), llvm::MSP430TargetLowering::getRegForInlineAsmConstraint(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), llvm::HexagonTargetLowering::getRegForInlineAsmConstraint(), llvm::ARMTargetLowering::getRegForInlineAsmConstraint(), llvm::SystemZTargetLowering::getRegForInlineAsmConstraint(), llvm::NVPTXTargetLowering::getRegForInlineAsmConstraint(), llvm::PPCTargetLowering::getRegForInlineAsmConstraint(), llvm::X86TargetLowering::getRegForInlineAsmConstraint(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::ConstantDataArray::getString(), llvm::AsmToken::getStringContents(), GetStringLengthH(), llvm::DWARFUnit::getStringOffsetSectionItem(), llvm::object::ELFFile< ELFT >::getSymbolVersion(), getUnicodeEncoding(), llvm::yaml::ScalarNode::getValue(), llvm::object::MachOObjectFile::guessLibraryShortName(), HandlePrefixedOrGroupedOption(), llvm::HashString(), llvm::sys::fs::identify_magic(), llvm::ExecutionEngine::InitializeMemory(), llvm::NVPTXSubtarget::initializeSubtargetDependencies(), isRepeatedByteSequence(), llvm::DataExtractor::isValidOffset(), llvm::join_impl(), LLVMGetAsString(), LLVMTargetMachineEmitToMemoryBuffer(), loadTestingFormat(), lower(), llvm::object::MachOUniversalBinary::MachOUniversalBinary(), llvm::MCGenDwarfLabelEntry::Make(), llvm::opt::DerivedArgList::MakeJoinedArg(), llvm::Regex::match(), MatchCoprocessorOperandName(), matchOption(), maybeLexMachineBasicBlock(), llvm::object::MachOUniversalBinary::ObjectForArch::ObjectForArch(), operator new(), llvm::raw_ostream::operator<<(), llvm::DWARFDebugLocDWO::parse(), parseBackslash(), parseRefinementStep(), parseRegisterNumber(), parseSectionFlags(), llvm::MCSectionMachO::ParseSectionSpecifier(), prependCompressionHeader(), printBSDMemberHeader(), PrintEscapedString(), PrintHelpOptionList(), printLine(), PrintLLVMName(), printMemberHeader(), printMetadataIdentifier(), PrintQuotedString(), printSourceLine(), llvm::sys::path::rbegin(), readCoverageMappingData(), llvm::GCOVBuffer::readInt(), llvm::RawInstrProfReader< IntPtrT >::readNextRecord(), llvm::sampleprof::SampleProfileReaderBinary::readString(), llvm::GCOVBuffer::readString(), llvm::LessRecordRegister::RecordParts::RecordParts(), llvm::sys::path::relative_path(), llvm::sys::path::replace_extension(), replaceSubString(), llvm::report_fatal_error(), RequiresVFPRegListValidation(), llvm::RuntimeDyldImpl::resolveExternalSymbols(), RewriteIntelBracExpression(), rfind(), llvm::StringSaver::saveImpl(), llvm::yaml::Output::scalarString(), llvm::StructType::setName(), llvm::X86Operand::setTokenValue(), split(), llvm::StringSwitch< T, R >::StartsWith(), llvm::sys::path::stem(), llvm::StrInStrNoCase(), llvm::Regex::sub(), llvm::cl::TokenizeGNUCommandLine(), llvm::cl::TokenizeWindowsCommandLine(), llvm::zlib::uncompress(), llvm::MD5::update(), UpgradeIntrinsicFunction1(), upper(), llvm::raw_ostream::write_escaped(), llvm::MCObjectWriter::writeBytes(), llvm::MachObjectWriter::writeObject(), WriteStringRecord(), writeStringTable(), and writeSymbolTable().
|
inline |
Return a reference to the substring from [Start, End).
| Start | The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned. |
| End | The index following the last character to include in the substring. If this is npos, or less than Start, or exceeds the number of characters remaining in the string, the string suffix (starting with Start) will be returned. |
Definition at line 434 of file StringRef.h.
References fuzzer::min(), and StringRef().
Referenced by llvm::object::ObjectFile::createMachOObjectFile(), getObjCClassCategory(), getObjCMethodName(), llvm::AsmToken::getStringContents(), llvm::getToken(), llvm::object::MachOObjectFile::guessLibraryShortName(), parseRegisterNumber(), llvm::GCOVBuffer::readArcTag(), llvm::GCOVBuffer::readBlockTag(), llvm::GCOVBuffer::readEdgeTag(), llvm::GCOVBuffer::readFunctionTag(), llvm::GCOVBuffer::readGCDAFormat(), llvm::GCOVBuffer::readGCNOFormat(), llvm::GCOVBuffer::readGCOVVersion(), llvm::GCOVBuffer::readInt(), llvm::GCOVBuffer::readLineTag(), llvm::GCOVBuffer::readObjectTag(), llvm::GCOVBuffer::readProgramTag(), llvm::GCOVBuffer::readString(), rsplit(), llvm::SmallString< 256 >::slice(), split(), and llvm::Regex::sub().
Split into two substrings around the first occurrence of a separator character.
If Separator is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is maximal. If Separator is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
| Separator | The character to split on. |
Definition at line 450 of file StringRef.h.
References find(), npos, slice(), and StringRef().
Referenced by llvm::Triple::getArchName(), llvm::Triple::getEnvironmentName(), getIntOperandFromRegisterString(), getIntOperandsFromRegisterString(), llvm::Triple::getOSAndEnvironmentName(), llvm::Triple::getOSName(), getSearchPaths(), llvm::Triple::getVendorName(), LookupNearestOption(), llvm::Triple::normalize(), llvm::MCSectionMachO::ParseSectionSpecifier(), printHelpStr(), llvm::HexagonAsmInstPrinter::printInst(), llvm::GCOVBuffer::readString(), Split(), split(), split(), llvm::Regex::sub(), and UsesVectorABI().
Split into two substrings around the first occurrence of a separator string.
If Separator is in the string, then the result is a pair (LHS, RHS) such that (*this == LHS + Separator + RHS) is true and RHS is maximal. If Separator is not in the string, then the result is a pair (LHS, RHS) where (*this == LHS) and (RHS == "").
| Separator | - The string to split on. |
Definition at line 467 of file StringRef.h.
References find(), npos, size(), slice(), and StringRef().
| void StringRef::split | ( | SmallVectorImpl< StringRef > & | A, |
| StringRef | Separator, | ||
| int | MaxSplit = -1, |
||
| bool | KeepEmpty = true |
||
| ) | const |
Split into substrings around the occurrences of a separator string.
Each substring is stored in A. If MaxSplit is >= 0, at most MaxSplit splits are done and consequently <= MaxSplit elements are added to A. If KeepEmpty is false, empty strings are not added to A. They still count when considering MaxSplit An useful invariant is that Separator.join(A) == *this if MaxSplit == -1 and KeepEmpty == true
| A | - Where to put the substrings. |
| Separator | - The string to split on. |
| MaxSplit | - The maximum number of times the string is split. |
| KeepEmpty | - True if empty substring should be added. |
Definition at line 276 of file StringRef.cpp.
References data(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), size(), and split().
Check if this string starts with the given Prefix.
Definition at line 215 of file StringRef.h.
Referenced by llvm::object::Archive::Archive(), llvm::ARMBuildAttrs::AttrTypeFromString(), llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(), llvm::object::Archive::Child::Child(), CloneLoopBlocks(), llvm::MipsABIInfo::computeTargetABI(), computeTargetABI(), consumeCompressedDebugSectionHeader(), doesIgnoreDataTypeSuffix(), llvm::DWARFContextInMemory::DWARFContextInMemory(), GetAutoSenseRadix(), llvm::ARMTargetParser::getCanonicalArchName(), getELFKindForNamedSection(), llvm::Triple::getEnvironmentVersion(), llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), getFuncNameWithoutPrefix(), getName(), llvm::object::Archive::Child::getName(), llvm::Mangler::getNameWithPrefix(), llvm::opt::ArgList::GetOrMakeJoinedArgString(), llvm::Triple::getOSVersion(), llvm::object::IRObjectFile::getSymbolFlags(), llvm::object::ELFObjectFile< ELFT >::getSymbolFlags(), llvm::WinEH::getUnwindInfoSection(), llvm::yaml::Node::getVerbatimTag(), llvm::object::MachOObjectFile::guessLibraryShortName(), INITIALIZE_PASS(), llvm::LTOModule::isBitcodeForTarget(), isInput(), llvm::Function::isIntrinsic(), llvm::yaml::isNumber(), isObjCClass(), llvm::objcarc::IsObjCIdentifiedObject(), llvm::MCGenDwarfLabelEntry::Make(), matchAsm(), matchOption(), llvm::orc::GlobalRenamer::needsRenaming(), llvm::Triple::normalize(), llvm::ARMTargetParser::parseArchEndian(), parseARMArch(), parseVersionFromName(), llvm::TextInstrProfReader::readNextRecord(), RequiresVFPRegListValidation(), SetLoopAlreadyUnrolled(), llvm::SmallString< 256 >::startswith(), llvm::StripDebugInfo(), StripSymtab(), StripTypeNames(), llvm::UpgradeIntrinsicCall(), and UpgradeIntrinsicFunction1().
Check if this string starts with the given Prefix, ignoring case.
Definition at line 61 of file StringRef.cpp.
References ascii_strncasecmp().
Referenced by matchOption().
|
inline |
str - Get the contents as an std::string.
Definition at line 188 of file StringRef.h.
Referenced by llvm::DwarfCompileUnit::addGlobalName(), llvm::DwarfCompileUnit::addGlobalType(), cacheAnnotationFromMD(), findInputFile(), llvm::bfi_detail::getBlockName(), llvm::DOTGraphTraits< const Function * >::getGraphName(), llvm::DOTGraphTraits< MachineBlockFrequencyInfo * >::getNodeLabel(), llvm::DOTGraphTraits< const Function * >::getSimpleNodeLabel(), llvm::AArch64TargetMachine::getSubtargetImpl(), llvm::WebAssemblyTargetMachine::getSubtargetImpl(), llvm::X86TargetMachine::getSubtargetImpl(), llvm::PPCTargetMachine::getSubtargetImpl(), llvm::ARMBaseTargetMachine::getSubtargetImpl(), llvm::MipsTargetMachine::getSubtargetImpl(), llvm::Record::getValueAsBitOrUnset(), llvm::yaml::ScalarTraits< StringValue >::input(), llvm::LineEditor::LineEditor(), mangleCoveragePath(), operator std::string(), llvm::cl::parser< std::string >::parse(), llvm::sys::fs::directory_entry::replace_filename(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::runOnFunction(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::runOnFunction(), llvm::MCContext::setCompilationDir(), llvm::MCParsedAsmOperand::setConstraint(), and llvm::Twine::str().
Return a reference to the substring from [Start, Start + N).
| Start | The index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned. |
| N | The number of characters to included in the substring. If N exceeds the number of characters remaining in the string, the string suffix (starting with Start) will be returned. |
Definition at line 405 of file StringRef.h.
References fuzzer::min(), N, and StringRef().
Referenced by llvm::RuntimeDyldCheckerImpl::checkAllRulesInBuffer(), llvm::object::Archive::Child::Child(), CommaSeparateAndAddOccurrence(), consumeCompressedDebugSectionHeader(), count(), decodeBase64StringEntry(), drop_back(), drop_front(), llvm::DWARFContextInMemory::DWARFContextInMemory(), EatNumber(), emitComments(), llvm::emitSourceFileHeader(), llvm::RuntimeDyldCheckerExprEval::evaluate(), llvm::sys::path::extension(), llvm::DWARFFormValue::extractValue(), find(), llvm::object::MachOUniversalBinary::ObjectForArch::getAsArchive(), llvm::ConstantDataSequential::getAsCString(), getAsInteger(), llvm::object::MachOUniversalBinary::ObjectForArch::getAsObjectFile(), llvm::getAsSignedInteger(), llvm::getAsUnsignedInteger(), GetAutoSenseRadix(), llvm::ARMTargetParser::getCanonicalArchName(), llvm::getConstantStringInfo(), llvm::TargetLowering::getConstraintType(), llvm::Triple::getEnvironmentVersion(), GetLazyPtr(), getMemcpyLoadsAndStores(), getName(), llvm::object::Archive::Child::getName(), getNameWithPrefixImpl(), getOptionPred(), llvm::Triple::getOSVersion(), llvm::GlobalValue::getRealLinkageName(), llvm::SITargetLowering::getRegForInlineAsmConstraint(), llvm::object::MachOObjectFile::getSectionContents(), llvm::object::MachOObjectFile::getStringTableData(), GetSymbolFromOperand(), llvm::object::ELFFile< ELFT >::getSymbolVersion(), llvm::getToken(), llvm::WinEH::getUnwindInfoSection(), llvm::yaml::ScalarNode::getValue(), llvm::yaml::Node::getVerbatimTag(), HandlePrefixedOrGroupedOption(), loadTestingFormat(), llvm::MCGenDwarfLabelEntry::Make(), matchAsm(), matchOption(), llvm::sys::path::parent_path(), llvm::DWARFDebugLoc::parse(), llvm::DWARFDebugLocDWO::parse(), llvm::yaml::Document::parseBlockNode(), llvm::PassBuilder::parsePassPipeline(), parseRefinementStep(), parseVersionFromName(), llvm::sys::path::relative_path(), llvm::sys::path::rend(), RequiresVFPRegListValidation(), rfind(), llvm::sys::path::root_path(), llvm::sys::path::stem(), llvm::StrInStrNoCase(), StripFlag(), llvm::Regex::sub(), llvm::SmallString< 256 >::substr(), llvm::UpgradeIntrinsicCall(), and UpgradeIntrinsicFunction1().
Return string with consecutive characters in Chars starting from the left and right removed.
Definition at line 523 of file StringRef.h.
References ltrim(), and rtrim().
Referenced by llvm::RuntimeDyldCheckerImpl::check(), and llvm::RuntimeDyldCheckerExprEval::evaluate().
| std::string StringRef::upper | ( | ) | const |
Convert the given ASCII string to uppercase.
Definition at line 125 of file StringRef.cpp.
References ascii_toupper(), and size().
Referenced by llvm::AArch64InstPrinter::printMRSSystemRegister(), llvm::AArch64InstPrinter::printMSRSystemRegister(), and llvm::AArch64InstPrinter::printSystemPStateField().
|
static |
Definition at line 44 of file StringRef.h.
Referenced by llvm::X86FrameLowering::adjustForHiPEPrologue(), buildFixItLine(), CommaSeparateAndAddOccurrence(), llvm::sys::fs::createTemporaryFile(), llvm::sys::path::extension(), find(), find_first_not_of(), find_first_of(), find_last_not_of(), find_last_of(), llvm::ARMTargetParser::getCanonicalArchName(), llvm::DataExtractor::getCStr(), llvm::SourceMgr::getLineAndColumn(), llvm::object::ArchiveMemberHeader::getName(), llvm::object::ELFFile< ELFT >::getSymbolVersion(), llvm::yaml::ScalarNode::getValue(), llvm::object::MachOObjectFile::guessLibraryShortName(), hasObjCCategory(), llvm::ConstantDataSequential::isCString(), llvm::Regex::isLiteralERE(), llvm::yaml::isNumber(), llvm::objcarc::IsObjCIdentifiedObject(), llvm::yaml::needsQuotes(), llvm::sys::path::parent_path(), parseRefinementStep(), printName(), llvm::AArch64InstPrinter::printSysAlias(), llvm::sys::path::remove_filename(), llvm::sys::path::replace_extension(), rfind(), rsplit(), sanitizeFunctionName(), split(), llvm::sys::path::stem(), and llvm::StrInStrNoCase().
1.8.6