diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-03 15:46:03 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-07-03 15:46:03 +0000 |
| commit | 8b82a4d36ea4d1a04b2e886bf2c981e4384ad7e5 (patch) | |
| tree | 51b60ce85cac9e83dd329f2cb160c844b1bd136f /llvm/tools | |
| parent | b3b804e442d85dd39340af3edb608d687b591e74 (diff) | |
| download | bcm5719-llvm-8b82a4d36ea4d1a04b2e886bf2c981e4384ad7e5.tar.gz bcm5719-llvm-8b82a4d36ea4d1a04b2e886bf2c981e4384ad7e5.zip | |
Make llvm-nm return 1 on error.
This is a small compatibility improvement with gnu nm and makes llvm-nm more
useful as a testing tool.
llvm-svn: 185546
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/llvm-nm/llvm-nm.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/tools/llvm-nm/llvm-nm.cpp b/llvm/tools/llvm-nm/llvm-nm.cpp index cb465207631..c33289bd875 100644 --- a/llvm/tools/llvm-nm/llvm-nm.cpp +++ b/llvm/tools/llvm-nm/llvm-nm.cpp @@ -121,6 +121,8 @@ namespace { bool MultipleFiles = false; + bool HadError = false; + std::string ToolName; } @@ -132,6 +134,7 @@ static void error(Twine message, Twine path = Twine()) { static bool error(error_code ec, Twine path = Twine()) { if (ec) { error(ec.message(), path); + HadError = true; return true; } return false; @@ -429,6 +432,7 @@ static void DumpSymbolNamesFromFile(std::string &Filename) { } else { errs() << ToolName << ": " << Filename << ": " << "unrecognizable file type\n"; + HadError = true; return; } } @@ -463,5 +467,9 @@ int main(int argc, char **argv) { std::for_each(InputFilenames.begin(), InputFilenames.end(), DumpSymbolNamesFromFile); + + if (HadError) + return 1; + return 0; } |

