Skip to content

[Sema] Extract @autoclosure diagnostics from type resolver #22348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2019

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Feb 4, 2019

Since @autoclosure attribute is associated with declarations
it makes more sense to move diagnostics to where type of the
parameter has been completely resolved. This also helps to support
parameters with typealiases pointing to function types without
any extra logic in the resolver.

@xedin xedin requested a review from DougGregor February 4, 2019 19:06
@xedin
Copy link
Contributor Author

xedin commented Feb 4, 2019

@swift-ci please smoke test

Since @autoclosure attribute is associated with declarations
it makes more sense to move diagnostics to where type of the
parameter has been completely resolved. This also helps to support
parameters with typealiases pointing to function types without
any extra logic in the resolver.
@xedin xedin force-pushed the cleanup-autoclosure-diags branch from 665f9c7 to 7f262a7 Compare February 5, 2019 18:57
@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2019

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2019

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2019

@swift-ci please smoke test compiler performance

@swiftlang swiftlang deleted a comment from swift-ci Feb 5, 2019
@swiftlang swiftlang deleted a comment from swift-ci Feb 5, 2019
@swift-ci
Copy link
Contributor

swift-ci commented Feb 5, 2019

Build comment file:

Summary for master smoketest

Unexpected test results, excluded stats for ReactiveCocoa

Regressions found (see below)

Debug

debug brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 100,958,362,152 100,990,874,280 32,512,128 0.03%
LLVM.NumLLVMBytesOutput 6,262,088 6,261,992 -96 -0.0%
time.swift-driver.wall 13.2s 13.2s 15.7ms 0.12%

debug detailed

Regressed (1)
name old new delta delta_pct
Sema.NumTypesValidated 10,932 11,902 970 8.87% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (22)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 1,032 1,032 0 0.0%
AST.NumLoadedModules 828 828 0 0.0%
AST.NumTotalClangImportedEntities 4,210 4,210 0 0.0%
AST.NumUsedConformances 886 886 0 0.0%
IRModule.NumIRBasicBlocks 17,934 17,934 0 0.0%
IRModule.NumIRFunctions 10,552 10,552 0 0.0%
IRModule.NumIRGlobals 8,017 8,017 0 0.0%
IRModule.NumIRInsts 312,244 312,244 0 0.0%
IRModule.NumIRValueSymbols 17,632 17,632 0 0.0%
LLVM.NumLLVMBytesOutput 6,262,088 6,261,992 -96 -0.0%
SILModule.NumSILGenFunctions 5,382 5,382 0 0.0%
SILModule.NumSILOptFunctions 7,052 7,052 0 0.0%
Sema.NumConformancesDeserialized 15,919 15,919 0 0.0%
Sema.NumConstraintScopes 40,330 40,330 0 0.0%
Sema.NumDeclsDeserialized 133,293 133,293 0 0.0%
Sema.NumDeclsValidated 11,208 11,208 0 0.0%
Sema.NumFunctionsTypechecked 2,516 2,516 0 0.0%
Sema.NumGenericSignatureBuilders 4,772 4,772 0 0.0%
Sema.NumLazyGenericEnvironments 29,508 29,508 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 2,012 2,012 0 0.0%
Sema.NumLazyIterableDeclContexts 23,391 23,391 0 0.0%
Sema.NumTypesDeserialized 59,379 59,379 0 0.0%

Release

release brief

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 140,332,851,903 140,251,178,622 -81,673,281 -0.06%
LLVM.NumLLVMBytesOutput 7,265,384 7,265,372 -12 -0.0%
time.swift-driver.wall 23.4s 23.3s -133.3ms -0.57%

release detailed

Regressed (1)
name old new delta delta_pct
Sema.NumTypesValidated 5,972 6,942 970 16.24% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (22)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 402 402 0 0.0%
AST.NumLoadedModules 76 76 0 0.0%
AST.NumTotalClangImportedEntities 2,113 2,113 0 0.0%
AST.NumUsedConformances 890 890 0 0.0%
IRModule.NumIRBasicBlocks 20,941 20,941 0 0.0%
IRModule.NumIRFunctions 10,211 10,211 0 0.0%
IRModule.NumIRGlobals 8,084 8,084 0 0.0%
IRModule.NumIRInsts 220,336 220,336 0 0.0%
IRModule.NumIRValueSymbols 17,439 17,439 0 0.0%
LLVM.NumLLVMBytesOutput 7,265,384 7,265,372 -12 -0.0%
SILModule.NumSILGenFunctions 4,178 4,178 0 0.0%
SILModule.NumSILOptFunctions 5,840 5,840 0 0.0%
Sema.NumConformancesDeserialized 12,279 12,279 0 0.0%
Sema.NumConstraintScopes 39,374 39,374 0 0.0%
Sema.NumDeclsDeserialized 31,994 31,994 0 0.0%
Sema.NumDeclsValidated 7,874 7,874 0 0.0%
Sema.NumFunctionsTypechecked 2,204 2,204 0 0.0%
Sema.NumGenericSignatureBuilders 1,710 1,710 0 0.0%
Sema.NumLazyGenericEnvironments 6,779 6,779 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 130 130 0 0.0%
Sema.NumLazyIterableDeclContexts 4,096 4,096 0 0.0%
Sema.NumTypesDeserialized 18,070 18,070 0 0.0%

@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2019

@DougGregor I think it's okay that we are validating more types here because that's what the intended behavior change is - don't try to fail in type resolver but instead to more checks in validateType, WDYT?

@xedin
Copy link
Contributor Author

xedin commented Feb 5, 2019

Ah, and also it wasn't accounting for all of the types which got resolved through use of resolveTypeReferenceInExpression because it was calling resolve directly.

@DougGregor
Copy link
Member

@xedin yeah, that sounds right

@xedin xedin merged commit 0a07619 into swiftlang:master Feb 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants