Add a mode in which access control is respected for module-scope lookups.

This applies to both qualified and unqualified lookups, and is controlled
by the -enable-access-control and -disable-access-control flags. I've
included both so that -disable-access-control can be put into specific tests
that will eventually need to bypass access control (e.g. stdlib unit tests).
The default is still -disable-access-control.

Swift SVN r19146
This commit is contained in:
Jordan Rose
2014-06-24 21:32:21 +00:00
parent cca27d02a0
commit a7b563855e
11 changed files with 114 additions and 21 deletions

View File

@@ -540,6 +540,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
Opts.EnableCharacterLiterals |= Args.hasArg(OPT_enable_character_literals);
if (auto A = Args.getLastArg(OPT_enable_access_control,
OPT_disable_access_control)) {
Opts.EnableAccessControl
= A->getOption().matches(OPT_enable_access_control);
}
Opts.DebugConstraintSolver |= Args.hasArg(OPT_debug_constraints);
Opts.DebuggerSupport |= Args.hasArg(OPT_debugger_support);