[cfe-commits] r68260 - in /cfe/trunk: include/clang/Driver/Driver.h lib/Driver/Driver.cpp lib/Driver/Tools.cpp
Daniel Dunbar
daniel at zuster.org
Wed Apr 1 16:34:41 PDT 2009
Author: ddunbar
Date: Wed Apr 1 18:34:41 2009
New Revision: 68260
URL: http://llvm.org/viewvc/llvm-project?rev=68260&view=rev
Log:
Driver: Allow -ccc-gcc-name to specify the name/path to use when
calling gcc in generic configurations.
Modified:
cfe/trunk/include/clang/Driver/Driver.h
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/include/clang/Driver/Driver.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Driver.h?rev=68260&r1=68259&r2=68260&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Driver.h (original)
+++ cfe/trunk/include/clang/Driver/Driver.h Wed Apr 1 18:34:41 2009
@@ -78,6 +78,9 @@
/// Only print tool bindings, don't build any jobs.
bool CCCPrintBindings : 1;
+ /// Name to use when calling the generic gcc.
+ std::string CCCGenericGCCName;
+
private:
/// Use the clang compiler where possible.
bool CCCUseClang : 1;
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=68260&r1=68259&r2=68260&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Apr 1 18:34:41 2009
@@ -44,7 +44,8 @@
DefaultImageName(_DefaultImageName),
Host(0),
CCCIsCXX(false), CCCEcho(false), CCCPrintBindings(false),
- CCCUseClang(true), CCCUseClangCXX(false), CCCUseClangCPP(true),
+ CCCGenericGCCName("gcc"), CCCUseClang(true), CCCUseClangCXX(false),
+ CCCUseClangCPP(true),
SuppressMissingInputWarning(false)
{
// Only use clang on i386 and x86_64 by default.
@@ -137,6 +138,10 @@
} else if (!strcmp(Opt, "echo")) {
CCCEcho = true;
+ } else if (!strcmp(Opt, "gcc-name")) {
+ assert(Start+1 < End && "FIXME: -ccc- argument handling.");
+ CCCGenericGCCName = *++Start;
+
} else if (!strcmp(Opt, "clang-cxx")) {
CCCUseClangCXX = true;
} else if (!strcmp(Opt, "no-clang")) {
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=68260&r1=68259&r2=68260&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Apr 1 18:34:41 2009
@@ -500,8 +500,10 @@
II.getInputArg().render(Args, CmdArgs);
}
+ const char *GCCName =
+ getToolChain().getHost().getDriver().CCCGenericGCCName.c_str();
const char *Exec =
- Args.MakeArgString(getToolChain().GetProgramPath(C, "gcc").c_str());
+ Args.MakeArgString(getToolChain().GetProgramPath(C, GCCName).c_str());
Dest.addCommand(new Command(Exec, CmdArgs));
}
More information about the cfe-commits
mailing list