[cfe-commits] r97106 - in /cfe/trunk: include/clang/Driver/Driver.h lib/Driver/Driver.cpp
Daniel Dunbar
daniel at zuster.org
Wed Feb 24 19:31:53 PST 2010
Author: ddunbar
Date: Wed Feb 24 21:31:53 2010
New Revision: 97106
URL: http://llvm.org/viewvc/llvm-project?rev=97106&view=rev
Log:
Driver: Allow driver title (for --help) to be overridden by clients.
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=97106&r1=97105&r2=97106&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Wed Feb 24 21:31:53 2010
@@ -70,6 +70,9 @@
/// 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 @@
void setCheckInputsExist(bool Value) { CheckInputsExist = Value; }
+ const std::string &getTitle() { return DriverTitle; }
+ void setTitle(std::string Value) { DriverTitle = Value; }
+
/// @}
/// @name Primary Functionality
/// @{
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=97106&r1=97105&r2=97106&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Feb 24 21:31:53 2010
@@ -49,6 +49,7 @@
: 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 @@
// 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 {
More information about the cfe-commits
mailing list