[modules] Determine the set of macros exported by a submodule at the end of that submodule.

Previously we'd defer this determination until writing the AST, which doesn't
allow us to use this information when building other submodules of the same
module. This change also allows us to use a uniform mechanism for writing
module macro records, independent of whether they are local or imported.

llvm-svn: 235614
This commit is contained in:
Richard Smith
2015-04-23 18:18:26 +00:00
parent 1ef49218b3
commit b8b2ed6529
12 changed files with 260 additions and 145 deletions

View File

@@ -322,7 +322,7 @@ StringRef Preprocessor::getLastMacroWithSpelling(
for (Preprocessor::macro_iterator I = macro_begin(), E = macro_end();
I != E; ++I) {
const MacroDirective::DefInfo
Def = I->second->findDirectiveAtLoc(Loc, SourceMgr);
Def = I->second.findDirectiveAtLoc(Loc, SourceMgr);
if (!Def || !Def.getMacroInfo())
continue;
if (!Def.getMacroInfo()->isObjectLike())