diff options
author | Jordan Rose <jordan_rose@apple.com> | 2015-06-24 19:27:02 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2015-06-24 19:27:02 +0000 |
commit | 096560832fb493d875541c67895eb8a8620b68ed (patch) | |
tree | 326174cd5008ceadaca19460a2a3c3e75a072b5b /lib/Lex/Preprocessor.cpp | |
parent | 13e2ca85e71f1bff6012e802b3a9501def8fc7d5 (diff) |
[Preprocessor] Iterating over all macros should include those from modules.
So, iterate over the list of macros mentioned in modules, and make sure those
are in the master table.
This isn't particularly efficient, but hopefully it's something that isn't
done too often.
PR23929 and rdar://problem/21480635
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240571 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Preprocessor.cpp')
-rw-r--r-- | lib/Lex/Preprocessor.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp index 7e33f1ccb4..e2db638a33 100644 --- a/lib/Lex/Preprocessor.cpp +++ b/lib/Lex/Preprocessor.cpp @@ -286,6 +286,10 @@ Preprocessor::macro_begin(bool IncludeExternalMacros) const { ExternalSource->ReadDefinedMacros(); } + // Make sure we cover all macros in visible modules. + for (const ModuleMacro &Macro : ModuleMacros) + CurSubmoduleState->Macros.insert(std::make_pair(Macro.II, MacroState())); + return CurSubmoduleState->Macros.begin(); } |