Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:35

0001 //===- llvm/TableGen/Error.h - tblgen error handling helpers ----*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file contains error handling helper routines to pretty-print diagnostic
0010 // messages from tblgen.
0011 //
0012 //===----------------------------------------------------------------------===//
0013 
0014 #ifndef LLVM_TABLEGEN_ERROR_H
0015 #define LLVM_TABLEGEN_ERROR_H
0016 
0017 #include "llvm/ADT/STLFunctionalExtras.h"
0018 #include "llvm/Support/SourceMgr.h"
0019 
0020 namespace llvm {
0021 class Record;
0022 class RecordVal;
0023 class Init;
0024 
0025 void PrintNote(const Twine &Msg);
0026 void PrintNote(function_ref<void(raw_ostream &OS)> PrintMsg);
0027 void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
0028 
0029 [[noreturn]] void PrintFatalNote(const Twine &Msg);
0030 [[noreturn]] void PrintFatalNote(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
0031 [[noreturn]] void PrintFatalNote(const Record *Rec, const Twine &Msg);
0032 [[noreturn]] void PrintFatalNote(const RecordVal *RecVal, const Twine &Msg);
0033 
0034 void PrintWarning(const Twine &Msg);
0035 void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
0036 void PrintWarning(const char *Loc, const Twine &Msg);
0037 
0038 void PrintError(const Twine &Msg);
0039 void PrintError(function_ref<void(raw_ostream &OS)> PrintMsg);
0040 void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
0041 void PrintError(const char *Loc, const Twine &Msg);
0042 void PrintError(const Record *Rec, const Twine &Msg);
0043 void PrintError(const RecordVal *RecVal, const Twine &Msg);
0044 
0045 [[noreturn]] void PrintFatalError(const Twine &Msg);
0046 [[noreturn]] void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
0047 [[noreturn]] void PrintFatalError(const Record *Rec, const Twine &Msg);
0048 [[noreturn]] void PrintFatalError(const RecordVal *RecVal, const Twine &Msg);
0049 [[noreturn]] void PrintFatalError(function_ref<void(raw_ostream &OS)> PrintMsg);
0050 
0051 // Returns true if the assert failed.
0052 bool CheckAssert(SMLoc Loc, const Init *Condition, const Init *Message);
0053 void dumpMessage(SMLoc Loc, const Init *Message);
0054 
0055 extern SourceMgr SrcMgr;
0056 extern unsigned ErrorsPrinted;
0057 
0058 } // end namespace llvm
0059 
0060 #endif