LLVM  12.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 
17 #include "llvm/Support/SourceMgr.h"
18 #include "llvm/TableGen/Record.h"
19 
20 namespace llvm {
21 
22 void PrintNote(const Twine &Msg);
23 void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
24 
25 LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(ArrayRef<SMLoc> ErrorLoc,
26  const Twine &Msg);
27 LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const Record *Rec,
28  const Twine &Msg);
29 LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(const RecordVal *RecVal,
30  const Twine &Msg);
31 
32 void PrintWarning(const Twine &Msg);
33 void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
34 void PrintWarning(const char *Loc, const Twine &Msg);
35 
36 void PrintError(const Twine &Msg);
37 void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
38 void PrintError(const char *Loc, const Twine &Msg);
39 void PrintError(const Record *Rec, const Twine &Msg);
40 
41 LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg);
42 LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef<SMLoc> ErrorLoc,
43  const Twine &Msg);
44 LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Record *Rec,
45  const Twine &Msg);
46 LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const RecordVal *RecVal,
47  const Twine &Msg);
48 
49 extern SourceMgr SrcMgr;
50 extern unsigned ErrorsPrinted;
51 
52 } // end namespace "llvm"
53 
54 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
void PrintWarning(const Twine &Msg)
Definition: Error.cpp:82
SourceMgr SrcMgr
Definition: Error.cpp:24
void PrintError(const Twine &Msg)
Definition: Error.cpp:94
unsigned ErrorsPrinted
Definition: Error.cpp:25
LLVM_ATTRIBUTE_NORETURN void PrintFatalNote(ArrayRef< SMLoc > ErrorLoc, const Twine &Msg)
Definition: Error.cpp:55
void PrintNote(const Twine &Msg)
Definition: Error.cpp:45
#define LLVM_ATTRIBUTE_NORETURN
Definition: Compiler.h:249
LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const Twine &Msg)
Definition: Error.cpp:112