mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-07 08:24:27 +00:00
Make sure TableGen exits with an error code after printing errors.
This makes it possible to report multiple errors in one invocation. There are already calls to PrintError in CodeGenDAGPatterns.cpp which previously would not cause TableGen to fail. <rdar://problem/13463339> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177573 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -20,9 +20,15 @@
|
||||
namespace llvm {
|
||||
|
||||
SourceMgr SrcMgr;
|
||||
unsigned ErrorsPrinted = 0;
|
||||
|
||||
static void PrintMessage(ArrayRef<SMLoc> Loc, SourceMgr::DiagKind Kind,
|
||||
const Twine &Msg) {
|
||||
// Count the total number of errors printed.
|
||||
// This is used to exit with an error code if there were any errors.
|
||||
if (Kind == SourceMgr::DK_Error)
|
||||
++ErrorsPrinted;
|
||||
|
||||
SMLoc NullLoc;
|
||||
if (Loc.empty())
|
||||
Loc = NullLoc;
|
||||
|
Reference in New Issue
Block a user