From 39c150eecbc1cf83836c59a516ee9aa1795a189c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 7 Sep 2017 23:30:48 +0000 Subject: Don't call exit from cl::PrintHelpMessage. Most callers were not expecting the exit(0) and trying to exit with a different value. This also adds back the call to cl::PrintHelpMessage in llvm-ar. llvm-svn: 312761 --- llvm/tools/llvm-ar/llvm-ar.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/tools/llvm-ar/llvm-ar.cpp') 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); } -- cgit v1.2.3