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 --- lib/TableGen/Error.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/TableGen/Error.cpp') diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index 5dd688c..ad98fba 100644 --- a/lib/TableGen/Error.cpp +++ b/lib/TableGen/Error.cpp @@ -16,6 +16,8 @@ #include "llvm/ADT/Twine.h" #include "llvm/Support/raw_ostream.h" +#include + namespace llvm { SourceMgr SrcMgr; @@ -63,4 +65,14 @@ void PrintError(const TGError &Error) { PrintError(Error.getLoc(), Error.getMessage()); } +void PrintFatalError(const std::string &Msg) { + PrintError(Twine(Msg)); + std::exit(1); +} + +void PrintFatalError(ArrayRef ErrorLoc, const std::string &Msg) { + PrintError(ErrorLoc, Msg); + std::exit(1); +} + } // end namespace llvm -- 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 --- lib/TableGen/Error.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'lib/TableGen/Error.cpp') diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index ad98fba..0bb86b0 100644 --- a/lib/TableGen/Error.cpp +++ b/lib/TableGen/Error.cpp @@ -45,10 +45,6 @@ void PrintWarning(const Twine &Msg) { errs() << "warning:" << Msg << "\n"; } -void PrintWarning(const TGError &Warning) { - PrintWarning(Warning.getLoc(), Warning.getMessage()); -} - void PrintError(ArrayRef ErrorLoc, const Twine &Msg) { PrintMessage(ErrorLoc, SourceMgr::DK_Error, Msg); } @@ -61,10 +57,6 @@ void PrintError(const Twine &Msg) { errs() << "error:" << Msg << "\n"; } -void PrintError(const TGError &Error) { - PrintError(Error.getLoc(), Error.getMessage()); -} - void PrintFatalError(const std::string &Msg) { PrintError(Twine(Msg)); std::exit(1); -- cgit v1.1 From d04a8d4b33ff316ca4cf961e06c9e312eff8e64f Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Mon, 3 Dec 2012 16:50:05 +0000 Subject: Use the new script to sort the includes of every file under lib. Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/Error.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'lib/TableGen/Error.cpp') diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index 0bb86b0..ec84a72 100644 --- a/lib/TableGen/Error.cpp +++ b/lib/TableGen/Error.cpp @@ -15,7 +15,6 @@ #include "llvm/TableGen/Error.h" #include "llvm/ADT/Twine.h" #include "llvm/Support/raw_ostream.h" - #include namespace llvm { -- cgit v1.1