1//===- llvm/TableGen/Error.h - tblgen error handling helpers ----*- 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// This file contains error handling helper routines to pretty-print diagnostic
10// messages from tblgen.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_TABLEGEN_ERROR_H
15#define LLVM_TABLEGEN_ERROR_H
16
17#include "llvm/Support/SourceMgr.h"
18
19namespace llvm {
20
21void PrintNote(const Twine &Msg);
22void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
23
24void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
25void PrintWarning(const char *Loc, const Twine &Msg);
26void PrintWarning(const Twine &Msg);
27
28void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
29void PrintError(const char *Loc, const Twine &Msg);
30void PrintError(const Twine &Msg);
31
32LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg);
33LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc,
34                                             const Twine &Msg);
35
36extern SourceMgr SrcMgr;
37extern unsigned ErrorsPrinted;
38
39} // end namespace "llvm"
40
41#endif
42