Lines Matching defs:loc
30 FormatLexer::FormatLexer(SourceMgr &mgr, SMLoc loc)
31 : mgr(mgr), loc(loc),
35 FormatToken FormatLexer::emitError(SMLoc loc, const Twine &msg) {
36 mgr.PrintMessage(loc, SourceMgr::DK_Error, msg);
37 llvm::SrcMgr.PrintMessage(this->loc, SourceMgr::DK_Note,
39 return formToken(FormatToken::error, loc.getPointer());
42 FormatToken FormatLexer::emitError(const char *loc, const Twine &msg) {
43 return emitError(SMLoc::getFromPointer(loc), msg);
46 FormatToken FormatLexer::emitErrorAndNote(SMLoc loc, const Twine &msg,
48 mgr.PrintMessage(loc, SourceMgr::DK_Error, msg);
49 llvm::SrcMgr.PrintMessage(this->loc, SourceMgr::DK_Note,
51 mgr.PrintMessage(loc, SourceMgr::DK_Note, note);
52 return formToken(FormatToken::error, loc.getPointer());
207 SMLoc loc = curToken.getLoc();
219 if (failed(verify(loc, elements)))
244 SMLoc loc = tok.getLoc();
249 loc,
266 (void)emitError(loc, "expected valid literal but got '" + value +
275 SMLoc loc = tok.getLoc();
280 loc, "strings may only be used as 'custom' directive arguments");
297 SMLoc loc = tok.getLoc();
302 return parseVariableImpl(loc, name, ctx);
307 SMLoc loc = tok.getLoc();
311 return parseCustomDirective(loc, ctx);
313 return parseRefDirective(loc, ctx);
315 return parseQualifiedDirective(loc, ctx);
316 return parseDirectiveImpl(loc, tok.getKind(), ctx);
320 SMLoc loc = curToken.getLoc();
323 return emitError(loc,
374 return emitError(loc, "optional group has no anchor element");
377 if (failed(verifyOptionalGroupElements(loc, thenElements, anchor)) ||
378 failed(verifyOptionalGroupElements(loc, elseElements, nullptr)))
392 return emitError(loc, "first parsable element of an optional group must be "
400 FailureOr<FormatElement *> FormatParser::parseCustomDirective(SMLoc loc,
403 return emitError(loc, "'custom' is only valid as a top-level directive");
433 if (failed(verifyCustomDirectiveArguments(loc, arguments)))
438 FailureOr<FormatElement *> FormatParser::parseRefDirective(SMLoc loc,
441 return emitError(loc, "'ref' is only valid within a `custom` directive");
454 FailureOr<FormatElement *> FormatParser::parseQualifiedDirective(SMLoc loc,
462 if (failed(markQualified(loc, *var)))