diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-01 21:22:17 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-01 21:22:17 +0000 |
commit | ee977933f7df9cef13cc06ac7fa3e4a22b72e41f (patch) | |
tree | a22ff47a085710049d757d9056439c018e405181 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | f9b517c1596a7f13c4b2be68c0ff5db1b1d96afb (diff) | |
download | llvm-ee977933f7df9cef13cc06ac7fa3e4a22b72e41f.zip llvm-ee977933f7df9cef13cc06ac7fa3e4a22b72e41f.tar.gz llvm-ee977933f7df9cef13cc06ac7fa3e4a22b72e41f.tar.bz2 |
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index a91e31e36..79f80d0 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -1508,6 +1508,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, Opts.ModulesStrictDeclUse = Args.hasArg(OPT_fmodules_strict_decluse); Opts.ModulesDeclUse = Args.hasArg(OPT_fmodules_decluse) || Opts.ModulesStrictDeclUse; + Opts.ModulesLocalVisibility = + Args.hasArg(OPT_fmodules_local_submodule_visibility); Opts.ModulesSearchAll = Opts.Modules && !Args.hasArg(OPT_fno_modules_search_all) && Args.hasArg(OPT_fmodules_search_all); |