MLIR  20.0.0git
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 
21 class Diagnostics;
22 
23 // Represents the line and column numbers in a source query.
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 {
33 };
34 
35 // All errors from the system.
36 enum class ErrorType {
37  None,
38 
39  // Parser Errors
54 
55  // Registry Errors
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
void addError(Diagnostics *error, SourceRange range, ErrorType errorType, std::initializer_list< llvm::Twine > errorTexts)