LLVM 20.0.0git
Error.h
Go to the documentation of this file.
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
19
20namespace llvm {
21
22void PrintNote(const Twine &Msg);
23void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
24
25[[noreturn]] void PrintFatalNote(const Twine &Msg);
26[[noreturn]] void PrintFatalNote(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
27[[noreturn]] void PrintFatalNote(const Record *Rec, const Twine &Msg);
28[[noreturn]] void PrintFatalNote(const RecordVal *RecVal, const Twine &Msg);
29
30void PrintWarning(const Twine &Msg);
31void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
32void PrintWarning(const char *Loc, const Twine &Msg);
33
34void PrintError(const Twine &Msg);
35void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
36void PrintError(const char *Loc, const Twine &Msg);
37void PrintError(const Record *Rec, const Twine &Msg);
38void PrintError(const RecordVal *RecVal, const Twine &Msg);
39
40[[noreturn]] void PrintFatalError(const Twine &Msg);
41[[noreturn]] void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
42[[noreturn]] void PrintFatalError(const Record *Rec, const Twine &Msg);
43[[noreturn]] void PrintFatalError(const RecordVal *RecVal, const Twine &Msg);
44
45void CheckAssert(SMLoc Loc, Init *Condition, Init *Message);
46void dumpMessage(SMLoc Loc, Init *Message);
47
48extern SourceMgr SrcMgr;
49extern unsigned ErrorsPrinted;
50
51} // end namespace llvm
52
53#endif
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
unsigned ErrorsPrinted
Definition: Error.cpp:25
void PrintFatalError(const Twine &Msg)
Definition: Error.cpp:125
void PrintError(const Twine &Msg)
Definition: Error.cpp:101
SourceMgr SrcMgr
Definition: Error.cpp:24
void PrintWarning(const Twine &Msg)
Definition: Error.cpp:89
void CheckAssert(SMLoc Loc, Init *Condition, Init *Message)
Definition: Error.cpp:159
void dumpMessage(SMLoc Loc, Init *Message)
Definition: Error.cpp:174
void PrintNote(const Twine &Msg)
Definition: Error.cpp:45
void PrintFatalNote(const Twine &Msg)
Definition: Error.cpp:55