Show argv[0] in error messages (like gcc).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51755 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Mikhail Glushenkov 2008-05-30 06:26:35 +00:00
parent e43228958c
commit ed3ba406c7

View File

@ -87,8 +87,7 @@ int main(int argc, char** argv) {
}
if (InputFilenames.empty()) {
std::cerr << "No input files.\n";
return 1;
throw std::runtime_error("no input files");
}
return BuildTargets(graph);
@ -97,10 +96,10 @@ int main(int argc, char** argv) {
return ec.code();
}
catch(const std::exception& ex) {
std::cerr << ex.what() << '\n';
std::cerr << argv[0] << ": " << ex.what() << '\n';
}
catch(...) {
std::cerr << "Unknown error!\n";
std::cerr << argv[0] << ": unknown error!\n";
}
return 1;
}