[modules] If we re-enter a submodule from within itself (when submodule
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 21 May 2015 01:20:10 +0000 (01:20 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 21 May 2015 01:20:10 +0000 (01:20 +0000)
commit04765ae01e936a3f2bc980ebd8fc7ea8a4760636
treeb5a150687a94b1b7cf20fbad6067172a2013e341
parentde0aff3e9109ac9444b4408aa7619204344f54ed
[modules] If we re-enter a submodule from within itself (when submodule
visibility is enabled) or leave and re-enter it, restore the macro and module
visibility state from last time we were in that submodule.

This allows mutually-#including header files to stand a chance at being
modularized with local visibility enabled.

llvm-svn: 237871
clang/include/clang/Lex/Preprocessor.h
clang/lib/Lex/PPLexerChange.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Lex/Preprocessor.cpp
clang/test/Modules/Inputs/submodule-visibility/cycle1.h [new file with mode: 0644]
clang/test/Modules/Inputs/submodule-visibility/cycle2.h [new file with mode: 0644]
clang/test/Modules/Inputs/submodule-visibility/module.modulemap
clang/test/Modules/submodule-visibility-cycles.cpp [new file with mode: 0644]