]> granicus.if.org Git - clang/commitdiff
Driver: Pass -resource-dir to clang -cc1, since the driver presumably already found...
authorDaniel Dunbar <daniel@zuster.org>
Tue, 15 Dec 2009 01:02:52 +0000 (01:02 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Tue, 15 Dec 2009 01:02:52 +0000 (01:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91384 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index 4279db59c91529553ee9164b1ee9a6ce834265e3..70597ab91396382b132a3bee0ee663a9e5842764 100644 (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.