Wire up -import-module to run ReadAST for each module loaded.

llvm-svn: 136987
This commit is contained in:
Jonathan D. Turner
2011-08-05 22:17:03 +00:00
parent 3d0b3a3a50
commit 0248f57d59
3 changed files with 37 additions and 1 deletions

View File

@@ -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");