blob: 7c83b62986205e660d2a473d15adfdc09bcded87 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===- llvm/TableGen/Error.h - tblgen error handling helpers ----*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// 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
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
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(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
22
23void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
24void PrintWarning(const char *Loc, const Twine &Msg);
25void PrintWarning(const Twine &Msg);
26
27void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
28void PrintError(const char *Loc, const Twine &Msg);
29void PrintError(const Twine &Msg);
30
31LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg);
32LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc,
33 const Twine &Msg);
34
35extern SourceMgr SrcMgr;
36extern unsigned ErrorsPrinted;
37
38} // end namespace "llvm"
39
40#endif