From 0eafc7fc37e48b27aad907bcdf0b726d2e6a9af8 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 25 Oct 2012 16:35:18 +0000 Subject: In preparation for removing exception handling in tablegen, add PrintFatalError, which combines PrintError with exit(1). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166690 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/TableGen/Error.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/llvm/TableGen/Error.h') diff --git a/include/llvm/TableGen/Error.h b/include/llvm/TableGen/Error.h index 5c1c3ad..3f7b7f4 100644 --- a/include/llvm/TableGen/Error.h +++ b/include/llvm/TableGen/Error.h @@ -40,6 +40,9 @@ void PrintError(const char *Loc, const Twine &Msg); void PrintError(const Twine &Msg); void PrintError(const TGError &Error); +LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const std::string &Msg); +LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef ErrorLoc, + const std::string &Msg); extern SourceMgr SrcMgr; -- cgit v1.1 From 61131ab15fd593a2e295d79fe2714e7bc21f2ec8 Mon Sep 17 00:00:00 2001 From: Joerg Sonnenberger Date: Thu, 25 Oct 2012 20:33:17 +0000 Subject: Remove exception handling usage from tblgen. Most places can use PrintFatalError as the unwinding mechanism was not used for anything other than printing the error. The single exception was CodeGenDAGPatterns.cpp, where intermediate errors during type resolution were ignored to simplify incremental platform development. This use is replaced by an error flag in TreePattern and bailout earlier in various places if it is set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166712 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/TableGen/Error.h | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'include/llvm/TableGen/Error.h') diff --git a/include/llvm/TableGen/Error.h b/include/llvm/TableGen/Error.h index 3f7b7f4..2f6b7e6 100644 --- a/include/llvm/TableGen/Error.h +++ b/include/llvm/TableGen/Error.h @@ -19,26 +19,13 @@ namespace llvm { -class TGError { - SmallVector Locs; - std::string Message; -public: - TGError(ArrayRef locs, const std::string &message) - : Locs(locs.begin(), locs.end()), Message(message) {} - - ArrayRef getLoc() const { return Locs; } - const std::string &getMessage() const { return Message; } -}; - void PrintWarning(ArrayRef WarningLoc, const Twine &Msg); void PrintWarning(const char *Loc, const Twine &Msg); void PrintWarning(const Twine &Msg); -void PrintWarning(const TGError &Warning); void PrintError(ArrayRef ErrorLoc, const Twine &Msg); void PrintError(const char *Loc, const Twine &Msg); void PrintError(const Twine &Msg); -void PrintError(const TGError &Error); LLVM_ATTRIBUTE_NORETURN void PrintFatalError(const std::string &Msg); LLVM_ATTRIBUTE_NORETURN void PrintFatalError(ArrayRef ErrorLoc, -- cgit v1.1