diff options
-rw-r--r-- | include/llvm/TableGen/Error.h | 5 | ||||
-rw-r--r-- | lib/TableGen/Error.cpp | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/include/llvm/TableGen/Error.h b/include/llvm/TableGen/Error.h index c01b32b1c2..fd5f805ffc 100644 --- a/include/llvm/TableGen/Error.h +++ b/include/llvm/TableGen/Error.h @@ -29,6 +29,11 @@ public: const std::string &getMessage() const { return Message; } }; +void PrintWarning(SMLoc WarningLoc, const Twine &Msg); +void PrintWarning(const char *Loc, const Twine &Msg); +void PrintWarning(const Twine &Msg); +void PrintWarning(const TGError &Warning); + void PrintError(SMLoc ErrorLoc, const Twine &Msg); void PrintError(const char *Loc, const Twine &Msg); void PrintError(const Twine &Msg); diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index 5071ee77ac..369e3c1623 100644 --- a/lib/TableGen/Error.cpp +++ b/lib/TableGen/Error.cpp @@ -20,6 +20,22 @@ namespace llvm { SourceMgr SrcMgr; +void PrintWarning(SMLoc WarningLoc, const Twine &Msg) { + SrcMgr.PrintMessage(WarningLoc, SourceMgr::DK_Warning, Msg); +} + +void PrintWarning(const char *Loc, const Twine &Msg) { + SrcMgr.PrintMessage(SMLoc::getFromPointer(Loc), SourceMgr::DK_Warning, Msg); +} + +void PrintWarning(const Twine &Msg) { + errs() << "error:" << Msg << "\n"; +} + +void PrintWarning(const TGError &Warning) { + PrintWarning(Warning.getLoc(), Warning.getMessage()); +} + void PrintError(SMLoc ErrorLoc, const Twine &Msg) { SrcMgr.PrintMessage(ErrorLoc, SourceMgr::DK_Error, Msg); } |