aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-25 03:31:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-25 03:31:53 +0000
commit43302d4144b5291961aa160d2fe191c09a9d8ad1 (patch)
treeb27caca9656cd5656caa31f50a34f7b694a8c9c5
parente3972a902d4a6f61fb21df092da2cace2b16cb3e (diff)
Driver: Allow driver title (for --help) to be overridden by clients.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97106 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Driver/Driver.h6
-rw-r--r--lib/Driver/Driver.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/include/clang/Driver/Driver.h b/include/clang/Driver/Driver.h
index 64f88ed983..59c3946a2c 100644
--- a/include/clang/Driver/Driver.h
+++ b/include/clang/Driver/Driver.h
@@ -70,6 +70,9 @@ public:
/// Default name for linked images (e.g., "a.out").
std::string DefaultImageName;
+ /// Driver title to use with help.
+ std::string DriverTitle;
+
/// Host information for the platform the driver is running as. This
/// will generally be the actual host platform, but not always.
const HostInfo *Host;
@@ -137,6 +140,9 @@ public:
void setCheckInputsExist(bool Value) { CheckInputsExist = Value; }
+ const std::string &getTitle() { return DriverTitle; }
+ void setTitle(std::string Value) { DriverTitle = Value; }
+
/// @}
/// @name Primary Functionality
/// @{
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index e729f0fb54..ec8227efb3 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -49,6 +49,7 @@ Driver::Driver(llvm::StringRef _Name, llvm::StringRef _Dir,
: Opts(createDriverOptTable()), Diags(_Diags),
Name(_Name), Dir(_Dir), DefaultHostTriple(_DefaultHostTriple),
DefaultImageName(_DefaultImageName),
+ DriverTitle("clang \"gcc-compatible\" driver"),
Host(0),
CCCGenericGCCName("gcc"), CCCIsCXX(false), CCCEcho(false),
CCCPrintBindings(false), CheckInputsExist(true), CCCUseClang(true),
@@ -273,8 +274,8 @@ void Driver::PrintOptions(const ArgList &Args) const {
// FIXME: Move -ccc options to real options in the .td file (or eliminate), and
// then move to using OptTable::PrintHelp.
void Driver::PrintHelp(bool ShowHidden) const {
- getOpts().PrintHelp(llvm::outs(), Name.c_str(),
- "clang \"gcc-compatible\" driver", ShowHidden);
+ getOpts().PrintHelp(llvm::outs(), Name.c_str(), DriverTitle.c_str(),
+ ShowHidden);
}
void Driver::PrintVersion(const Compilation &C, llvm::raw_ostream &OS) const {