Error.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- llvm/TableGen/Error.h - tblgen error handling helpers ----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // This file contains error handling helper routines to pretty-print diagnostic
  15. // messages from tblgen.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_TABLEGEN_ERROR_H
  19. #define LLVM_TABLEGEN_ERROR_H
  20. #include "llvm/Support/SourceMgr.h"
  21. #include "llvm/TableGen/Record.h"
  22. namespace llvm {
  23. void PrintNote(const Twine &Msg);
  24. void PrintNote(ArrayRef<SMLoc> NoteLoc, const Twine &Msg);
  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. void PrintWarning(const Twine &Msg);
  30. void PrintWarning(ArrayRef<SMLoc> WarningLoc, const Twine &Msg);
  31. void PrintWarning(const char *Loc, const Twine &Msg);
  32. void PrintError(const Twine &Msg);
  33. void PrintError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
  34. void PrintError(const char *Loc, const Twine &Msg);
  35. void PrintError(const Record *Rec, const Twine &Msg);
  36. void PrintError(const RecordVal *RecVal, const Twine &Msg);
  37. [[noreturn]] void PrintFatalError(const Twine &Msg);
  38. [[noreturn]] void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg);
  39. [[noreturn]] void PrintFatalError(const Record *Rec, const Twine &Msg);
  40. [[noreturn]] void PrintFatalError(const RecordVal *RecVal, const Twine &Msg);
  41. void CheckAssert(SMLoc Loc, Init *Condition, Init *Message);
  42. extern SourceMgr SrcMgr;
  43. extern unsigned ErrorsPrinted;
  44. } // end namespace "llvm"
  45. #endif
  46. #ifdef __GNUC__
  47. #pragma GCC diagnostic pop
  48. #endif