Add -disable-testable-attr-requires-testable-module.

...which allows "@testable import" to work with modules not compiled for
testing. This isn't generally safe, but should be fine for clients like
SourceKit which just need to have the API available and might not be able
to properly rebuild the original target for testing.

We may revisit this in the future.

Swift SVN r26629
This commit is contained in:
Jordan Rose
2015-03-27 16:36:41 +00:00
parent ccf0f2ad3e
commit 8a3fcf621e
5 changed files with 23 additions and 1 deletions

View File

@@ -638,6 +638,12 @@ static bool ParseLangArgs(LangOptions &Opts, ArgList &Args,
= A->getOption().matches(OPT_enable_objc_attr_requires_foundation_module);
}
if (auto A = Args.getLastArg(OPT_enable_testable_attr_requires_testable_module,
OPT_disable_testable_attr_requires_testable_module)) {
Opts.EnableTestableAttrRequiresTestableModule
= A->getOption().matches(OPT_enable_testable_attr_requires_testable_module);
}
if (const Arg *A = Args.getLastArg(OPT_debug_constraints_attempt)) {
unsigned attempt;
if (StringRef(A->getValue()).getAsInteger(10, attempt)) {