summaryrefslogtreecommitdiff
path: root/tools/llvm-nm
diff options
context:
space:
mode:
Diffstat (limited to 'tools/llvm-nm')
-rw-r--r--tools/llvm-nm/llvm-nm.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/llvm-nm/llvm-nm.cpp b/tools/llvm-nm/llvm-nm.cpp
index cb46520763..c33289bd87 100644
--- a/tools/llvm-nm/llvm-nm.cpp
+++ b/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;
}