• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-13-stable/contrib/llvm-project/llvm/lib/Support/

Lines Matching refs:StringRef

29 StringRef ExpressionFormat::toString() const {
32 return StringRef("<none>");
34 return StringRef("%u");
36 return StringRef("%d");
38 return StringRef("%X");
40 return StringRef("%x");
45 Expected<StringRef> ExpressionFormat::getWildcardRegex() const {
48 return StringRef("[0-9]+");
50 return StringRef("-?[0-9]+");
52 return StringRef("[0-9A-F]+");
54 return StringRef("[0-9a-f]+");
87 ExpressionFormat::valueFromStringRepr(StringRef StrVal,
90 StringRef OverflowErrorStr = "unable to represent numeric value";
379 Expected<StringRef> VarVal = Context->getPatternVarValue(FromStr);
388 Pattern::parseVariable(StringRef &Str, const SourceMgr &SM) {
407 StringRef Name = Str.take_front(I);
412 // StringRef holding all characters considered as horizontal whitespaces by
417 static char popFront(StringRef &S) {
429 StringRef &Expr, FileCheckPatternContext *Context,
435 StringRef Name = ParseVarResult->Name;
468 StringRef Name, bool IsPseudo, Optional<size_t> LineNumber,
503 StringRef &Expr, AllowedOperand AO, bool MaybeInvalidConstraint,
542 StringRef SaveExpr = Expr;
561 Pattern::parseParenExpr(StringRef &Expr, Optional<size_t> LineNumber,
578 StringRef OrigExpr = Expr;
594 Pattern::parseBinop(StringRef Expr, StringRef &RemainingExpr,
639 Pattern::parseCallExpr(StringRef &Expr, StringRef FuncName,
668 StringRef OuterBinOpExpr = Expr;
715 StringRef Expr, Optional<NumericVariable *> &DefinedNumericVariable,
719 StringRef DefExpr = StringRef();
726 if (FormatSpecEnd != StringRef::npos && FormatSpecEnd < FunctionStart) {
761 if (DefEnd != StringRef::npos) {
780 StringRef OuterBinOpExpr = Expr;
822 if (DefEnd != StringRef::npos) {
835 bool Pattern::parsePattern(StringRef PatternStr, StringRef Prefix,
870 (PatternStr.size() < 2 || (PatternStr.find("{{") == StringRef::npos &&
871 PatternStr.find("[[") == StringRef::npos))) {
893 if (End == StringRef::npos) {
925 StringRef UnparsedPatternStr = PatternStr.substr(2);
929 StringRef MatchStr = UnparsedPatternStr.substr(0, End);
932 if (End == StringRef::npos) {
948 StringRef DefName;
949 StringRef SubstStr;
950 StringRef MatchRegexp;
957 if (SpacePos != StringRef::npos) {
964 StringRef OrigMatchStr = MatchStr;
971 StringRef Name = ParseVarResult->Name;
974 IsDefinition = (VarEndIdx != StringRef::npos);
1109 bool Pattern::AddRegExToRegEx(StringRef RS, unsigned &CurParen, SourceMgr &SM) {
1129 Expected<size_t> Pattern::match(StringRef Buffer, size_t &MatchLen,
1142 if (Pos == StringRef::npos)
1151 StringRef RegExToMatch = RegExStr;
1188 SmallVector<StringRef, 4> MatchInfo;
1197 StringRef FullMatch = MatchInfo[0];
1215 StringRef MatchedValue = MatchInfo[CaptureParenGroup];
1232 unsigned Pattern::computeMatchDistance(StringRef Buffer) const {
1239 StringRef ExampleString(FixedStr);
1244 StringRef BufferPrefix = Buffer.substr(0, ExampleString.size());
1249 void Pattern::printSubstitutions(const SourceMgr &SM, StringRef Buffer,
1296 StringRef Buffer, size_t Pos, size_t Len,
1311 void Pattern::printFuzzyMatch(const SourceMgr &SM, StringRef Buffer,
1318 size_t Best = StringRef::npos;
1336 if (Quality < BestQuality || Best == StringRef::npos) {
1345 if (Best && Best != StringRef::npos && BestQuality < 50) {
1357 Expected<StringRef>
1358 FileCheckPatternContext::getPatternVarValue(StringRef VarName) {
1373 FileCheckPatternContext::makeStringSubstitution(StringRef VarName,
1381 StringRef ExpressionStr, std::unique_ptr<Expression> Expression,
1388 size_t Pattern::FindRegexVarEnd(StringRef Str, SourceMgr &SM) {
1423 return StringRef::npos;
1426 StringRef FileCheck::CanonicalizeFile(MemoryBuffer &MB,
1452 return StringRef(OutputBuffer.data(), OutputBuffer.size() - 1);
1480 std::string Check::FileCheckType::getDescription(StringRef Prefix) const {
1512 static std::pair<Check::FileCheckType, StringRef>
1513 FindCheckType(const FileCheckRequest &Req, StringRef Buffer, StringRef Prefix) {
1515 return {Check::CheckNone, StringRef()};
1519 StringRef Rest = Buffer.drop_front(Prefix.size() + 1);
1528 return {Check::CheckNone, StringRef()};
1536 return {Check::CheckNone, StringRef()};
1579 static size_t SkipWord(StringRef Str, size_t Loc) {
1597 /// otherwise an empty StringRef is returned to indicate failure.
1608 static std::pair<StringRef, StringRef>
1610 StringRef &Buffer, unsigned &LineNumber,
1612 SmallVector<StringRef, 2> Matches;
1618 return {StringRef(), StringRef()};
1620 StringRef Prefix = Matches[0];
1627 StringRef Skipped = Buffer.substr(0, Loc);
1638 StringRef AfterSuffix;
1653 return {StringRef(), StringRef()};
1658 StringRef LineName = "@LINE";
1671 SourceMgr &SM, StringRef Buffer, Regex &PrefixRE,
1686 for (StringRef PatternString : Req.ImplicitCheckNot) {
1694 StringRef PatternInBuffer =
1725 StringRef UsedPrefix;
1726 StringRef AfterSuffix;
1776 StringRef PatternBuffer = Buffer.substr(0, EOL);
1801 StringRef Type = CheckTy == Check::CheckNext
1851 StringRef Prefix, SMLoc Loc, const Pattern &Pat,
1852 int MatchedCount, StringRef Buffer, size_t MatchPos,
1889 StringRef Buffer, size_t MatchPos, size_t MatchLen,
1897 StringRef Prefix, SMLoc Loc, const Pattern &Pat,
1898 int MatchedCount, StringRef Buffer,
1956 StringRef Buffer, bool VerboseVerbose,
1964 static unsigned CountNumNewlinesBetween(StringRef Range,
1986 size_t FileCheckString::Check(const SourceMgr &SM, StringRef Buffer,
2000 if (LastPos == StringRef::npos)
2001 return StringRef::npos;
2011 StringRef MatchBuffer = Buffer.substr(LastMatchEnd);
2020 return StringRef::npos;
2038 StringRef MatchBuffer = Buffer.substr(LastPos);
2039 StringRef SkippedRegion = Buffer.substr(LastPos, MatchPos);
2047 return StringRef::npos;
2056 return StringRef::npos;
2062 return StringRef::npos;
2068 bool FileCheckString::CheckNext(const SourceMgr &SM, StringRef Buffer) const {
2107 bool FileCheckString::CheckSame(const SourceMgr &SM, StringRef Buffer) const {
2129 bool FileCheckString::CheckNot(const SourceMgr &SM, StringRef Buffer,
2155 size_t FileCheckString::CheckDag(const SourceMgr &SM, StringRef Buffer,
2196 StringRef MatchBuffer = Buffer.substr(MatchPos);
2203 return StringRef::npos;
2267 StringRef SkippedRegion =
2270 return StringRef::npos;
2285 static bool ValidatePrefixes(StringRef Kind, StringSet<> &UniquePrefixes,
2286 ArrayRef<StringRef> SuppliedPrefixes) {
2287 for (StringRef Prefix : SuppliedPrefixes) {
2351 for (StringRef Prefix : Req.CommentPrefixes) {
2360 ArrayRef<StringRef> CmdlineDefines, SourceMgr &SM) {
2374 for (StringRef CmdlineDef : CmdlineDefines) {
2377 if (EqIdx == StringRef::npos) {
2405 StringRef CmdlineDefsDiagRef = CmdLineDefsDiagBuffer->getBuffer();
2409 StringRef CmdlineDef = CmdlineDefsDiagRef.substr(CmdlineDefIndices.first,
2423 StringRef CmdlineDefExpr = CmdlineDef.substr(1);
2451 std::pair<StringRef, StringRef> CmdlineNameVal = CmdlineDef.split('=');
2452 StringRef CmdlineName = CmdlineNameVal.first;
2453 StringRef OrigCmdlineName = CmdlineName;
2471 StringRef Name = ParseVarResult->Name;
2498 SmallVector<StringRef, 16> LocalPatternVars, LocalNumericVars;
2499 for (const StringMapEntry<StringRef> &Var : GlobalVariableTable)
2521 bool FileCheck::checkInput(SourceMgr &SM, StringRef Buffer,
2527 StringRef CheckRegion;
2541 if (MatchLabelPos == StringRef::npos)
2565 if (MatchPos == StringRef::npos) {