diff options
author | Daniel Dunbar <daniel@zuster.org> | 2010-07-14 18:46:27 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2010-07-14 18:46:27 +0000 |
commit | b9a822639c570b1853c75c235e9d6bad485f9e01 (patch) | |
tree | 08bcad5194f74a6ccb66aa780cd6dde991e6058d /lib/Driver/Tools.cpp | |
parent | 4a7e88978cf646ad10d654020cb00b3877069210 (diff) |
Driver: When re'execing clang, use path to the main executable instead of
looking up Clang in the normal search paths (which may end up finding the wrong
clang).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108346 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r-- | lib/Driver/Tools.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 14744998f1..f423d4e3b9 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -1489,8 +1489,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.AddAllArgs(CmdArgs, options::OPT_undef); - const char *Exec = - Args.MakeArgString(getToolChain().GetProgramPath("clang")); + std::string Exec = getToolChain().getDriver().getClangProgramPath(); // Optionally embed the -cc1 level arguments into the debug info, for build // analysis. @@ -1510,7 +1509,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Args.MakeArgString(Flags.str())); } - Dest.addCommand(new Command(JA, *this, Exec, CmdArgs)); + Dest.addCommand(new Command(JA, *this, Exec.c_str(), CmdArgs)); // Explicitly warn that these options are unsupported, even though // we are allowing compilation to continue. @@ -1589,9 +1588,8 @@ void ClangAs::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Input.getFilename()); } - const char *Exec = - Args.MakeArgString(getToolChain().GetProgramPath("clang")); - Dest.addCommand(new Command(JA, *this, Exec, CmdArgs)); + std::string Exec = getToolChain().getDriver().getClangProgramPath(); + Dest.addCommand(new Command(JA, *this, Exec.c_str(), CmdArgs)); } void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA, |