summaryrefslogtreecommitdiffstats
path: root/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-04-28 21:05:07 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-04-28 21:05:07 +0000
commit6ec0dff0c4a5c2d0cf7a6aa3ee768bd93735dd1f (patch)
tree8bbc42b3342c204c8e49fb18347a494fe03406d1 /lib/Lex/PPLexerChange.cpp
parent1a5e6db2112e52c45687c60c6f595959a0260d4f (diff)
Refactor to make MacroState ownership and lifetime clearer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPLexerChange.cpp')
-rw-r--r--lib/Lex/PPLexerChange.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Lex/PPLexerChange.cpp b/lib/Lex/PPLexerChange.cpp
index 57110aa246..3f0c2bb277 100644
--- a/lib/Lex/PPLexerChange.cpp
+++ b/lib/Lex/PPLexerChange.cpp
@@ -638,6 +638,8 @@ void Preprocessor::LeaveSubmodule() {
bool ExplicitlyPublic = false;
for (auto *MD = Macro.second.getLatest(); MD != SavedInfo.Latest;
MD = MD->getPrevious()) {
+ assert(MD && "broken macro directive chain");
+
// Skip macros defined in other submodules we #included along the way.
Module *Mod = getModuleContainingLocation(MD->getLocation());
if (Mod != Info.M)
@@ -673,7 +675,8 @@ void Preprocessor::LeaveSubmodule() {
Info.M->NameVisibility = Module::MacrosVisible;
Info.M->MacroVisibilityLoc = Info.ImportLoc;
++MacroVisibilityGeneration;
- // FIXME: Also mark any exported macros as visible, and check for conflicts.
+ // FIXME: Also mark any exported modules as visible, and check for
+ // conflicts.
}
BuildingSubmoduleStack.pop_back();