diff options
| author | Fangrui Song <maskray@google.com> | 2018-10-10 00:15:33 +0000 |
|---|---|---|
| committer | Fangrui Song <maskray@google.com> | 2018-10-10 00:15:33 +0000 |
| commit | d0028238302d6b673ac693cada423c77a1531e0b (patch) | |
| tree | 8cc4acfc476d9270167d68ffc6eaed970440d648 /clang/lib | |
| parent | 88478bbc603222965b9f617acccb0d7ba409ac3b (diff) | |
| download | bcm5719-llvm-d0028238302d6b673ac693cada423c77a1531e0b.tar.gz bcm5719-llvm-d0028238302d6b673ac693cada423c77a1531e0b.zip | |
[Driver][cc1][cc1as] Call OptTable::PrintHelp with explicit " [options] file..."
Summary: This is to accommodate a change in llvm/lib/Option/OptTable.cpp D51009
Reviewers: rupprecht, alexshap, jhenderson
Reviewed By: rupprecht
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D51109
llvm-svn: 344098
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Driver/Driver.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index ebf2ffc3558..203dcbe35f0 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -68,6 +68,7 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FileSystem.h" +#include "llvm/Support/FormatVariadic.h" #include "llvm/Support/Path.h" #include "llvm/Support/PrettyStackTrace.h" #include "llvm/Support/Process.h" @@ -1433,7 +1434,8 @@ void Driver::PrintHelp(bool ShowHidden) const { if (!ShowHidden) ExcludedFlagsBitmask |= HelpHidden; - getOpts().PrintHelp(llvm::outs(), Name.c_str(), DriverTitle.c_str(), + std::string Usage = llvm::formatv("{0} [options] file...", Name).str(); + getOpts().PrintHelp(llvm::outs(), Usage.c_str(), DriverTitle.c_str(), IncludedFlagsBitmask, ExcludedFlagsBitmask, /*ShowAllAliases=*/false); } diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp index 2d3a2115581..e63a973845c 100644 --- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp +++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp @@ -183,7 +183,7 @@ bool ExecuteCompilerInvocation(CompilerInstance *Clang) { // Honor -help. if (Clang->getFrontendOpts().ShowHelp) { std::unique_ptr<OptTable> Opts = driver::createDriverOptTable(); - Opts->PrintHelp(llvm::outs(), "clang -cc1", + Opts->PrintHelp(llvm::outs(), "clang -cc1 [options] file...", "LLVM 'Clang' Compiler: http://clang.llvm.org", /*Include=*/driver::options::CC1Option, /*Exclude=*/0, /*ShowAllAliases=*/false); |

