[modules] Add -fmodules-local-submodule-visibility flag.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 1 May 2015 21:22:17 +0000 (21:22 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 1 May 2015 21:22:17 +0000 (21:22 +0000)
commitee977933f7df9cef13cc06ac7fa3e4a22b72e41f
treea22ff47a085710049d757d9056439c018e405181
parentf9b517c1596a7f13c4b2be68c0ff5db1b1d96afb
[modules] Add -fmodules-local-submodule-visibility flag.

This flag specifies that the normal visibility rules should be used even for
local submodules (submodules of the currently-being-built module). Thus names
will only be visible if a header / module that declares them has actually been
included / imported, and not merely because a submodule that happened to be
built earlier declared those names. This also removes the need to modularize
bottom-up: textually-included headers will be included into every submodule
that includes them, since their include guards will not leak between modules.

So far, this only governs visibility of macros, not of declarations, so is not
ready for real use yet.

llvm-svn: 236350
clang/include/clang/Basic/LangOptions.def
clang/include/clang/Basic/Module.h
clang/include/clang/Driver/CC1Options.td
clang/include/clang/Lex/Preprocessor.h
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Lex/PPLexerChange.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/macro-ambiguity.cpp
clang/test/Modules/macro-reexport.cpp
clang/test/Modules/macros.c
clang/test/Modules/macros2.c