r231124 - Fix program name in "clang -help"

Sumanth Gundapaneni sgundapa at codeaurora.org
Tue Mar 3 12:43:12 PST 2015


Author: sgundapa
Date: Tue Mar  3 14:43:12 2015
New Revision: 231124

URL: http://llvm.org/viewvc/llvm-project?rev=231124&view=rev
Log:
Fix program name in "clang -help"

With out this patch,
"clang -help" prints "USAGE: clang-3 [options] <inputs>".
It should either print
USAGE: clang [options] <inputs>
or

USAGE: clang-3.7 [options] <inputs>
With this patch, on Linux, it prints
USAGE: clang-3.7 [options] <inputs>

On Windows, it prints
USAGE: clang.exe [options] <inputs>

Modified:
    cfe/trunk/lib/Driver/Driver.cpp

Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=231124&r1=231123&r2=231124&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Tue Mar  3 14:43:12 2015
@@ -57,7 +57,7 @@ Driver::Driver(StringRef ClangExecutable
       CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true),
       CCCUsePCH(true), SuppressMissingInputWarning(false) {
 
-  Name = llvm::sys::path::stem(ClangExecutable);
+  Name = llvm::sys::path::filename(ClangExecutable);
   Dir  = llvm::sys::path::parent_path(ClangExecutable);
 
   // Compute the path to the resource directory.





More information about the cfe-commits mailing list