Driver: Allow -ccc-gcc-name to specify the name/path to use when

calling gcc in generic configurations.

llvm-svn: 68260
This commit is contained in:
Daniel Dunbar
2009-04-01 23:34:41 +00:00
parent e4fd640147
commit 7803c9546b
3 changed files with 12 additions and 2 deletions

View File

@@ -78,6 +78,9 @@ public:
/// 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;

View File

@@ -44,7 +44,8 @@ Driver::Driver(const char *_Name, const char *_Dir,
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 @@ Compilation *Driver::BuildCompilation(int argc, const char **argv) {
} 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")) {

View File

@@ -500,8 +500,10 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
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));
}