summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-12-15 00:06:45 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-12-15 00:06:45 +0000
commita5a166d01a732ecc7f09f4b763ae6b939df5f0ff (patch)
tree783bb984aa6f52610808294757cef08e617bf8fd /clang/lib/Frontend/CompilerInvocation.cpp
parent7dc42e5d4c568b596012019d8535ba6f92b3c338 (diff)
downloadbcm5719-llvm-a5a166d01a732ecc7f09f4b763ae6b939df5f0ff.tar.gz
bcm5719-llvm-a5a166d01a732ecc7f09f4b763ae6b939df5f0ff.zip
Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of computed. llvm-svn: 91370
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 102bbe2f826..7a3388ffbb9 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -409,8 +409,9 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts,
// FIXME: Provide an option for this, and move env detection to driver.
llvm::llvm_report_error("Not yet implemented!");
}
- if (!Opts.BuiltinIncludePath.empty()) {
- // FIXME: Provide an option for this, and move to driver.
+ if (!Opts.ResourceDir.empty()) {
+ Res.push_back("-resource-dir");
+ Res.push_back(Opts.ResourceDir);
}
if (!Opts.UseStandardIncludes)
Res.push_back("-nostdinc");
@@ -951,8 +952,8 @@ ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args, Diagnostic &Diags) {
return DashX;
}
-std::string CompilerInvocation::GetBuiltinIncludePath(const char *Argv0,
- void *MainAddr) {
+std::string CompilerInvocation::GetResourcesPath(const char *Argv0,
+ void *MainAddr) {
llvm::sys::Path P = llvm::sys::Path::GetMainExecutable(Argv0, MainAddr);
if (!P.isEmpty()) {
@@ -963,7 +964,6 @@ std::string CompilerInvocation::GetBuiltinIncludePath(const char *Argv0,
P.appendComponent("lib");
P.appendComponent("clang");
P.appendComponent(CLANG_VERSION_STRING);
- P.appendComponent("include");
}
return P.str();
@@ -975,10 +975,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) {
Opts.Verbose = Args.hasArg(OPT_v);
Opts.UseBuiltinIncludes = !Args.hasArg(OPT_nobuiltininc);
Opts.UseStandardIncludes = !Args.hasArg(OPT_nostdinc);
- // Filled in by clients.
- //
- // FIXME: Elimate this.
- Opts.BuiltinIncludePath = "";
+ Opts.ResourceDir = getLastArgValue(Args, OPT_resource_dir);
// Add -I... and -F... options in order.
for (arg_iterator it = Args.filtered_begin(OPT_I, OPT_F),
OpenPOWER on IntegriCloud