summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/dsymutil/dsymutil.cpp4
-rw-r--r--llvm/tools/llvm-ar/llvm-ar.cpp3
-rw-r--r--llvm/tools/llvm-opt-report/OptReport.cpp4
-rw-r--r--llvm/tools/llvm-xray/llvm-xray.cc1
4 files changed, 8 insertions, 4 deletions
diff --git a/llvm/tools/dsymutil/dsymutil.cpp b/llvm/tools/dsymutil/dsymutil.cpp
index 1ce0aefeec2..51eb3ff2e39 100644
--- a/llvm/tools/dsymutil/dsymutil.cpp
+++ b/llvm/tools/dsymutil/dsymutil.cpp
@@ -253,8 +253,10 @@ int main(int argc, char **argv) {
"for the executable <input file> by using debug symbols information\n"
"contained in its symbol table.\n");
- if (Help)
+ if (Help) {
PrintHelpMessage();
+ return 0;
+ }
if (Version) {
llvm::cl::PrintVersionMessage();
diff --git a/llvm/tools/llvm-ar/llvm-ar.cpp b/llvm/tools/llvm-ar/llvm-ar.cpp
index 65c61989282..03655cb4318 100644
--- a/llvm/tools/llvm-ar/llvm-ar.cpp
+++ b/llvm/tools/llvm-ar/llvm-ar.cpp
@@ -54,8 +54,7 @@ static StringRef ToolName;
// Show the error message and exit.
LLVM_ATTRIBUTE_NORETURN static void fail(Twine Error) {
errs() << ToolName << ": " << Error << ".\n";
- // FIXME: Other ar implementations will print the command line help in here.
- // Unfortunately cl::PrintHelpMessage() exits with 0, so we can't call it.
+ cl::PrintHelpMessage();
exit(1);
}
diff --git a/llvm/tools/llvm-opt-report/OptReport.cpp b/llvm/tools/llvm-opt-report/OptReport.cpp
index 4f45dd9f2aa..3c6115db6ac 100644
--- a/llvm/tools/llvm-opt-report/OptReport.cpp
+++ b/llvm/tools/llvm-opt-report/OptReport.cpp
@@ -514,8 +514,10 @@ int main(int argc, const char **argv) {
"A tool to generate an optimization report from YAML optimization"
" record files.\n");
- if (Help)
+ if (Help) {
cl::PrintHelpMessage();
+ return 0;
+ }
LocationInfoTy LocationInfo;
if (!readLocationInfo(LocationInfo))
diff --git a/llvm/tools/llvm-xray/llvm-xray.cc b/llvm/tools/llvm-xray/llvm-xray.cc
index 98303e7be15..34c453a1eb4 100644
--- a/llvm/tools/llvm-xray/llvm-xray.cc
+++ b/llvm/tools/llvm-xray/llvm-xray.cc
@@ -46,4 +46,5 @@ int main(int argc, char *argv[]) {
// If all else fails, we still print the usage message.
cl::PrintHelpMessage(false, true);
+ return 0;
}
OpenPOWER on IntegriCloud