Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found itself.

llvm-svn: 91384
This commit is contained in:
Daniel Dunbar
2009-12-15 01:02:52 +00:00
parent 9a4e0128a8
commit 34e0b8cdee

View File

@@ -9,6 +9,7 @@
#include "Tools.h"
#include "clang/Basic/Version.h"
#include "clang/Driver/Action.h"
#include "clang/Driver/Arg.h"
#include "clang/Driver/ArgList.h"
@@ -815,7 +816,16 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_nostdinc);
Args.AddLastArg(CmdArgs, options::OPT_nobuiltininc);
Args.AddLastArg(CmdArgs, options::OPT_isysroot);
// Pass the path to compiler resource files.
//
// FIXME: Get this from a configuration object.
llvm::sys::Path P(D.Dir);
P.eraseComponent(); // Remove /bin from foo/bin
P.appendComponent("lib");
P.appendComponent("clang");
P.appendComponent(CLANG_VERSION_STRING);
CmdArgs.push_back("-resource-dir");
CmdArgs.push_back(Args.MakeArgString(P.str()));
// Add preprocessing options like -I, -D, etc. if we are using the
// preprocessor.