diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-09-12 20:41:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-09-12 20:41:59 +0000 |
commit | 9a6da6930644b4f2dbe4885b0eb4fc1274ff56a4 (patch) | |
tree | 564e160bd3733af36124ca3b947aaa947eed5763 /lib/Frontend/CompilerInvocation.cpp | |
parent | 48822fbd088c4821f15fee5a2957a69a1f98e746 (diff) |
Introduce a cc1-level option to provide the path to the module cache,
where the compiler will look for module files. Eliminates the
egregious hack where we looked into the header search paths for
modules.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139538 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | lib/Frontend/CompilerInvocation.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp index 7ea31613bd..e7b8854224 100644 --- a/lib/Frontend/CompilerInvocation.cpp +++ b/lib/Frontend/CompilerInvocation.cpp @@ -576,6 +576,10 @@ static void HeaderSearchOptsToArgs(const HeaderSearchOptions &Opts, Res.push_back("-resource-dir"); Res.push_back(Opts.ResourceDir); } + if (!Opts.ModuleCachePath.empty()) { + Res.push_back("-fmodule-cache-path"); + Res.push_back(Opts.ModuleCachePath); + } if (!Opts.UseStandardIncludes) Res.push_back("-nostdinc"); if (!Opts.UseStandardCXXIncludes) @@ -1378,7 +1382,8 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { if (const Arg *A = Args.getLastArg(OPT_stdlib_EQ)) Opts.UseLibcxx = (strcmp(A->getValue(Args), "libc++") == 0); Opts.ResourceDir = Args.getLastArgValue(OPT_resource_dir); - + Opts.ModuleCachePath = Args.getLastArgValue(OPT_fmodule_cache_path); + // Add -I..., -F..., and -index-header-map options in order. bool IsIndexHeaderMap = false; for (arg_iterator it = Args.filtered_begin(OPT_I, OPT_F, @@ -1426,7 +1431,7 @@ static void ParseHeaderSearchArgs(HeaderSearchOptions &Opts, ArgList &Args) { ((*it)->getOption().matches(OPT_cxx_isystem) ? frontend::CXXSystem : frontend::System), true, false, !(*it)->getOption().matches(OPT_iwithsysroot)); - + // FIXME: Need options for the various environment variables! } |