Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===- llvm/TableGen/Error.h - tblgen error handling helpers ----*- C++ -*-===// |
| 2 | // |
Andrew Walbran | 16937d0 | 2019-10-22 13:54:20 +0100 | [diff] [blame] | 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 |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 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" |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 18 | #include "llvm/TableGen/Record.h" |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 22 | void PrintNote(const Twine &Msg); |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 23 | void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg); |
| 24 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 25 | LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const Twine &Msg); |
| 26 | LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(ArrayRef<SMLoc> ErrorLoc, |
| 27 | const Twine &Msg); |
| 28 | LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const Record *Rec, |
| 29 | const Twine &Msg); |
| 30 | LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const RecordVal *RecVal, |
| 31 | const Twine &Msg); |
| 32 | |
| 33 | void PrintWarning(const Twine &Msg); |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 34 | void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg); |
| 35 | void PrintWarning(const char *Loc, const Twine &Msg); |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 36 | |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 37 | void PrintError(const Twine &Msg); |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 38 | void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg); |
| 39 | void PrintError(const char *Loc, const Twine &Msg); |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 40 | void PrintError(const Record *Rec, const Twine &Msg); |
| 41 | void PrintError(const RecordVal *RecVal, const Twine &Msg); |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 42 | |
| 43 | LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg); |
| 44 | LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, |
| 45 | const Twine &Msg); |
Olivier Deprez | f4ef2d0 | 2021-04-20 13:36:24 +0200 | [diff] [blame] | 46 | LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Record *Rec, |
| 47 | const Twine &Msg); |
| 48 | LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const RecordVal *RecVal, |
| 49 | const Twine &Msg); |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 50 | |
| 51 | extern SourceMgr SrcMgr; |
| 52 | extern unsigned ErrorsPrinted; |
| 53 | |
| 54 | } // end namespace "llvm" |
| 55 | |
| 56 | #endif |