diff options
author | Jonathan D. Turner <jonathan.d.turner@gmail.com> | 2011-08-05 22:17:03 +0000 |
---|---|---|
committer | Jonathan D. Turner <jonathan.d.turner@gmail.com> | 2011-08-05 22:17:03 +0000 |
commit | 0248f57d59a493124b378604cb084fde7b67adc7 (patch) | |
tree | fb05a86c2d15215eac202f660505fec20656b26f /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 3d0b3a3a50141c90acbe4ff5bc28888d1fa394cd (diff) | |
download | llvm-0248f57d59a493124b378604cb084fde7b67adc7.zip llvm-0248f57d59a493124b378604cb084fde7b67adc7.tar.gz llvm-0248f57d59a493124b378604cb084fde7b67adc7.tar.bz2 |
Wire up -import-module to run ReadAST for each module loaded.
llvm-svn: 136987
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index b2bd759..88c972c 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -775,6 +775,10 @@ static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts, Res.push_back("-include"); Res.push_back(Opts.Includes[i]); } + for (unsigned i = 0, e = Opts.Modules.size(); i != e; ++i) { + Res.push_back("-import_module"); + Res.push_back(Opts.Modules[i]); + } for (unsigned i = 0, e = Opts.MacroIncludes.size(); i != e; ++i) { Res.push_back("-imacros"); Res.push_back(Opts.MacroIncludes[i]); @@ -1807,6 +1811,12 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args, Opts.ChainedIncludes.push_back(A->getValue(Args)); } + for (arg_iterator it = Args.filtered_begin(OPT_import_module), + ie = Args.filtered_end(); it != ie; ++it) { + const Arg *A = *it; + Opts.Modules.push_back(A->getValue(Args)); + } + // Include 'altivec.h' if -faltivec option present if (Args.hasArg(OPT_faltivec)) Opts.Includes.push_back("altivec.h"); |