If we hit a parse error, emit something bad to the output stream. This ensures that

llvm-upgrade < foo | llvm-as | llvm-dis

will fail if llvm-upgrade fails.

llvm-svn: 32879
This commit is contained in:
Chris Lattner 2007-01-04 18:45:51 +00:00
parent 8392ed123a
commit a0058929bc
1 changed files with 2 additions and 0 deletions

View File

@ -72,6 +72,7 @@ void UpgradeAssembly(const std::string &infile, std::istream& in,
if (yyparse()) {
std::cerr << "Parse failed.\n";
out << "llvm-upgrade parse failed.\n";
exit(1);
}
}
@ -1597,5 +1598,6 @@ int yyerror(const char *ErrorMsg) {
else
errMsg += "token: '" + std::string(Upgradetext, Upgradeleng) + "'";
std::cerr << "llvm-upgrade: " << errMsg << '\n';
*O << "llvm-upgrade parse failed.\n";
exit(1);
}