forked from OSchip/llvm-project
Driver: Lookup program names using llvm::sys::Program::FindProgramByName
if our usual methods fail. This isn't necessary for running the tool, but improves the accuracy of logging output. Also, have GCC tools lookup gcc program path. llvm-svn: 67243
This commit is contained in:
parent
bf76c6d971
commit
6f66877ebf
|
@ -26,6 +26,7 @@
|
|||
#include "llvm/Support/PrettyStackTrace.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include "llvm/System/Program.h"
|
||||
|
||||
#include "InputInfo.h"
|
||||
|
||||
|
@ -879,6 +880,11 @@ llvm::sys::Path Driver::GetProgramPath(const char *Name,
|
|||
if (P.exists())
|
||||
return P;
|
||||
|
||||
// Search path to increase accuracy of logging output.
|
||||
P = llvm::sys::Program::FindProgramByName(Name);
|
||||
if (!P.empty())
|
||||
return P;
|
||||
|
||||
return llvm::sys::Path(Name);
|
||||
}
|
||||
|
||||
|
|
|
@ -392,7 +392,9 @@ void gcc::Common::ConstructJob(Compilation &C, const JobAction &JA,
|
|||
CmdArgs.push_back(II.getInputFilename());
|
||||
}
|
||||
|
||||
Dest.addCommand(new Command("gcc", CmdArgs));
|
||||
const char *Exec =
|
||||
Args.MakeArgString(getToolChain().GetProgramPath(C, "gcc").c_str());
|
||||
Dest.addCommand(new Command(Exec, CmdArgs));
|
||||
}
|
||||
|
||||
void gcc::Preprocess::RenderExtraToolArgs(ArgStringList &CmdArgs) const {
|
||||
|
|
Loading…
Reference in New Issue