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>

llvm-svn: 177573
This commit is contained in:
Jakob Stoklund Olesen
2013-03-20 20:43:11 +00:00
parent 28c68a2d07
commit a1214e76bd
3 changed files with 12 additions and 2 deletions

View File

@@ -117,11 +117,14 @@ int TableGenMain(char *argv0, TableGenMainFn *MainFn) {
if (MainFn(Out.os(), Records))
return 1;
if (ErrorsPrinted > 0) {
errs() << argv0 << ": " << ErrorsPrinted << " errors.\n";
return 1;
}
// Declare success.
Out.keep();
return 0;
return 1;
}
}