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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32879 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2007-01-04 18:45:51 +00:00
parent aae58841c6
commit b9240544d7

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);
}