Skip to content
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

Check deprecation for getters and setters #15102

Conversation

jrose-apple
Copy link
Contributor

This handles the case where just one accessor is deprecated but not the other, which does come up sometimes in Apple's frameworks.

Not included in this pull request:

  • fixing availability checking for subscripts imported from ObjC (that's rdar://problem/18636764)
  • checking for unavailability rather than deprecation (less common, so I thought I'd get this part in first)
  • anything addressing the issue I found with nested property writeback (foo.bar.baz = 1)

rdar://problem/18633725

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test source compatibility

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test compiler performance

@swift-ci
Copy link
Collaborator

swift-ci commented Mar 9, 2018

Build comment file:

Summary for master smoketest

No regressions above thresholds

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) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 46,239,608 46,239,544 -64 -0.0%
time.swift-driver.wall 79.4s 79.4s -51.8ms -0.07%

debug detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 112,854 112,854 0 0.0%
AST.NumLoadedModules 16,158 16,158 0 0.0%
AST.NumTotalClangImportedEntities 332,845 332,845 0 0.0%
AST.NumUsedConformances 9,378 9,378 0 0.0%
IRModule.NumIRBasicBlocks 155,415 155,415 0 0.0%
IRModule.NumIRFunctions 83,881 83,881 0 0.0%
IRModule.NumIRGlobals 71,238 71,238 0 0.0%
IRModule.NumIRInsts 1,523,308 1,523,308 0 0.0%
IRModule.NumIRValueSymbols 140,111 140,111 0 0.0%
LLVM.NumLLVMBytesOutput 46,239,608 46,239,544 -64 -0.0%
SILModule.NumSILGenFunctions 51,391 51,391 0 0.0%
SILModule.NumSILOptFunctions 91,244 91,244 0 0.0%
Sema.NumConformancesDeserialized 459,331 459,331 0 0.0%
Sema.NumConstraintScopes 1,023,048 1,023,048 0 0.0%
Sema.NumDeclsDeserialized 2,991,313 2,991,313 0 0.0%
Sema.NumDeclsValidated 184,557 184,557 0 0.0%
Sema.NumFunctionsTypechecked 64,396 64,396 0 0.0%
Sema.NumGenericSignatureBuilders 85,489 85,489 0 0.0%
Sema.NumLazyGenericEnvironments 593,878 593,878 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 50,222 50,222 0 0.0%
Sema.NumLazyIterableDeclContexts 432,786 432,786 0 0.0%
Sema.NumTypesDeserialized 3,204,431 3,204,431 0 0.0%
Sema.NumTypesValidated 273,521 273,521 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) (2)
name old new delta delta_pct
LLVM.NumLLVMBytesOutput 38,603,488 38,603,464 -24 -0.0%
time.swift-driver.wall 168.8s 168.8s 5.6ms 0.0%

release detailed

Regressed (0)
name old new delta delta_pct
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (23)
name old new delta delta_pct
AST.NumImportedExternalDefinitions 11,180 11,180 0 0.0%
AST.NumLoadedModules 462 462 0 0.0%
AST.NumTotalClangImportedEntities 32,214 32,214 0 0.0%
AST.NumUsedConformances 9,383 9,383 0 0.0%
IRModule.NumIRBasicBlocks 175,045 175,045 0 0.0%
IRModule.NumIRFunctions 60,293 60,293 0 0.0%
IRModule.NumIRGlobals 58,055 58,055 0 0.0%
IRModule.NumIRInsts 1,342,021 1,342,021 0 0.0%
IRModule.NumIRValueSymbols 107,022 107,022 0 0.0%
LLVM.NumLLVMBytesOutput 38,603,488 38,603,464 -24 -0.0%
SILModule.NumSILGenFunctions 25,973 25,973 0 0.0%
SILModule.NumSILOptFunctions 42,950 42,950 0 0.0%
Sema.NumConformancesDeserialized 154,915 154,915 0 0.0%
Sema.NumConstraintScopes 879,780 879,780 0 0.0%
Sema.NumDeclsDeserialized 255,840 255,840 0 0.0%
Sema.NumDeclsValidated 37,442 37,442 0 0.0%
Sema.NumFunctionsTypechecked 12,616 12,616 0 0.0%
Sema.NumGenericSignatureBuilders 7,656 7,656 0 0.0%
Sema.NumLazyGenericEnvironments 39,188 39,188 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 5,065 5,065 0 0.0%
Sema.NumLazyIterableDeclContexts 24,349 24,349 0 0.0%
Sema.NumTypesDeserialized 309,468 309,468 0 0.0%
Sema.NumTypesValidated 44,452 44,452 0 0.0%

@jrose-apple
Copy link
Contributor Author

Review ping

Copy link
Member

@DougGregor DougGregor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

@@ -2341,20 +2360,17 @@ class AvailabilityWalker : public ASTWalker {
/// Walk a member reference expression, checking for availability.
void walkMemberRef(MemberRefExpr *E) {
// Walk the base in a getter context.
// FIXME: We may need to look at the setter too, if we're going to do
// writeback. The AST should have this information.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do something silly here, where we keep track of the operands of InOutExpr nodes and if E is in that set, we also check the setter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to use LValueAccessKind if Slava doesn't take it out first! But in a separate PR.

None of them actually depend on TypeChecker; they were just using
it as a fast way to get an ASTContext.
This handles the case where just one accessor is deprecated but not
the other, which does come up sometimes in Apple's frameworks.

rdar://problem/18633725
@jrose-apple jrose-apple force-pushed the deprecation-and-depreciation-are-two-different-words branch from 53b9c79 to b0e12f4 Compare March 16, 2018 17:13
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please clean smoke test macOS

@jrose-apple
Copy link
Contributor Author

@swift-ci Please clean smoke test OS X

@jrose-apple jrose-apple merged commit 3354249 into apple:master Mar 16, 2018
@jrose-apple jrose-apple deleted the deprecation-and-depreciation-are-two-different-words branch March 16, 2018 19:47
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.

None yet

3 participants