MLIR
20.0.0git
include
mlir
Query
Matcher
ErrorBuilder.h
Go to the documentation of this file.
1
//===--- ErrorBuilder.h - Helper for building error messages ----*- C++ -*-===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
//
9
// ErrorBuilder to manage error messages.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#ifndef MLIR_TOOLS_MLIRQUERY_MATCHER_ERRORBUILDER_H
14
#define MLIR_TOOLS_MLIRQUERY_MATCHER_ERRORBUILDER_H
15
16
#include "llvm/ADT/StringRef.h"
17
#include "llvm/ADT/Twine.h"
18
#include <initializer_list>
19
20
namespace
mlir::query::matcher::internal
{
21
class
Diagnostics;
22
23
// Represents the line and column numbers in a source query.
24
struct
SourceLocation
{
25
unsigned
line
{};
26
unsigned
column
{};
27
};
28
29
// Represents a range in a source query, defined by its start and end locations.
30
struct
SourceRange
{
31
SourceLocation
start
{};
32
SourceLocation
end
{};
33
};
34
35
// All errors from the system.
36
enum class
ErrorType
{
37
None
,
38
39
// Parser Errors
40
ParserChainedExprInvalidArg
,
41
ParserChainedExprNoCloseParen
,
42
ParserChainedExprNoOpenParen
,
43
ParserFailedToBuildMatcher
,
44
ParserInvalidToken
,
45
ParserMalformedChainedExpr
,
46
ParserNoCloseParen
,
47
ParserNoCode
,
48
ParserNoComma
,
49
ParserNoOpenParen
,
50
ParserNotAMatcher
,
51
ParserOverloadedType
,
52
ParserStringError
,
53
ParserTrailingCode
,
54
55
// Registry Errors
56
RegistryMatcherNotFound
,
57
RegistryNotBindable
,
58
RegistryValueNotFound
,
59
RegistryWrongArgCount
,
60
RegistryWrongArgType
,
61
};
62
63
void
addError
(Diagnostics *error, SourceRange range,
ErrorType
errorType,
64
std::initializer_list<llvm::Twine> errorTexts);
65
66
}
// namespace mlir::query::matcher::internal
67
68
#endif
// MLIR_TOOLS_MLIRQUERY_MATCHER_ERRORBUILDER_H
mlir::query::matcher::internal
Definition:
ErrorBuilder.h:20
mlir::query::matcher::internal::addError
void addError(Diagnostics *error, SourceRange range, ErrorType errorType, std::initializer_list< llvm::Twine > errorTexts)
Definition:
ErrorBuilder.cpp:17
mlir::query::matcher::internal::ErrorType
ErrorType
Definition:
ErrorBuilder.h:36
mlir::query::matcher::internal::ErrorType::ParserOverloadedType
@ ParserOverloadedType
mlir::query::matcher::internal::ErrorType::ParserChainedExprNoOpenParen
@ ParserChainedExprNoOpenParen
mlir::query::matcher::internal::ErrorType::RegistryWrongArgType
@ RegistryWrongArgType
mlir::query::matcher::internal::ErrorType::ParserNoOpenParen
@ ParserNoOpenParen
mlir::query::matcher::internal::ErrorType::RegistryNotBindable
@ RegistryNotBindable
mlir::query::matcher::internal::ErrorType::ParserNoCloseParen
@ ParserNoCloseParen
mlir::query::matcher::internal::ErrorType::ParserFailedToBuildMatcher
@ ParserFailedToBuildMatcher
mlir::query::matcher::internal::ErrorType::ParserNotAMatcher
@ ParserNotAMatcher
mlir::query::matcher::internal::ErrorType::ParserNoCode
@ ParserNoCode
mlir::query::matcher::internal::ErrorType::None
@ None
mlir::query::matcher::internal::ErrorType::RegistryMatcherNotFound
@ RegistryMatcherNotFound
mlir::query::matcher::internal::ErrorType::ParserChainedExprInvalidArg
@ ParserChainedExprInvalidArg
mlir::query::matcher::internal::ErrorType::ParserStringError
@ ParserStringError
mlir::query::matcher::internal::ErrorType::ParserInvalidToken
@ ParserInvalidToken
mlir::query::matcher::internal::ErrorType::ParserNoComma
@ ParserNoComma
mlir::query::matcher::internal::ErrorType::RegistryValueNotFound
@ RegistryValueNotFound
mlir::query::matcher::internal::ErrorType::RegistryWrongArgCount
@ RegistryWrongArgCount
mlir::query::matcher::internal::ErrorType::ParserTrailingCode
@ ParserTrailingCode
mlir::query::matcher::internal::ErrorType::ParserMalformedChainedExpr
@ ParserMalformedChainedExpr
mlir::query::matcher::internal::ErrorType::ParserChainedExprNoCloseParen
@ ParserChainedExprNoCloseParen
mlir::query::matcher::internal::SourceLocation
Definition:
ErrorBuilder.h:24
mlir::query::matcher::internal::SourceLocation::line
unsigned line
Definition:
ErrorBuilder.h:25
mlir::query::matcher::internal::SourceLocation::column
unsigned column
Definition:
ErrorBuilder.h:26
mlir::query::matcher::internal::SourceRange
Definition:
ErrorBuilder.h:30
mlir::query::matcher::internal::SourceRange::start
SourceLocation start
Definition:
ErrorBuilder.h:31
mlir::query::matcher::internal::SourceRange::end
SourceLocation end
Definition:
ErrorBuilder.h:32
Generated on Sat Nov 23 2024 17:09:54 for MLIR by
1.9.1