Merge remote-tracking branch 'origin/master' into master-next

This commit is contained in:
Greg Parker
2017-06-28 15:25:17 -07:00
629 changed files with 21576 additions and 10961 deletions

View File

@@ -226,6 +226,16 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
}
}
if (const Arg *A = Args.getLastArg(OPT_solver_expression_time_threshold_EQ)) {
unsigned attempt;
if (StringRef(A->getValue()).getAsInteger(10, attempt)) {
Diags.diagnose(SourceLoc(), diag::error_invalid_arg_value,
A->getAsString(Args), A->getValue());
} else {
Opts.SolverExpressionTimeThreshold = attempt;
}
}
Opts.PlaygroundTransform |= Args.hasArg(OPT_playground);
if (Args.hasArg(OPT_disable_playground_transform))
Opts.PlaygroundTransform = false;
@@ -857,7 +867,6 @@ static bool ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Args.hasArg(OPT_serialize_debugging_options);
Opts.EnableSourceImport |= Args.hasArg(OPT_enable_source_import);
Opts.ImportUnderlyingModule |= Args.hasArg(OPT_import_underlying_module);
Opts.SILSerializeAll |= Args.hasArg(OPT_sil_serialize_all);
Opts.EnableSerializationNestedTypeLookupTable &=
!Args.hasArg(OPT_disable_serialization_nested_type_lookup_table);
@@ -1320,6 +1329,10 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
if (Args.hasArg(OPT_sil_merge_partial_modules))
Opts.MergePartialModules = true;
Opts.SILSerializeAll |= Args.hasArg(OPT_sil_serialize_all);
Opts.SILSerializeWitnessTables |=
Args.hasArg(OPT_sil_serialize_witness_tables);
// Parse the optimization level.
if (const Arg *A = Args.getLastArg(OPT_O_Group)) {
if (A->getOption().matches(OPT_Onone)) {
@@ -1411,7 +1424,14 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
}
if (const Arg *A = Args.getLastArg(options::OPT_sanitize_EQ)) {
Opts.Sanitize = parseSanitizerArgValues(A, Triple, Diags);
Opts.Sanitize = parseSanitizerArgValues(
A, Triple, Diags,
/* sanitizerRuntimeLibExists= */[](StringRef libName) {
// The driver has checked the existence of the library
// already.
return true;
});
IRGenOpts.Sanitize = Opts.Sanitize;
}

View File

@@ -55,8 +55,7 @@ std::string CompilerInvocation::getPCHHash() const {
void CompilerInstance::createSILModule(bool WholeModule) {
assert(MainModule && "main module not created yet");
TheSILModule = SILModule::createEmptyModule(
getMainModule(), Invocation.getSILOptions(), WholeModule,
Invocation.getFrontendOptions().SILSerializeAll);
getMainModule(), Invocation.getSILOptions(), WholeModule);
}
void CompilerInstance::setPrimarySourceFile(SourceFile *SF) {
@@ -250,7 +249,7 @@ ModuleDecl *CompilerInstance::getMainModule() {
if (Invocation.getFrontendOptions().EnableResilience)
MainModule->setResilienceStrategy(ResilienceStrategy::Resilient);
else if (Invocation.getFrontendOptions().SILSerializeAll)
else if (Invocation.getSILOptions().SILSerializeAll)
MainModule->setResilienceStrategy(ResilienceStrategy::Fragile);
}
return MainModule;
@@ -520,7 +519,8 @@ void CompilerInstance::performSema() {
performTypeChecking(MainFile, PersistentState.getTopLevelContext(),
TypeCheckOptions, CurTUElem,
options.WarnLongFunctionBodies,
options.WarnLongExpressionTypeChecking);
options.WarnLongExpressionTypeChecking,
options.SolverExpressionTimeThreshold);
}
CurTUElem = MainFile.Decls.size();
} while (!Done);
@@ -549,7 +549,8 @@ void CompilerInstance::performSema() {
performTypeChecking(*SF, PersistentState.getTopLevelContext(),
TypeCheckOptions, /*curElem*/ 0,
options.WarnLongFunctionBodies,
options.WarnLongExpressionTypeChecking);
options.WarnLongExpressionTypeChecking,
options.SolverExpressionTimeThreshold);
// Even if there were no source files, we should still record known
// protocols.