Lines Matching refs:SM

138                                             const SourceMgr &SM) const {  in valueFromStringRepr()
242 BinaryOperation::getImplicitFormat(const SourceMgr &SM) const { in getImplicitFormat()
243 Expected<ExpressionFormat> LeftFormat = LeftOperand->getImplicitFormat(SM); in getImplicitFormat()
244 Expected<ExpressionFormat> RightFormat = RightOperand->getImplicitFormat(SM); in getImplicitFormat()
258 SM, getExpressionStr(), in getImplicitFormat()
289 Pattern::parseVariable(StringRef &Str, const SourceMgr &SM) { in parseVariable() argument
291 return ErrorDiagnostic::get(SM, Str, "empty variable name"); in parseVariable()
301 return ErrorDiagnostic::get(SM, Str.slice(I, StringRef::npos), in parseVariable()
307 return ErrorDiagnostic::get(SM, Str, "invalid variable name"); in parseVariable()
339 const SourceMgr &SM) { in parseNumericVariableDefinition() argument
340 Expected<VariableProperties> ParseVarResult = parseVariable(Expr, SM); in parseNumericVariableDefinition()
347 SM, Name, "definition of pseudo numeric variable unsupported"); in parseNumericVariableDefinition()
353 SM, Name, "string variable with name '" + Name + "' already exists"); in parseNumericVariableDefinition()
358 SM, Expr, "unexpected characters after numeric variable name"); in parseNumericVariableDefinition()
366 SM, Expr, "format different from previous variable definition"); in parseNumericVariableDefinition()
376 FileCheckPatternContext *Context, const SourceMgr &SM) { in parseNumericVariableUse() argument
379 SM, Name, "invalid pseudo numeric variable '" + Name + "'"); in parseNumericVariableUse()
402 SM, Name, in parseNumericVariableUse()
412 const SourceMgr &SM) { in parseNumericOperand() argument
416 SM, Expr, "parenthesized expression not permitted here"); in parseNumericOperand()
417 return parseParenExpr(Expr, LineNumber, Context, SM); in parseNumericOperand()
423 parseVariable(Expr, SM); in parseNumericOperand()
428 return ErrorDiagnostic::get(SM, ParseVarResult->Name, in parseNumericOperand()
432 SM); in parseNumericOperand()
437 Context, SM); in parseNumericOperand()
457 SM, SaveExpr, in parseNumericOperand()
465 FileCheckPatternContext *Context, const SourceMgr &SM) { in parseParenExpr() argument
473 return ErrorDiagnostic::get(SM, Expr, "missing operand in expression"); in parseParenExpr()
478 Context, SM); in parseParenExpr()
483 LineNumber, Context, SM); in parseParenExpr()
490 return ErrorDiagnostic::get(SM, Expr, in parseParenExpr()
500 FileCheckPatternContext *Context, const SourceMgr &SM) { in parseBinop() argument
519 SM, OpLoc, Twine("unsupported operation '") + Twine(Operator) + "'"); in parseBinop()
525 return ErrorDiagnostic::get(SM, RemainingExpr, in parseBinop()
532 LineNumber, Context, SM); in parseBinop()
544 FileCheckPatternContext *Context, const SourceMgr &SM) { in parseCallExpr() argument
559 SM, FuncName, Twine("call to undefined function '") + FuncName + "'"); in parseCallExpr()
568 return ErrorDiagnostic::get(SM, Expr, "missing argument"); in parseCallExpr()
574 Context, SM); in parseCallExpr()
583 Context, SM); in parseCallExpr()
598 return ErrorDiagnostic::get(SM, Expr, "missing argument"); in parseCallExpr()
602 return ErrorDiagnostic::get(SM, Expr, in parseCallExpr()
611 return ErrorDiagnostic::get(SM, FuncName, in parseCallExpr()
620 FileCheckPatternContext *Context, const SourceMgr &SM) { in parseNumericSubstitutionBlock() argument
636 SM, FormatExpr, in parseNumericSubstitutionBlock()
646 return ErrorDiagnostic::get(SM, FormatExpr, in parseNumericSubstitutionBlock()
672 return ErrorDiagnostic::get(SM, FmtLoc, in parseNumericSubstitutionBlock()
680 SM, AlternateFormFlagLoc, in parseNumericSubstitutionBlock()
686 SM, FormatExpr, in parseNumericSubstitutionBlock()
706 SM, Expr, "empty numeric expression should not have a constraint"); in parseNumericSubstitutionBlock()
715 Expr, AO, !HasParsedValidConstraint, LineNumber, Context, SM); in parseNumericSubstitutionBlock()
718 IsLegacyLineExpr, LineNumber, Context, SM); in parseNumericSubstitutionBlock()
722 SM, Expr, in parseNumericSubstitutionBlock()
739 ExpressionASTPointer->getImplicitFormat(SM); in parseNumericSubstitutionBlock()
754 DefExpr, Context, LineNumber, ExpressionPointer->getFormat(), SM); in parseNumericSubstitutionBlock()
765 SourceMgr &SM, const FileCheckRequest &Req) { in parsePattern() argument
777 SM.PrintMessage(PatternLoc, SourceMgr::DK_Error, in parsePattern()
783 SM.PrintMessage( in parsePattern()
827 SM.PrintMessage(SMLoc::getFromPointer(PatternStr.data()), in parsePattern()
843 if (AddRegExToRegEx(PatternStr.substr(2, End - 2), CurParen, SM)) in parsePattern()
866 size_t End = FindRegexVarEnd(UnparsedPatternStr, SM); in parsePattern()
871 SM.PrintMessage(SMLoc::getFromPointer(PatternStr.data()), in parsePattern()
897 SM.PrintMessage(SMLoc::getFromPointer(MatchStr.data() + SpacePos), in parsePattern()
905 parseVariable(MatchStr, SM); in parsePattern()
917 SM.PrintMessage(SMLoc::getFromPointer(Name.data()), in parsePattern()
926 SM.PrintMessage( in parsePattern()
939 SM.PrintMessage(SMLoc::getFromPointer(Name.data()), in parsePattern()
956 SM); in parsePattern()
1005 if (!MatchRegexp.empty() && AddRegExToRegEx(MatchRegexp, CurParen, SM)) in parsePattern()
1019 SM.PrintMessage(SMLoc::getFromPointer(SubstStr.data()), in parsePattern()
1057 bool Pattern::AddRegExToRegEx(StringRef RS, unsigned &CurParen, SourceMgr &SM) { in AddRegExToRegEx() argument
1061 SM.PrintMessage(SMLoc::getFromPointer(RS.data()), SourceMgr::DK_Error, in AddRegExToRegEx()
1078 const SourceMgr &SM) const { in match()
1121 SM, Substitution->getFromString(), in match()
1125 [&SM](const UndefVarError &E) { in match()
1126 return ErrorDiagnostic::get(SM, E.getVarName(), in match()
1181 APInt Value = Format.valueFromStringRepr(MatchedValue, SM); in match()
1205 void Pattern::printSubstitutions(const SourceMgr &SM, StringRef Buffer, in printSubstitutions() argument
1231 Diags->emplace_back(SM, CheckTy, getLoc(), MatchTy, in printSubstitutions()
1234 SM.PrintMessage(Range.Start, SourceMgr::DK_Note, OS.str()); in printSubstitutions()
1239 void Pattern::printVariableDefs(const SourceMgr &SM, in printVariableDefs() argument
1286 Diags->emplace_back(SM, CheckTy, getLoc(), MatchTy, VC.Range, OS.str()); in printVariableDefs()
1288 SM.PrintMessage(VC.Range.Start, SourceMgr::DK_Note, OS.str(), VC.Range); in printVariableDefs()
1293 const SourceMgr &SM, SMLoc Loc, in ProcessMatchResult() argument
1308 Diags->emplace_back(SM, CheckTy, Loc, MatchTy, Range); in ProcessMatchResult()
1313 void Pattern::printFuzzyMatch(const SourceMgr &SM, StringRef Buffer, in printFuzzyMatch() argument
1349 ProcessMatchResult(FileCheckDiag::MatchFuzzy, SM, getLoc(), in printFuzzyMatch()
1351 SM.PrintMessage(MatchRange.Start, SourceMgr::DK_Note, in printFuzzyMatch()
1390 size_t Pattern::FindRegexVarEnd(StringRef Str, SourceMgr &SM) { in FindRegexVarEnd() argument
1412 SM.PrintMessage(SMLoc::getFromPointer(Str.data()), in FindRegexVarEnd()
1457 FileCheckDiag::FileCheckDiag(const SourceMgr &SM, in FileCheckDiag() argument
1462 auto Start = SM.getLineAndColumn(InputRange.Start); in FileCheckDiag()
1463 auto End = SM.getLineAndColumn(InputRange.End); in FileCheckDiag()
1775 SourceMgr &SM, StringRef Buffer, in readCheckFile() argument
1781 PatternContext->defineCmdlineVariables(Req.GlobalDefines, SM); in readCheckFile()
1800 unsigned BufferID = SM.AddNewSourceBuffer(std::move(CmdLine), SMLoc()); in readCheckFile()
1816 PatternInBuffer, "IMPLICIT-CHECK", SM, Req); in readCheckFile()
1862 SM.PrintMessage(SMLoc::getFromPointer(UsedDirective.data()), in readCheckFile()
1870 SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), SourceMgr::DK_Error, in readCheckFile()
1877 SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), SourceMgr::DK_Error, in readCheckFile()
1904 if (P.parsePattern(PatternBuffer, UsedPrefix, SM, Req)) in readCheckFile()
1909 SM.PrintMessage( in readCheckFile()
1923 SM.PrintMessage(SMLoc::getFromPointer(UsedPrefixStart), in readCheckFile()
1976 static Error printMatch(bool ExpectedMatch, const SourceMgr &SM, in printMatch() argument
2000 SMRange MatchRange = ProcessMatchResult(MatchTy, SM, Loc, Pat.getCheckTy(), in printMatch()
2004 Pat.printSubstitutions(SM, Buffer, MatchRange, MatchTy, Diags); in printMatch()
2005 Pat.printVariableDefs(SM, MatchTy, Diags); in printMatch()
2019 SM.PrintMessage( in printMatch()
2021 SM.PrintMessage(MatchRange.Start, SourceMgr::DK_Note, "found here", in printMatch()
2025 Pat.printSubstitutions(SM, Buffer, MatchRange, MatchTy, nullptr); in printMatch()
2026 Pat.printVariableDefs(SM, MatchTy, nullptr); in printMatch()
2035 Diags->emplace_back(SM, Pat.getCheckTy(), Loc, in printMatch()
2046 static Error printNoMatch(bool ExpectedMatch, const SourceMgr &SM, in printNoMatch() argument
2088 SMRange SearchRange = ProcessMatchResult(MatchTy, SM, Loc, Pat.getCheckTy(), in printNoMatch()
2093 Diags->emplace_back(SM, Pat.getCheckTy(), Loc, MatchTy, NoteRange, in printNoMatch()
2095 Pat.printSubstitutions(SM, Buffer, SearchRange, MatchTy, Diags); in printNoMatch()
2112 SM.PrintMessage(Loc, in printNoMatch()
2115 SM.PrintMessage(SearchRange.Start, SourceMgr::DK_Note, in printNoMatch()
2121 Pat.printSubstitutions(SM, Buffer, SearchRange, MatchTy, nullptr); in printNoMatch()
2123 Pat.printFuzzyMatch(SM, Buffer, Diags); in printNoMatch()
2129 static Error reportMatchResult(bool ExpectedMatch, const SourceMgr &SM, in reportMatchResult() argument
2136 return printMatch(ExpectedMatch, SM, Prefix, Loc, Pat, MatchedCount, Buffer, in reportMatchResult()
2138 return printNoMatch(ExpectedMatch, SM, Prefix, Loc, Pat, MatchedCount, Buffer, in reportMatchResult()
2166 size_t FileCheckString::Check(const SourceMgr &SM, StringRef Buffer, in Check() argument
2179 LastPos = CheckDag(SM, Buffer, NotStrings, Req, Diags); in Check()
2193 Pattern::MatchResult MatchResult = Pat.match(MatchBuffer, SM); in Check()
2196 if (Error Err = reportMatchResult(/*ExpectedMatch=*/true, SM, Prefix, Loc, in Check()
2222 if (CheckNext(SM, SkippedRegion)) { in Check()
2223 ProcessMatchResult(FileCheckDiag::MatchFoundButWrongLine, SM, Loc, in Check()
2231 if (CheckSame(SM, SkippedRegion)) { in Check()
2232 ProcessMatchResult(FileCheckDiag::MatchFoundButWrongLine, SM, Loc, in Check()
2240 if (CheckNot(SM, SkippedRegion, NotStrings, Req, Diags)) in Check()
2247 bool FileCheckString::CheckNext(const SourceMgr &SM, StringRef Buffer) const { in CheckNext() argument
2261 SM.PrintMessage(Loc, SourceMgr::DK_Error, in CheckNext()
2263 SM.PrintMessage(SMLoc::getFromPointer(Buffer.end()), SourceMgr::DK_Note, in CheckNext()
2265 SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), SourceMgr::DK_Note, in CheckNext()
2271 SM.PrintMessage(Loc, SourceMgr::DK_Error, in CheckNext()
2274 SM.PrintMessage(SMLoc::getFromPointer(Buffer.end()), SourceMgr::DK_Note, in CheckNext()
2276 SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), SourceMgr::DK_Note, in CheckNext()
2278 SM.PrintMessage(SMLoc::getFromPointer(FirstNewLine), SourceMgr::DK_Note, in CheckNext()
2286 bool FileCheckString::CheckSame(const SourceMgr &SM, StringRef Buffer) const { in CheckSame() argument
2295 SM.PrintMessage(Loc, SourceMgr::DK_Error, in CheckSame()
2298 SM.PrintMessage(SMLoc::getFromPointer(Buffer.end()), SourceMgr::DK_Note, in CheckSame()
2300 SM.PrintMessage(SMLoc::getFromPointer(Buffer.data()), SourceMgr::DK_Note, in CheckSame()
2309 const SourceMgr &SM, StringRef Buffer, in CheckNot() argument
2316 Pattern::MatchResult MatchResult = NotInfo->DagNotPat.match(Buffer, SM); in CheckNot()
2318 /*ExpectedMatch=*/false, SM, NotInfo->DagNotPrefix, in CheckNot()
2330 FileCheckString::CheckDag(const SourceMgr &SM, StringRef Buffer, in CheckDag() argument
2373 Pattern::MatchResult MatchResult = Pat.match(MatchBuffer, SM); in CheckDag()
2377 if (Error Err = reportMatchResult(/*ExpectedMatch=*/true, SM, DNPrefix, in CheckDag()
2426 SM.PrintMessage(OldStart, SourceMgr::DK_Note, in CheckDag()
2440 /*ExpectedMatch=*/true, SM, DNPrefix, Pat.getLoc(), Pat, 1, Buffer, in CheckDag()
2453 if (CheckNot(SM, SkippedRegion, NotStrings, Req, Diags)) in CheckDag()
2514 ArrayRef<StringRef> CmdlineDefines, SourceMgr &SM) { in defineCmdlineVariables() argument
2560 SM.AddNewSourceBuffer(std::move(CmdLineDefsDiagBuffer), SMLoc()); in defineCmdlineVariables()
2568 ErrorDiagnostic::get(SM, CmdlineDef, in defineCmdlineVariables()
2582 std::nullopt, this, SM); in defineCmdlineVariables()
2610 Pattern::parseVariable(CmdlineName, SM); in defineCmdlineVariables()
2621 SM, OrigCmdlineName, in defineCmdlineVariables()
2632 ErrorDiagnostic::get(SM, Name, in defineCmdlineVariables()
2675 bool FileCheck::checkInput(SourceMgr &SM, StringRef Buffer, in checkInput() argument
2694 CheckLabelStr.Check(SM, Buffer, true, MatchLabelLen, Req, Diags); in checkInput()
2717 CheckStr.Check(SM, CheckRegion, false, MatchLen, Req, Diags); in checkInput()