[cfe-commits] r67243 - in /cfe/trunk/lib/Driver: Driver.cpp Tools.cpp
Daniel Dunbar
daniel at zuster.org
Wed Mar 18 14:34:19 PDT 2009
Author: ddunbar
Date: Wed Mar 18 16:34:08 2009
New Revision: 67243
URL: http://llvm.org/viewvc/llvm-project?rev=67243&view=rev
Log:
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.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=67243&r1=67242&r2=67243&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Wed Mar 18 16:34:08 2009
@@ -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 @@
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);
}
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=67243&r1=67242&r2=67243&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Mar 18 16:34:08 2009
@@ -392,7 +392,9 @@
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 {
More information about the cfe-commits
mailing list