Skip to content

[AST] Allow access-scope based access check inside inaccessible members #23341

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Mar 15, 2019

This aids expression diagnostics to pinpoint problems related to
chaining of inaccessible members e.g.

struct A {
  struct B {}
}

_ = A.B()

Here both B and its synthesized constructor are inaccessible.

@xedin xedin requested a review from jrose-apple March 15, 2019 22:45
This aids expression diagnostics to pinpoint problems related to
chaining of inaccessible members  e.g.

```swift
struct A {
  struct B {}
}

_ = A.B()
```

Here both `B` and its synthesized constructor are inaccessible.
@xedin xedin force-pushed the allow-access-check-into-inaccesible-members branch from 0a0c393 to d8d5190 Compare March 15, 2019 22:58
@jrose-apple
Copy link
Contributor

Looks good…but what about isSetterAccessibleFrom, and your test case that was failing?

@xedin
Copy link
Contributor Author

xedin commented Mar 15, 2019

@jrose-apple Since check has been moved into checkAccess it would be picked up by isSetterAccessibleFrom right? I'm going to merge my test-case separately, it requires solver changes which I'm currently working on to attempt inaccessible choices.

@jrose-apple
Copy link
Contributor

jrose-apple commented Mar 15, 2019

>< Right, sorry. This looks good; if it passes source compat, go for it. I do think it's worth doing the full compiler perf tests, though; the smoke version only does like three projects, and one of them is currently failing.

@xedin
Copy link
Contributor Author

xedin commented Mar 15, 2019

@swift-ci please test source compatibility

@xedin
Copy link
Contributor Author

xedin commented Mar 15, 2019

@swift-ci please smoke test compiler performance

@xedin
Copy link
Contributor Author

xedin commented Mar 15, 2019

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Mar 16, 2019

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d8d5190

@xedin
Copy link
Contributor Author

xedin commented Mar 16, 2019

@swift-ci please test Linux platform

@swift-ci
Copy link
Contributor

Summary for master smoketest

Unexpected test results, excluded stats for ReactiveCocoa

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) (3)
name old new delta delta_pct
Frontend.NumInstructionsExecuted 106,633,103,657 106,761,517,943 128,414,286 0.12%
LLVM.NumLLVMBytesOutput 6,145,732 6,141,920 -3,812 -0.06%
time.swift-driver.wall 14.0s 14.1s 42.4ms 0.3%

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 1,110 1,110 0 0.0%
AST.NumLoadedModules 1,038 1,038 0 0.0%
AST.NumTotalClangImportedEntities 4,462 4,462 0 0.0%
AST.NumUsedConformances 886 886 0 0.0%
IRModule.NumIRBasicBlocks 18,060 18,032 -28 -0.16%
IRModule.NumIRFunctions 10,562 10,554 -8 -0.08%
IRModule.NumIRGlobals 8,029 8,013 -16 -0.2%
IRModule.NumIRInsts 312,519 312,435 -84 -0.03%
IRModule.NumIRValueSymbols 17,654 17,630 -24 -0.14%
LLVM.NumLLVMBytesOutput 6,145,732 6,141,920 -3,812 -0.06%
SILModule.NumSILGenFunctions 5,382 5,382 0 0.0%
SILModule.NumSILOptFunctions 7,047 7,055 8 0.11%
Sema.NumConformancesDeserialized 17,329 17,297 -32 -0.18%
Sema.NumConstraintScopes 40,476 40,476 0 0.0%
Sema.NumDeclsDeserialized 147,075 147,053 -22 -0.01%
Sema.NumDeclsValidated 11,580 11,580 0 0.0%
Sema.NumFunctionsTypechecked 2,540 2,540 0 0.0%
Sema.NumGenericSignatureBuilders 5,030 5,030 0 0.0%
Sema.NumLazyGenericEnvironments 33,166 33,156 -10 -0.03%
Sema.NumLazyGenericEnvironmentsLoaded 2,036 2,036 0 0.0%
Sema.NumLazyIterableDeclContexts 26,982 26,980 -2 -0.01%
Sema.NumTypesDeserialized 66,852 66,876 24 0.04%
Sema.NumTypesValidated 12,154 12,154 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,942,561,834 140,828,596,194 -113,965,640 -0.08%
LLVM.NumLLVMBytesOutput 7,131,904 7,131,952 48 0.0%
time.swift-driver.wall 26.4s 26.4s -67.0ms -0.25%

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 402 402 0 0.0%
AST.NumLoadedModules 76 76 0 0.0%
AST.NumTotalClangImportedEntities 2,146 2,146 0 0.0%
AST.NumUsedConformances 890 890 0 0.0%
IRModule.NumIRBasicBlocks 20,921 20,921 0 0.0%
IRModule.NumIRFunctions 10,070 10,070 0 0.0%
IRModule.NumIRGlobals 8,102 8,102 0 0.0%
IRModule.NumIRInsts 220,156 220,156 0 0.0%
IRModule.NumIRValueSymbols 17,316 17,316 0 0.0%
LLVM.NumLLVMBytesOutput 7,131,904 7,131,952 48 0.0%
SILModule.NumSILGenFunctions 4,178 4,178 0 0.0%
SILModule.NumSILOptFunctions 5,857 5,857 0 0.0%
Sema.NumConformancesDeserialized 12,445 12,445 0 0.0%
Sema.NumConstraintScopes 39,280 39,280 0 0.0%
Sema.NumDeclsDeserialized 32,447 32,447 0 0.0%
Sema.NumDeclsValidated 7,874 7,874 0 0.0%
Sema.NumFunctionsTypechecked 2,204 2,204 0 0.0%
Sema.NumGenericSignatureBuilders 1,718 1,718 0 0.0%
Sema.NumLazyGenericEnvironments 6,873 6,873 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 130 130 0 0.0%
Sema.NumLazyIterableDeclContexts 4,259 4,259 0 0.0%
Sema.NumTypesDeserialized 18,170 18,170 0 0.0%
Sema.NumTypesValidated 6,942 6,942 0 0.0%

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d8d5190

@jrose-apple
Copy link
Contributor

@swift-ci Please test Linux

@xedin
Copy link
Contributor Author

xedin commented Mar 16, 2019

@swift-ci please test compiler performance

@swift-ci
Copy link
Contributor

Summary for master full

Unexpected test results, excluded stats for CoreStore, Tagged, ProcedureKit, Wordy, Deferred

Regressions found (see below)

Debug-batch

debug-batch 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 26,879,041,108,655 26,715,326,323,577 -163,714,785,078 -0.61%
LLVM.NumLLVMBytesOutput 964,209,412 964,209,844 432 0.0%
time.swift-driver.wall 2542.7s 2539.3s -3.4s -0.13%

debug-batch detailed

Regressed (1)
name old new delta delta_pct
Driver.NumDriverPipePolls 165,335 167,682 2,347 1.42% ⛔
Improved (0)
name old new delta delta_pct
Unchanged (delta < 1.0% or delta < 100.0ms) (98)
name old new delta delta_pct
AST.NumASTBytesAllocated 65,843,701,246 65,809,800,500 -33,900,746 -0.05%
AST.NumDecls 80,388 80,388 0 0.0%
AST.NumDependencies 204,316 204,310 -6 -0.0%
AST.NumImportedExternalDefinitions 1,084,910 1,084,910 0 0.0%
AST.NumInfixOperators 30,900 30,900 0 0.0%
AST.NumLinkLibraries 0 0 0 0.0%
AST.NumLoadedModules 243,405 243,405 0 0.0%
AST.NumLocalTypeDecls 108 108 0 0.0%
AST.NumObjCMethods 9,687 9,687 0 0.0%
AST.NumPostfixOperators 18 18 0 0.0%
AST.NumPrecedenceGroups 14,446 14,446 0 0.0%
AST.NumPrefixOperators 70 70 0 0.0%
AST.NumReferencedDynamicNames 91 91 0 0.0%
AST.NumReferencedMemberNames 3,491,615 3,491,615 0 0.0%
AST.NumReferencedTopLevelNames 269,687 269,687 0 0.0%
AST.NumSourceBuffers 330,950 330,950 0 0.0%
AST.NumSourceLines 2,419,104 2,419,104 0 0.0%
AST.NumSourceLinesPerSecond 2,204,450 2,224,741 20,291 0.92%
AST.NumTotalClangImportedEntities 4,097,454 4,097,182 -272 -0.01%
AST.NumUsedConformances 225,744 225,744 0 0.0%
Driver.ChildrenMaxRSS 105,448,976,384 105,288,396,800 -160,579,584 -0.15%
Driver.DriverDepCascadingDynamic 0 0 0 0.0%
Driver.DriverDepCascadingExternal 0 0 0 0.0%
Driver.DriverDepCascadingMember 0 0 0 0.0%
Driver.DriverDepCascadingNominal 0 0 0 0.0%
Driver.DriverDepCascadingTopLevel 0 0 0 0.0%
Driver.DriverDepDynamic 0 0 0 0.0%
Driver.DriverDepExternal 0 0 0 0.0%
Driver.DriverDepMember 0 0 0 0.0%
Driver.DriverDepNominal 0 0 0 0.0%
Driver.DriverDepTopLevel 0 0 0 0.0%
Driver.NumDriverJobsRun 16,141 16,141 0 0.0%
Driver.NumDriverJobsSkipped 0 0 0 0.0%
Driver.NumDriverPipeReads 181,881 183,678 1,797 0.99%
Driver.NumProcessFailures 0 0 0 0.0%
Frontend.MaxMallocUsage 682,444,112,040 681,565,150,248 -878,961,792 -0.13%
Frontend.NumInstructionsExecuted 26,879,041,108,655 26,715,326,323,577 -163,714,785,078 -0.61%
Frontend.NumProcessFailures 0 0 0 0.0%
IRModule.NumIRAliases 107,127 107,127 0 0.0%
IRModule.NumIRBasicBlocks 3,823,507 3,823,507 0 0.0%
IRModule.NumIRComdatSymbols 0 0 0 0.0%
IRModule.NumIRFunctions 1,790,242 1,790,242 0 0.0%
IRModule.NumIRGlobals 1,848,694 1,848,694 0 0.0%
IRModule.NumIRIFuncs 0 0 0 0.0%
IRModule.NumIRInsts 46,890,851 46,890,851 0 0.0%
IRModule.NumIRNamedMetaData 78,122 78,122 0 0.0%
IRModule.NumIRValueSymbols 3,282,973 3,282,973 0 0.0%
LLVM.NumLLVMBytesOutput 964,209,412 964,209,844 432 0.0%
Parse.NumFunctionsParsed 141,858 141,858 0 0.0%
Parse.NumIterableDeclContextParsed 1,000,666 1,000,666 0 0.0%
SILModule.NumSILGenDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILGenFunctions 925,652 925,652 0 0.0%
SILModule.NumSILGenGlobalVariables 37,118 37,118 0 0.0%
SILModule.NumSILGenVtables 10,668 10,668 0 0.0%
SILModule.NumSILGenWitnessTables 39,057 39,057 0 0.0%
SILModule.NumSILOptDefaultWitnessTables 0 0 0 0.0%
SILModule.NumSILOptFunctions 1,311,433 1,311,433 0 0.0%
SILModule.NumSILOptGlobalVariables 37,865 37,865 0 0.0%
SILModule.NumSILOptVtables 17,156 17,156 0 0.0%
SILModule.NumSILOptWitnessTables 85,971 85,971 0 0.0%
Sema.AccessLevelRequest 2,320,734 2,320,563 -171 -0.01%
Sema.DefaultAndMaxAccessLevelRequest 54,314 54,335 21 0.04%
Sema.DefaultTypeRequest 315,699 315,699 0 0.0%
Sema.EnumRawTypeRequest 16,934 16,934 0 0.0%
Sema.ExtendedNominalRequest 3,694,107 3,691,493 -2,614 -0.07%
Sema.InheritedDeclsReferencedRequest 4,383,518 4,386,864 3,346 0.08%
Sema.InheritedTypeRequest 528,142 527,534 -608 -0.12%
Sema.IsDynamicRequest 1,820,123 1,820,123 0 0.0%
Sema.IsObjCRequest 1,554,869 1,554,764 -105 -0.01%
Sema.MangleLocalTypeDeclRequest 216 216 0 0.0%
Sema.NamedLazyMemberLoadFailureCount 18,752 18,788 36 0.19%
Sema.NamedLazyMemberLoadSuccessCount 17,306,401 17,298,533 -7,868 -0.05%
Sema.NominalTypeLookupDirectCount 28,884,014 28,889,613 5,599 0.02%
Sema.NumConformancesDeserialized 6,439,051 6,439,268 217 0.0%
Sema.NumConstraintScopes 14,718,164 14,717,070 -1,094 -0.01%
Sema.NumConstraintsConsideredForEdgeContraction 38,453,869 38,454,031 162 0.0%
Sema.NumDeclsDeserialized 47,313,672 47,305,785 -7,887 -0.02%
Sema.NumDeclsFinalized 1,634,523 1,634,523 0 0.0%
Sema.NumDeclsTypechecked 890,758 890,758 0 0.0%
Sema.NumDeclsValidated 1,934,359 1,934,356 -3 -0.0%
Sema.NumFunctionsTypechecked 942,937 942,937 0 0.0%
Sema.NumGenericSignatureBuilders 1,133,504 1,132,306 -1,198 -0.11%
Sema.NumLazyGenericEnvironments 9,544,752 9,533,615 -11,137 -0.12%
Sema.NumLazyGenericEnvironmentsLoaded 194,754 194,554 -200 -0.1%
Sema.NumLazyIterableDeclContexts 6,636,985 6,634,657 -2,328 -0.04%
Sema.NumLeafScopes 9,645,054 9,644,286 -768 -0.01%
Sema.NumTypesDeserialized 15,949,838 15,938,304 -11,534 -0.07%
Sema.NumTypesValidated 1,310,227 1,310,224 -3 -0.0%
Sema.NumUnloadedLazyIterableDeclContexts 4,377,301 4,376,041 -1,260 -0.03%
Sema.OverriddenDeclsRequest 7,353,607 7,355,847 2,240 0.03%
Sema.RequirementRequest 62,142 62,141 -1 -0.0%
Sema.SelfBoundsFromWhereClauseRequest 6,172,820 6,173,314 494 0.01%
Sema.SetterAccessLevelRequest 136,606 136,606 0 0.0%
Sema.SuperclassDeclRequest 66,920 66,649 -271 -0.4%
Sema.SuperclassTypeRequest 30,680 30,680 0 0.0%
Sema.TypeDeclsFromWhereClauseRequest 29,866 29,887 21 0.07%
Sema.USRGenerationRequest 12,255,027 12,273,349 18,322 0.15%
Sema.UnderlyingTypeDeclsReferencedRequest 193,774 193,776 2 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 25,602,231,919,369 25,595,909,173,430 -6,322,745,939 -0.02%
LLVM.NumLLVMBytesOutput 785,391,516 785,392,932 1,416 0.0%
time.swift-driver.wall 4578.4s 4577.8s -650.2ms -0.01%

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 214,665 214,665 0 0.0%
AST.NumLoadedModules 16,334 16,334 0 0.0%
AST.NumTotalClangImportedEntities 729,870 729,870 0 0.0%
AST.NumUsedConformances 226,707 226,707 0 0.0%
IRModule.NumIRBasicBlocks 3,233,344 3,233,344 0 0.0%
IRModule.NumIRFunctions 1,491,690 1,491,690 0 0.0%
IRModule.NumIRGlobals 1,629,515 1,629,515 0 0.0%
IRModule.NumIRInsts 29,474,351 29,474,351 0 0.0%
IRModule.NumIRValueSymbols 2,908,733 2,908,733 0 0.0%
LLVM.NumLLVMBytesOutput 785,391,516 785,392,932 1,416 0.0%
SILModule.NumSILGenFunctions 649,405 649,405 0 0.0%
SILModule.NumSILOptFunctions 883,157 883,157 0 0.0%
Sema.NumConformancesDeserialized 2,207,967 2,207,967 0 0.0%
Sema.NumConstraintScopes 13,080,935 13,080,935 0 0.0%
Sema.NumDeclsDeserialized 5,959,238 5,959,238 0 0.0%
Sema.NumDeclsValidated 1,031,871 1,031,871 0 0.0%
Sema.NumFunctionsTypechecked 426,107 426,107 0 0.0%
Sema.NumGenericSignatureBuilders 188,939 188,939 0 0.0%
Sema.NumLazyGenericEnvironments 1,232,035 1,232,035 0 0.0%
Sema.NumLazyGenericEnvironmentsLoaded 20,965 20,965 0 0.0%
Sema.NumLazyIterableDeclContexts 758,183 758,183 0 0.0%
Sema.NumTypesDeserialized 3,156,763 3,156,763 0 0.0%
Sema.NumTypesValidated 613,443 613,443 0 0.0%

@xedin
Copy link
Contributor Author

xedin commented Mar 17, 2019

@jrose-apple looks like one metric regressed in debug mode but I don’t know how bad is that since everything else seems to either go down a bit or stayed the same...

@jrose-apple
Copy link
Contributor

:-( I think the bot is still not measuring the right things, but the pipe polls one isn't something to worry about. (That one needs a big jump to matter.) I think you're good to go!

@xedin xedin merged commit 73d174d into swiftlang:master Mar 18, 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.

4 participants