profile
viewpoint

atrick/swift 0

The Swift Programming Language

atrick/swift-corelibs-foundation 0

The Foundation Project, providing core utilities, internationalization, and OS independence

atrick/swift-corelibs-libdispatch 0

The libdispatch Project, (a.k.a. Grand Central Dispatch), for concurrency on multicore hardware

atrick/swift-evolution 0

This maintains proposals for changes and user-visible enhancements to the Swift Programming Language.

atrick/swift-llbuild 0

A low-level build system, used by the Swift Package Manager

atrick/swift-lldb 0

This is the version of LLDB that supports the Swift programming language & REPL.

atrick/swift-source-compat-suite 0

The infrastructure and project index comprising the Swift source compatibility suite.

Pull request review commentapple/swift

RCIdentity: fix another case of not-RC-identity-preserving casts.

 static CanType getHashableExistentialType(ModuleDecl *M) {   return hashable->getDeclaredInterfaceType()->getCanonicalType(); } +bool SILDynamicCastInst::isRCIdentityPreserving() const {+  // Casts which cast from a trivial type, like a metatype, to something which+  // is retainable, like an AnyObject, are not RC identity preserving.+  // On some platforms such casts dynamically allocate a ref-counted box for the+  // metatype. Naturally that is the place where a new rc-identity begins.+  // Therefore such a cast is introducing a new rc identical object.+  //+  // If RCIdentityAnalysis would look through such a cast, ARC optimizations+  // would get confused and might eliminate a retain of such an object+  // completely.+  if (getSourceLoweredType().isTrivial(*getFunction()))+    return false;++  CanType source = getSourceFormalType();+  CanType target = getTargetFormalType();++  // Be conservative with generic parameters.+  if (source->is<ArchetypeType>() || target->is<ArchetypeType>())

The ArchetypeType check is confusing to me, and "be conservative" doesn't help. In this context, based on all the comments so far, the check implies that an archetype can be substituted with a Metatype. I don't think that true, is it? If so, what would that look like? Instead, the comment should indicate specifically what kind of cast we need to protect against here.

Or is it simply that one of the Archetypes may be a bridged type and one side is non-bridged? In that case, why don't we have the same problem with casting concrete types? (can a concrete bridgeable struct be cast to a bridged class?)

Why don't we treat Archetype's similar to existentials and allow the RC-preserving cast as long as requiresClass() is true for both sides?

eeckstein

comment created time in 5 hours

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentapple/swift

Rewrite LoadBorrowImmutabilityChecker

@swift-ci test source compatibility

atrick

comment created time in 5 hours

pull request commentapple/swift

Rewrite LoadBorrowImmutabilityChecker

@swift-ci test

atrick

comment created time in 5 hours

push eventatrick/swift

Andrew Trick

commit sha 8e3fb44f2d7981fa443c45386342eeb8cdefb440

Rewrite LoadBorrowImmutabilityChecker using AccessPath. The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses. It is also now wholly consistent with the utilities that it uses, so can be reenabled. We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

view details

Andrew Trick

commit sha 0f1beedfb7cb62a8e9c8969152615593a382877e

Reenable load-borrow checker.

view details

push time in 6 hours

pull request commentapple/swift

Rewrite LoadBorrowImmutabilityChecker

@swift-ci test source compatibility

atrick

comment created time in 6 hours

pull request commentapple/swift

Rewrite LoadBorrowImmutabilityChecker

@swift-ci test

atrick

comment created time in 6 hours

push eventatrick/swift

Andrew Trick

commit sha d0efcf26f54b6b3836bfa252bbc945273251ff05

Rewrite LoadBorrowImmutabilityChecker using AccessPath. The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses. It is also now wholly consistent with the utilities that it uses, so can be reenabled. We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

view details

Andrew Trick

commit sha 7a6e9149b75c70e66f4c2d48d2c7eb8120c9b7e4

Reenable load-borrow checker.

view details

push time in 6 hours

push eventatrick/swift

Andrew Trick

commit sha 98db54e492dab243db91eae760e86abf04b244ec

Rewrite LoadBorrowImmutabilityChecker using AccessPath. The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses. It is also now wholly consistent with the utilities that it uses, so can be reenabled. We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

view details

Andrew Trick

commit sha 3fda11b959c9879ce71c31fc2baada53fce1b3fb

Reenable load-borrow checker.

view details

push time in 6 hours

pull request commentapple/swift

Rewrite LoadBorrowImmutabilityChecker

@swift-ci test source compatibility

atrick

comment created time in 6 hours

pull request commentapple/swift

Rewrite LoadBorrowImmutabilityChecker

@swift-ci test

atrick

comment created time in 6 hours

PR opened apple/swift

Rewrite LoadBorrowImmutabilityChecker

Discard a lot of the original implementation.

The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses.

It is also now wholly consistent with the utilities that it uses, so can be reenabled.

We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

+462 -600

0 comment

6 changed files

pr created time in 6 hours

push eventatrick/swift

Butta

commit sha 69d04aad08da3245f87c6a2df35869126d48b55e

[linux] remove absolute rpath of /usr/lib/swift/linux added to many shared libraries This was presumably added as a backup, in case the libraries in a toolchain couldn't be found, but will not work well, so take it out.

view details

Martin Boehme

commit sha a5e953b69009b59541420d06496206a26961a976

Add support for calling C++ constructors. Because C++ constructors always take a `this` pointer to the object to be initialized, we mark the SIL function return type with the `@out` attribute. On the IRGen side, we retrofit support for formal indirect return values as well as thin metatypes.

view details

Martin Boehme

commit sha 7ad2eef26508ad92d8d92f2d5546913c0ced3bbd

Only import constructors marked `noexcept`.

view details

Martin Boehme

commit sha 384854810a60a69c8df8a8c0248e209adc28c295

Revert "Only import constructors marked `noexcept`." This reverts commit 29650d8c1f302708a32304d49c703c9ddbf30b75. As discussed here, we want to import all constructors (whether they are marked `noexcept` or not) as non-throwing initializers; https://forums.swift.org/t/handling-c-exceptions/34823/50

view details

Martin Boehme

commit sha fd00bc1f01357ecd264b8216373c23014771c124

Move tests from `CXXInterop` to `Interop/Cxx`. This is the canonical location that we've agreed on.

view details

Martin Boehme

commit sha e6067275a6659cfab8640e68e93a5bba36ddca20

Duplicate changes to GenClangType in ClangTypeConverter. See discussion here: https://github.com/apple/swift/pull/30630#discussion_r398967412

view details

Martin Boehme

commit sha b2c5a3eeed4e0d80c819f98c816481fbedc49526

Add a constructor thunk if required to add additional constructor arguments. Also add more IR tests and make various other changes.

view details

Martin Boehme

commit sha 3066e16c37e26a5fea370877409b4d0bd1c0fea6

Remove redundant "cxx" from test names.

view details

Martin Boehme

commit sha 5644137ea0696164c5b5835179b1ec450d508c88

Eliminate duplication of code for adding empty argument names.

view details

Martin Boehme

commit sha bed26039446c189a82c453126e0a622e43c6256d

Various changes after merging master: - Adapt tests to changes that have happened in the meantime (e.g. `HasVirtualBase` is rightly no longer considered loadable) - Don't import copy or move constructors (noticed this because references are now imported correctly, so copy and move constructors suddenly started showing up in the SIL test) - Don't try to define an implicitly-deleted default constructor (this previously broke loadable-types-silgen.swift)

view details

Martin Boehme

commit sha beaaa742c3e774b6739de26bb1a3f0c8761512a5

Don't put an `sret` attribute on the `this` argument.

view details

Martin Boehme

commit sha 8416ccfa06d05da67af70a8ed57a2f120ea251b2

Rename constructors-ir.swift to constructors-irgen.swift.

view details

Martin Boehme

commit sha 8f6042aa0870a527505262c7dbe89ec7ffe20e12

Add additional IR tests for a class without a virtual base class.

view details

Martin Boehme

commit sha c9405fb7fc338f59db4386488245a3ce82227e00

Add Windows-name-mangled version of symbol to SIL test.

view details

Martin Boehme

commit sha cb4ddda6e2292c584cb83905f3f9df17a4e017f1

Avoid crashing if lldb imports C++ structs without enabling C++ interop.

view details

Martin Boehme

commit sha 33e8c717f2682b913eb04e1c7746c84315be90ef

Update comment in VisitCXXRecordDecl().

view details

Martin Boehme

commit sha 7e8ea120701b33958a1adca9e885a99f5d583607

Respond to review comments.

view details

Martin Boehme

commit sha 1ce3753d08522cefe255f4acf498dba5085aa60a

Another response to review comments.

view details

Martin Boehme

commit sha faca489c6f524096019fd124cba847949972e0db

Add a test that Objective-C types passed to a C++ constructor are bridged correctly.

view details

Martin Boehme

commit sha 83b51b95b534108494de1032bb4e098274fe606b

Add SILGen and IRGen tests for passing Objective-C types to C++ constructors.

view details

push time in 6 hours

pull request commentapple/swift

AccessPath: Look past class casts when finding the reference root.

@swift-ci smoke test and merge

atrick

comment created time in a day

push eventatrick/swift

Andrew Trick

commit sha f31296d63b6e5fcc66b5acfd4cc26ade683006c7

Fix isRCIdentityPreservingCast to handle trivial-to-reference casts And add assertions.

view details

Andrew Trick

commit sha d8dd6208e956263cad81efe2c86b026126924920

Test cases for AccessedStorage with reference casts.

view details

push time in a day

push eventatrick/swift

Butta

commit sha 69d04aad08da3245f87c6a2df35869126d48b55e

[linux] remove absolute rpath of /usr/lib/swift/linux added to many shared libraries This was presumably added as a backup, in case the libraries in a toolchain couldn't be found, but will not work well, so take it out.

view details

Martin Boehme

commit sha a5e953b69009b59541420d06496206a26961a976

Add support for calling C++ constructors. Because C++ constructors always take a `this` pointer to the object to be initialized, we mark the SIL function return type with the `@out` attribute. On the IRGen side, we retrofit support for formal indirect return values as well as thin metatypes.

view details

Martin Boehme

commit sha 7ad2eef26508ad92d8d92f2d5546913c0ced3bbd

Only import constructors marked `noexcept`.

view details

Martin Boehme

commit sha 384854810a60a69c8df8a8c0248e209adc28c295

Revert "Only import constructors marked `noexcept`." This reverts commit 29650d8c1f302708a32304d49c703c9ddbf30b75. As discussed here, we want to import all constructors (whether they are marked `noexcept` or not) as non-throwing initializers; https://forums.swift.org/t/handling-c-exceptions/34823/50

view details

Martin Boehme

commit sha fd00bc1f01357ecd264b8216373c23014771c124

Move tests from `CXXInterop` to `Interop/Cxx`. This is the canonical location that we've agreed on.

view details

Martin Boehme

commit sha e6067275a6659cfab8640e68e93a5bba36ddca20

Duplicate changes to GenClangType in ClangTypeConverter. See discussion here: https://github.com/apple/swift/pull/30630#discussion_r398967412

view details

Martin Boehme

commit sha b2c5a3eeed4e0d80c819f98c816481fbedc49526

Add a constructor thunk if required to add additional constructor arguments. Also add more IR tests and make various other changes.

view details

Martin Boehme

commit sha 3066e16c37e26a5fea370877409b4d0bd1c0fea6

Remove redundant "cxx" from test names.

view details

Martin Boehme

commit sha 5644137ea0696164c5b5835179b1ec450d508c88

Eliminate duplication of code for adding empty argument names.

view details

Martin Boehme

commit sha bed26039446c189a82c453126e0a622e43c6256d

Various changes after merging master: - Adapt tests to changes that have happened in the meantime (e.g. `HasVirtualBase` is rightly no longer considered loadable) - Don't import copy or move constructors (noticed this because references are now imported correctly, so copy and move constructors suddenly started showing up in the SIL test) - Don't try to define an implicitly-deleted default constructor (this previously broke loadable-types-silgen.swift)

view details

Martin Boehme

commit sha beaaa742c3e774b6739de26bb1a3f0c8761512a5

Don't put an `sret` attribute on the `this` argument.

view details

Martin Boehme

commit sha 8416ccfa06d05da67af70a8ed57a2f120ea251b2

Rename constructors-ir.swift to constructors-irgen.swift.

view details

Martin Boehme

commit sha 8f6042aa0870a527505262c7dbe89ec7ffe20e12

Add additional IR tests for a class without a virtual base class.

view details

Martin Boehme

commit sha c9405fb7fc338f59db4386488245a3ce82227e00

Add Windows-name-mangled version of symbol to SIL test.

view details

Martin Boehme

commit sha cb4ddda6e2292c584cb83905f3f9df17a4e017f1

Avoid crashing if lldb imports C++ structs without enabling C++ interop.

view details

Martin Boehme

commit sha 33e8c717f2682b913eb04e1c7746c84315be90ef

Update comment in VisitCXXRecordDecl().

view details

Martin Boehme

commit sha 7e8ea120701b33958a1adca9e885a99f5d583607

Respond to review comments.

view details

Martin Boehme

commit sha 1ce3753d08522cefe255f4acf498dba5085aa60a

Another response to review comments.

view details

Martin Boehme

commit sha faca489c6f524096019fd124cba847949972e0db

Add a test that Objective-C types passed to a C++ constructor are bridged correctly.

view details

Martin Boehme

commit sha 83b51b95b534108494de1032bb4e098274fe606b

Add SILGen and IRGen tests for passing Objective-C types to C++ constructors.

view details

push time in a day

pull request commentapple/swift

Add more file-level comments to MemAccessUtils.

@swift-ci smoke test and merge

atrick

comment created time in a day

PR opened apple/swift

Add more file-level comments to MemAccessUtils.

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+26 -9

0 comment

1 changed file

pr created time in a day

push eventatrick/swift

Andrew Trick

commit sha 9f83ceda3f24ba689d0a7c25b32ef82c2490ce61

Add more file-level comments to MemAccessUtils.

view details

push time in a day

create barnchatrick/swift

branch : comment-memutils

created branch time in a day

push eventatrick/swift

Andrew Trick

commit sha 1d2d9b0e19a76de76a702e59bdba9db7df19d0cd

Improve SimplifyCFG: remove conditional branches to the same target.

view details

Andrew Trick

commit sha 628b53784d06d086f5c2eacb354d28d60d7086b8

SimplifyCFG: avoid introducing new critical edges. Passes will end up resplitting them, forcing SimplifyCFG to continually rerun. Also, we want to allow SIL utilities to assume no critical edges, and avoid the need for several passes to internally split edges and modify the CFG for no reason.

view details

Andrew Trick

commit sha b69b3493e7aa6e80ea27144102c95d9dd68918b9

SILInliner: Unconditional branches are essentially free.

view details

push time in a day

pull request commentapple/swift

Avoid introducing critical edges in SimplifyCFG

All tests passed, but the performance regressions are still blocked on my fixes so semantic call inlining from a year ago. I'll see if I can get those fixes checked in first.

atrick

comment created time in a day

pull request commentapple/swift

Avoid introducing critical edges in SimplifyCFG

@swift-ci benchmark

atrick

comment created time in 2 days

pull request commentapple/swift

Avoid introducing critical edges in SimplifyCFG

@swift-ci test

atrick

comment created time in 2 days

PR opened apple/swift

Avoid introducing critical edges in SimplifyCFG

Passes will end up resplitting them, forcing SimplifyCFG to continually rerun.

Also, we want to allow SIL utilities to assume no critical edges, and avoid the need for several passes to internally split edges and modify the CFG for no reason.

Preparation for adding invariants that simplify working with OSSA form and opaque values.

+67 -55

0 comment

6 changed files

pr created time in 2 days

push eventatrick/swift

Andrew Trick

commit sha 17490d0383dba191ca4ee5cd6695f1813b4de681

SimplifyCFG: avoid introducing new critical edges. Passes will end up resplitting them, forcing SimplifyCFG to continually rerun. Also, we want to allow SIL utilities to assume no critical edges, and avoid the need for several passes to internally split edges and modify the CFG for no reason.

view details

push time in 2 days

create barnchatrick/swift

branch : simplify-simplifycfg

created branch time in 2 days

push eventatrick/swift

Richard Wei

commit sha 8df2d34603b737b00af323118c1017789db1c8e5

Address review comment.

view details

Joe Groff

commit sha 023066c1966c63ab3b7a4baee31ac24d29b7de36

SILGen: Relax assertion that incorrectly tripped on lowered opaque capture types. When lowering the SILConstantInfo for a closure implementation type with captures, we are more conservative about substituting opaque types in the capture, since the underlying types may only be available in the local context. This means the SILConstantInfo type may not in fact be exactly what you get from `SILFunction::getFunctionTypeInContext` referencing the implementation function from its originating context, since those opaque types will be substituted in the local context. Fixes SR-13480 | rdar://problem/68159831.

view details

vermont42

commit sha c311e451951b28afacebae69107cef28e4af9e44

Implements SR-11580

view details

Xi Ge

commit sha 36fe81141f18b573072308eabf6a17ef65edecd0

Merge pull request #33942 from nkcsgexi/add-abi-breakage ABI checker: when invoking via build system, explicitly mention ABI breakge in diagnostics

view details

Michael Gottesman

commit sha 9010c1b6f338b23e62b69464105634e55df40d17

Merge pull request #33760 from gottesmm/pr-1d2143f460a9d74a60af3be92d03f404a9cde805 Revert "build-script: remove dead CMake options for Swift"

view details

Michael Gottesman

commit sha 5717d8713a6735370ae6e6269ea1305c2f39e4d4

[build-script-impl] Add a comment explaining why an option isn't truly dead as per reviewers suggestion. In the original revert, this option was used in two places and I added a comment only on the first one. This copies the comment onto the second usage of the option. Thanks to @edymtt and @compnerd for catching my careless error!

view details

Dave Lee

commit sha 0c79763b332c720869122c4bea1e767356e8024f

[build-script] Cleanup source directory layout help

view details

Dave Lee

commit sha 7168d18e1447e627c42242b82f9f3b6a82321ab7

s/true/false/

view details

swift-ci

commit sha eccf9b3f759aee3239947b3a9e28dbd863d6a811

Merge pull request #33927 from rxwei/clarify-derived-conformances-conditions

view details

swift-ci

commit sha b96eb1d6a424161b1eafe4ae3dd16faa32549d8b

Merge pull request #33905 from apple/dl/build-script-Cleanup-source-directory-layout-help

view details

Meghana Gupta

commit sha 581f6111951a3be65a8a4fdb1433362729e55f07

ARCSequenceOpts: Add LoopSummary verifier (#33810) ARCSequenceOpts with loop support works on regions inside out. While processing an outer region, it uses summary from the inner loop region to compute RefCountState transitions used for CodeMotionSafe optimization. We do not compute the loop summary by iterating over it twice or iterating until a fixed point is reached. Instead loop summary is just a list of refcount effecting instructions. And BottomUpRefCountState::updateForDifferentLoopInst and TopDownRefCountState::updateForDifferentLoopInst are used to compute the RefCountState transition when processing the inner loop region. These functions are very conservative and the flow sensitive nature of the summarized instructions do no matter. This PR adds a verifying assert to confirm this.

view details

Vedant Kumar

commit sha 43935527f20d4d30f30e329a552a36859b4499a4

[Profiler] Increment closure body count prior to the prolog (#33946) This fixes a 'SILBuilder has no valid insertion point' assertion failure seen when compiling various projects from the source compat suite. rdar://68759819

view details

Robert Widmann

commit sha 6d3ee1aae365415a5e96f60ff01c0dde1659bdef

Merge pull request #33936 from apple/cdecl-CommandLineStressTest test: Replace _silgen_name w/ _cdecl in CommandLineStressTest

view details

Vedant Kumar

commit sha ab817e83e02c733164ef833d44fee3642ad78edd

[Profiler] Increment function body count prior to the prolog This fixes another 'SILBuilder has no valid insertion point' assertion failure seen when compiling Carthage. rdar://68759819

view details

Hamish Knight

commit sha add22194fd90cd2d2f1ca47520d0571dc72a5a85

[SILGen] Allow lazy type-checking Remove the type-checking call from OptimizedIRRequest, and sink it down into SILGen and IRGen when we come to emit the source files.

view details

Hamish Knight

commit sha 44a8b56168711f5650ce2848842de7c57c137bf2

Rename getFiles to getFilesToEmit Rename the member on ASTLoweringDescriptor and IRGenDescriptor to make it more explicit it returns the files that need emitting, rather than just the files that happen to be present. This distinction will become important once we start emitting code only for a specific set of symbols.

view details

Hamish Knight

commit sha cb099454d64d878fee791bb676cc4ca0c9dba4a7

Allow SILGen to emit only a specific set of SILDeclRefs Extend ASTLoweringDescriptor to store a set of SILDeclRefs to emit through `emitFunctionDefinition`.

view details

Hamish Knight

commit sha 088a86eccb80ceb402a95027b2848724523d40e8

Introduce SymbolObjectCodeRequest Add SymbolObjectCodeRequest, which emits object code for a specific set of symbols by querying TBDGen for the source of the symbols, and asking SILGen (and eventually IRGen) to emit them.

view details

Ben Rimmington

commit sha 0c6129daf2da1b45e36f588fcd4727f7c4674dd1

[docs] Fix broken links in the documentation index (#33829)

view details

Xiaodi Wu

commit sha 7898f0b7ad429652b2c35bccb2164df25f35e847

[stdlib] Silence signaling NaN in generic conversions (#33902)

view details

push time in 2 days

PullRequestReviewEvent

pull request commentapple/swift

AccessPath: Look past class casts when finding the reference root.

@swift-ci test

atrick

comment created time in 2 days

push eventatrick/swift

Erik Eckstein

commit sha 007351223eb96a1a0132953a219b12d9b06ec0e7

MemBehavior: handle begin_access when checking for apply side-effects.

view details

Erik Eckstein

commit sha 68db2e7c6ce6f2bf9cdce1add556ef69971bc6a1

TempRValueOpt: don't use collectLoads in tryOptimizeStoreIntoTemp This refactoring removes a lot of special-casing in collectLoads and also makes tryOptimizeStoreIntoTemp simpler. It's a NFC.

view details

Erik Eckstein

commit sha 673b8873ab2930c0497944411a28070877883591

TempRValueOpt: refactoring: simplify the signature of collectLoads It's sufficient to pass the operand instead of the operand, the user and the operand value. NFC.

view details

Erik Eckstein

commit sha d569031f1a367281871ba18c92f385ffa0cafa7d

TempRValueOpt: move the mayWrite-check for applies from collectLoads to checkNoSourceModification ... where it belongs. This is mostly refactoring, but it also fixes a bug: we don't recurse into a begin_access in collectLoads. If there is an apply in such a scope, the mayWrite-check wouldn't be done. In checkNoSourceModification all instructions are visited, so the check is always done.

view details

Erik Eckstein

commit sha 7c293d8de960045fbe2d1717aa21481d801cd036

TempRValueOpt: fix the handling of begin_access Consider the related end_access instructions as uses to correctly mark the end of the lifetime of the temporary. This fixes a miscompile in case there is a modification of the copy-source between an begin_access and end_access.

view details

Erik Eckstein

commit sha 6310dfcc939d88664d1fb63a908f1139e9cf6b47

TempRValueOpt: fix the handling of load [take] load [take] was not considered as a use and it was not detected if it's in a different basic block. This fixes a miscompile in case there is a modification of the copy-source before a load [take]. rdar://problem/69757314

view details

Erik Eckstein

commit sha 9a10ec7d581345cbfcd15990c54848ca1b25dc8c

SILBuilder: add an API to insert _after_ an instruction. ... and use that API in FullApplySite::insertAfterInvocation. Also change FullApplySite::insertAfterInvocation/insertAfterFullEvaluation to directly pass a SILBuilder instead of just an insertion point to the callback. This makes more sense (given the function names) and simplifies the usages. It's a NFC.

view details

Erik Eckstein

commit sha 4557f151b1e90b874f77736bdf4ab20df8affe69

TempRValueOpt: fix the placement of destroy_addr in case of a copy_addr [take] Instead of reusing the existing destroy_addr (or load/copy_addr [take]) of the temporary, insert a new destroy_addr - at the correct location. This fixes a memory lifetime failure in case the copy-source is modified (actually: re-initialized) after the last use of the temporary: E.g. (before copy elimination): copy_addr [take] %src to [initialization] %temp %x = load %temp // last use of %temp store %y to [init] %src destroy_addr %temp The correct location for the destroy_addr is after the last use (after copy elimination): %x = load %src destroy_addr %src store %y to [init] %src rdar://problem/69757314

view details

Erik Eckstein

commit sha 262c7b251f9d650231a394bedcd5d12ca527cc92

TempRValueOpt: don't allow copy_addr [take] from a projection of the temporary. This fixes a memory lifetime failure.

view details

Erik Eckstein

commit sha 1e5f3bd253f0fbfab7f39f176f321b3dce94d11b

TempRValueOpt: only do the check for "unusual" temp object destruction in non-OSSA mode. In OSSA, memory locations are always destroyed in a "visible" way, e.g. with destroy_addr or load [take].

view details

Xi Ge

commit sha b9ade70c5d3f9973ba2358655912e970451b1d9b

swift_build_sdk_interfaces.py: create directory under dry-run mode Users may install a different version of SDK from the one found in the originally downloaded toolchain. Thus, we may need to create a new directory structure instead of using the original one in the toolchain, especially if the SDK under use has a different version number. rdar://67951012

view details

Luciano Almeida

commit sha 883d583a2fc6e5c74a58b379ba19a5d2907dabdd

[CSSimplify] Make sure visit and record holes recursivelly for dependent member type

view details

Luciano Almeida

commit sha 885815227f6c1321e48fa2a2300171306719c6fc

[tests] Add regression tests for SR-13732

view details

Mishal Shah

commit sha 23cde90b29bb2a0cf02dfee9fe45e7a5c36ec7b4

Update the Xcode version in How to Guides

view details

Mishal Shah

commit sha bd6cc586d5c8d826c798993e21e86477b70805db

Update the Xcode version in Getting Started doc

view details

Slava Pestov

commit sha 5d6cf5cd96deab6f78263a09a5dd9e94cb63fe0b

Sema: Fix failure to diagnose throwing expressions inside string interpolations We need to preserve the DiagnoseErrorOnTry bit stored in the Context when exiting a ContextScope. Otherwise, we fail to produce a diagnostic if the 'try' expression pushes an intertwining Context, such as a string interpolation or 'await'. Fixes <https://bugs.swift.org/browse/SR-13654>, <rdar://problem/69958774>.

view details

3405691582

commit sha f4b71b5077cd838ffe7caa8c1ae57653f033b766

[build] OpenBSD can install XCTest.

view details

Luciano Almeida

commit sha 907b06901f4fc114f1295cc3c3547b454c3bc2e9

Merge pull request #34330 from LucianoPAlmeida/SR-13732-crash-invalid [SR-13732] [Sema] Fix crash on simplifyFix constraint for tuple mismatch

view details

Slava Pestov

commit sha 2ae0c80c1a4116836ef528060cc01e37bdfba789

Merge pull request #34340 from slavapestov/fix-effect-check-context-state Sema: Fix failure to diagnose throwing expressions inside string interpolations

view details

Xi Ge

commit sha 3029ce8970a5083ec86d4576964be488e20e2164

Merge pull request #34336 from nkcsgexi/67951012-2 swift_build_sdk_interfaces.py: create directory under dry-run mode

view details

push time in 2 days

Pull request review commentapple/swift

[concurrency] implement the 'unsafe' option for @actorIndependent

 class ActorIsolation {     /// meaning that it can be used from any actor but is also unable to     /// refer to the isolated state of any given actor.     Independent,+    /// Semantically the same as Independent, but drops the static safety check+    /// that prevents the use of actor-independent mutable state.+    IndependentUnsafe,

If Independent and IndependentUnsafe have the same semantics, then a well-defined program will have identical behavior in both cases. If that's the case, then this should be called IndependentUnchecked.

However, if this attribute is meant to allow state to be accessed across actors, leaving it up to the programmer to protect that state via synchronization or same-thread requirements, then IndependentUnsafe is the correct term, but it definitely does not have the same semantics.

kavon

comment created time in 2 days

PullRequestReviewEvent

pull request commentapple/swift

[WIP] Break loadborrow

This PR exposes rdar://70403601 (After python upgrade, Ubuntu bot will not print error output: UnicodeDecodeError: 'ascii' codec can't decode byte 0xcf in position 1384: ordinal not in range(128))

atrick

comment created time in 2 days

PR closed apple/swift

[WIP] break a semantic ARC test

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+1 -1

3 comments

1 changed file

atrick

pr closed time in 2 days

push eventapple/swift

Andrew Trick

commit sha 85ff15acd30f6b1b6e5ead370ec9d99e6a67b0ab

Add indexTrieRoot to the SILModule to share across Analyses. ...and avoid reallocation. This is immediately necessary for LICM, in addition to its current uses. I suspect this could be used by many passes that work with addresses. RLE/DSE should absolutely migrate to it.

view details

Andrew Trick

commit sha 7774f06f10eabe16ef6b157f92e8fab5e9e5f029

Change IndexTrie to allow signed indices

view details

Andrew Trick

commit sha 2767b51d615d5fcf464557ef404c491f4259e262

Change Projection to support signed indices. Change ProjectionIndex for ref_tail_addr to std::numeric_limits<int>::max(); This is necessary to disambiguate the tail elements from ref_element_addr field zero.

view details

Andrew Trick

commit sha 7554a6aa3134b8b6078aac4ad21b58871a55d757

Fix a pointer addition bug in SwiftReflectionTest.

view details

Andrew Trick

commit sha 92a181671ea7a622286281a81a97a0b2f032c76d

Fix ValueTracking isUniquelyIdentified to use AccessedStorage. To clarify and unify logic, improve precision, and behave consistently with other code that does the same thing.

view details

Andrew Trick

commit sha cc0aa2f8b8740221420ac35e86d7e67cbcd8529b

Add an AccessPath abstraction and formalize memory access Things that have come up recently but are somewhat blocked on this: - Moving AccessMarkerElimination down in the pipeline - SemanticARCOpts correctness and improvements - AliasAnalysis improvements - LICM performance regressions - RLE/DSE improvements Begin to formalize the model for valid memory access in SIL. Ignoring ownership, every access is a def-use chain in three parts: object root -> formal access base -> memory operation address AccessPath abstracts over this path and standardizes the identity of a memory access throughout the optimizer. This abstraction is the basis for a new AccessPathVerification. With that verification, we now have all the properties we need for the type of analysis requires for exclusivity enforcement, but now generalized for any memory analysis. This is suitable for an extremely lightweight analysis with no side data structures. We currently have a massive amount of ad-hoc memory analysis throughout SIL, which is incredibly unmaintainable, bug-prone, and not performance-robust. We can begin taking advantage of this verifably complete model to solve that problem. The properties this gives us are: Access analysis must be complete over memory operations: every memory operation needs a recognizable valid access. An access can be unidentified only to the extent that it is rooted in some non-address type and we can prove that it is at least *not* part of an access to a nominal class or global property. Pointer provenance is also required for future IRGen-level bitfield optimizations. Access analysis must be complete over address users: for an identified object root all memory accesses including subobjects must be discoverable. Access analysis must be symmetric: use-def and def-use analysis must be consistent. AccessPath is merely a wrapper around the existing accessed-storage utilities and IndexTrieNode. Existing passes already very succesfully use this approach, but in an ad-hoc way. With a general utility we can: - update passes to use this approach to identify memory access, reducing the space and time complexity of those algorithms. - implement an inexpensive on-the-fly, debug mode address lifetime analysis - implement a lightweight debug mode alias analysis - ultimately improve the power, efficiency, and maintainability of full alias analysis - make our type-based alias analysis sensistive to the access path

view details

Andrew Trick

commit sha 1e9c4d13ad7caf62665ef996e898ec21f70e3fa1

Update LoadCopyToLoadBorrow for MemAccessUtils API.

view details

Andrew Trick

commit sha 7e435fa2de512117028e202ea001c28724674a80

Add AccessPath support to the AccessedStorageDumper pass. Add a flag: enable-accessed-storage-dump-uses

view details

Andrew Trick

commit sha b2d1ac16315b2ecda356d0b873b29744eca675ce

Add AccessPathVerification pass and run it in the pipeline.

view details

Andrew Trick

commit sha 800c061d00d57f0afeb330e5585312a3d73971c2

accessed_storage.sil tests

view details

Andrew Trick

commit sha b8f3f9c84666301bb33ec68d7dea4305550b6d55

accesspath_uses.sil tests

view details

Andrew Trick

commit sha 0f428c2c06d5698aa750016ae60291424325c1bc

alias-analysis test

view details

Andrew Trick

commit sha 391b06d20b1bab6be5c289d66a3a56de793eef8d

RLE tests for boundary Projection indices.

view details

Andrew Trick

commit sha 712e1abec67af6d33b7a7465d4c4c0c52fd1c55a

AccessedStorage and AccessPath documentation.

view details

Andrew Trick

commit sha 9c69d0242d4cf191e06ae8d2122e1265f9ddc4cc

MemAccessUtils comment

view details

Andrew Trick

commit sha 6f2cda1390833cca96a8087a72fe348e74733713

Add AccessUseVisitor and cleanup related APIs. Add AccesssedStorage::compute and computeInScope to mirror AccessPath. Allow recovering the begin_access for Nested storage. Adds AccessedStorage.visitRoots().

view details

Andrew Trick

commit sha b272dc5e1a8357c7d882027e6bf4a7136de265ad

Cache 'isLet' within AccessedStorage. Compute 'isLet' from the VarDecl that is available when constructing AccessedStorage so we don't need to recover the VarDecl for the base later. This generally makes more sense and is more efficient, but it will be necessary when we look past class casts when finding the reference root.

view details

Andrew Trick

commit sha f6b32aedcd0afb9962645d1ae7a8b33cf35c5998

Add AccessedStorageWithBase to conviently recover the base's VarDecl

view details

Andrew Trick

commit sha 53eebddbb2f63d3f141667ee4195d3e91478a179

Temporarily disable the load-borrow checker. A rewrite is ready and will be merged ASAP.

view details

Andrew Trick

commit sha 5e0c8f9b50d5d7b40f2fa1db19363ae1db6b1b4d

The verifier should only output to llvm::errs()

view details

push time in 2 days

PR merged apple/swift

Add an AccessPath abstraction and formalize memory access

Things that have come up recently but are somewhat blocked on this:

- Moving AccessMarkerElimination down in the pipeline
- SemanticARCOpts correctness and improvements
- AliasAnalysis improvements
- LICM performance regressions
- RLE/DSE improvements

Begin to formalize the model for valid memory access in SIL. Ignoring
ownership, every access is a def-use chain in three parts:

object root -> formal access base -> memory operation address

AccessPath abstracts over this path and standardizes the identity of a
memory access throughout the optimizer. This abstraction is the basis
for a new AccessPathVerification.

With that verification, we now have all the properties we need for the
type of analysis requires for exclusivity enforcement, but now
generalized for any memory analysis. This is suitable for an extremely
lightweight analysis with no side data structures. We currently have a
massive amount of ad-hoc memory analysis throughout SIL, which is
incredibly unmaintainable, bug-prone, and not performance-robust. We
can begin taking advantage of this verifably complete model to solve
that problem.

The properties this gives us are:

Access analysis must be complete over memory operations: every memory
operation needs a recognizable valid access. An access can be
unidentified only to the extent that it is rooted in some non-address
type and we can prove that it is at least *not* part of an access to a
nominal class or global property. Pointer provenance is also required
for future IRGen-level bitfield optimizations.

Access analysis must be complete over address users: for an identified
object root all memory accesses including subobjects must be
discoverable.

Access analysis must be symmetric: use-def and def-use analysis must
be consistent.

AccessPath is merely a wrapper around the existing accessed-storage
utilities and IndexTrieNode. Existing passes already very succesfully
use this approach, but in an ad-hoc way. With a general utility we
can:

- update passes to use this approach to identify memory access,
  reducing the space and time complexity of those algorithms.

- implement an inexpensive on-the-fly, debug mode address lifetime analysis

- implement a lightweight debug mode alias analysis

- ultimately improve the power, efficiency, and maintainability of
  full alias analysis

- make our type-based alias analysis sensistive to the access path
+4034 -645

22 comments

43 changed files

atrick

pr closed time in 2 days

pull request commentapple/swift

[WIP] Break loadborrow

@swift-ci test linux

atrick

comment created time in 5 days

PR opened apple/swift

[WIP] Break loadborrow

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+4859 -1253

0 comment

51 changed files

pr created time in 5 days

create barnchatrick/swift

branch : break-loadborrow

created branch time in 5 days

push eventatrick/swift

Keith Smiley

commit sha ae0c380f1b0f37e11b111a06634dd4c64e67b96c

Improve -*prefix-map help text Before: ``` -coverage-prefix-map <value> -debug-prefix-map <value> ``` After: ``` -coverage-prefix-map <prefix=replacement> -debug-prefix-map <prefix=replacement> ```

view details

Dave Lee

commit sha 52bbe11161f908d4c58cbdd2a423c68b9688b191

[build] Remove dash-dash from build-presets.ini (NFC)

view details

Arnold Schwaighofer

commit sha 96a0d0e5840045e25d2c05f02999972f804201df

Rename various IncludeUsableFromInlineAndInlineable to IncludeUsableFromInline `@inlinable` implies `@usableFromInline`. NFC intended.

view details

Xi Ge

commit sha 29093b15df24e98dda65cd51e26a7bd618a2d709

Driver: -L= belongs to the linker option group rdar://70300892

view details

Arnold Schwaighofer

commit sha a7259558238eadd1c69a234baef1b67ab45f8492

More renaming

view details

Arnold Schwaighofer

commit sha d6d921d7fafcfa67e500e6013f93ac30f6248b79

IRGen: Fix fixLifetime emission of enums rdar://70270724

view details

Arnold Schwaighofer

commit sha 1c85d201921abcedbd3a693229f597a6d015f81d

Try to appease 32bit tests

view details

Holly Borla

commit sha 1e0038c3be0f6f2fbe1ba6ccb7fa394b7320aa22

[ConstraintSystem] Remove implementation of operator designated types in the solver.

view details

Holly Borla

commit sha 4c0f49f7a6a7a642cd57aeec70e8b392f3296cf1

[ConstraintSystem] Remove selectApplyDisjunction, which was only used by the operator designated types implementation.

view details

Vedant Kumar

commit sha 7145afbd9d5683eeb54d142b0eab5ea2ba91fe32

[Demangler] Null-check a pointer before using it in arithmetic This addresses a UBSan -fsanitize=null diagnostic seen when compiling the stdlib: runtime error: applying non-zero offset 128 to null pointer

view details

Slava Pestov

commit sha 3d0e35e082c5f18da4a6eff30fe08706f26695fa

Sema: Remove a bit of dead code

view details

Slava Pestov

commit sha 94e999a1b55dd14284d96b60e1b67de7aae71dac

Sema: Pull availability checking out of resolveType() We used to diagnose references to unavailable declarations in two places: - inside Exprs, right after type checking the expression - inside TypeReprs, from resolveType() In broad terms, resolveType() is called with TypeReprs stored inside both Stmts and Decls. To handle the first case, I added a new overload of diagAvailability() that takes a Stmt, to be called from typeCheckStmt(). This doesn't actually walk into any Exprs stored inside the statement; this means it only walks Patterns and such. For the second case, a new DeclAvailabilityChecker is now defined in TypeCheckAccess.cpp. It's structure is analogous to the other three walkers there: - AccessControlChecker - UsableFromInlineChecker - ExportabilityChecker The new implementation of availability checking for types introduces a lot more code than the old online logic it replaces. However, I hope to consolidate some of the code duplication among the four checkers that are defined in TypeCheckAccess.cpp, and do some other cleanups that will make the benefit of the new approach apparent.

view details

Slava Pestov

commit sha baa9d7142aa1e24f4cf07672d250307e71bc90ab

Sema: Pull conformance exportability checking out of resolveType()

view details

Slava Pestov

commit sha 2a678f29dbcfd48b7ace489937e404ff68fb8f1e

Sema: Remove TypeResolutionFlags::AllowUnavailable{,Protocol}

view details

Slava Pestov

commit sha 5b38671b1c6f7199ee8b074a9be560517bad2b7a

sil-opt: Disable parser lookup This caught some invalid SIL in a SIL parser test.

view details

John McCall

commit sha 1cc3a57e9107f0b788c382739ea845f192f1546e

Test the just-built dylibs when building unittests on Darwin

view details

John McCall

commit sha 8ac43627540483dfb8c7bd0562a37cfd59ed8388

Implement a simple library for task cancellation and status management. There are things about this that I'm far from sold on. In particular, I'm concerned that in order to implement escalation correctly, we're going to have to add a status record for the fact that the task is being executed, which means we're going to have to potentially wait to acquire the status lock; overall, that means making an extra runtime function call and doing some atomics whenever we resume or suspend a task, which is an uncomfortable amount of overhead. The testing here is pretty grossly inadequate, but I wanted to lay down the groundwork here.

view details

Erik Eckstein

commit sha 6c85f267bf5e3c63b9fb1c69b27102c6800269bf

SimplifyCFG: fix a crash caused by an unreachable CFG cycles with block arguments. When SimplifyCFG (temporarily) produces an unreachable CFG cycle, some other transformations in SimplifyCFG didn't deal with this situation correctly. Unfortunately I couldn't create a SIL test case for this bug, so I just added a swift test case. https://bugs.swift.org/browse/SR-13650 rdar://problem/69942431

view details

Slava Pestov

commit sha 52b847e9afbb3b1ea74837c75fbf3ba64781ee8d

Merge pull request #34318 from slavapestov/sil-opt-parser-lookup sil-opt: Disable parser lookup

view details

Slava Pestov

commit sha 5cebe1b8d13347786b157e03de76fd2ec760bf71

Merge pull request #34310 from slavapestov/refactor-availability-checking Sema: Pull availability checking out of resolveType()

view details

push time in 5 days

push eventatrick/swift

Keith Smiley

commit sha ae0c380f1b0f37e11b111a06634dd4c64e67b96c

Improve -*prefix-map help text Before: ``` -coverage-prefix-map <value> -debug-prefix-map <value> ``` After: ``` -coverage-prefix-map <prefix=replacement> -debug-prefix-map <prefix=replacement> ```

view details

Dave Lee

commit sha 52bbe11161f908d4c58cbdd2a423c68b9688b191

[build] Remove dash-dash from build-presets.ini (NFC)

view details

Arnold Schwaighofer

commit sha 96a0d0e5840045e25d2c05f02999972f804201df

Rename various IncludeUsableFromInlineAndInlineable to IncludeUsableFromInline `@inlinable` implies `@usableFromInline`. NFC intended.

view details

Xi Ge

commit sha 29093b15df24e98dda65cd51e26a7bd618a2d709

Driver: -L= belongs to the linker option group rdar://70300892

view details

Arnold Schwaighofer

commit sha a7259558238eadd1c69a234baef1b67ab45f8492

More renaming

view details

Arnold Schwaighofer

commit sha d6d921d7fafcfa67e500e6013f93ac30f6248b79

IRGen: Fix fixLifetime emission of enums rdar://70270724

view details

Arnold Schwaighofer

commit sha 1c85d201921abcedbd3a693229f597a6d015f81d

Try to appease 32bit tests

view details

Holly Borla

commit sha 1e0038c3be0f6f2fbe1ba6ccb7fa394b7320aa22

[ConstraintSystem] Remove implementation of operator designated types in the solver.

view details

Holly Borla

commit sha 4c0f49f7a6a7a642cd57aeec70e8b392f3296cf1

[ConstraintSystem] Remove selectApplyDisjunction, which was only used by the operator designated types implementation.

view details

Vedant Kumar

commit sha 7145afbd9d5683eeb54d142b0eab5ea2ba91fe32

[Demangler] Null-check a pointer before using it in arithmetic This addresses a UBSan -fsanitize=null diagnostic seen when compiling the stdlib: runtime error: applying non-zero offset 128 to null pointer

view details

Slava Pestov

commit sha 3d0e35e082c5f18da4a6eff30fe08706f26695fa

Sema: Remove a bit of dead code

view details

Slava Pestov

commit sha 94e999a1b55dd14284d96b60e1b67de7aae71dac

Sema: Pull availability checking out of resolveType() We used to diagnose references to unavailable declarations in two places: - inside Exprs, right after type checking the expression - inside TypeReprs, from resolveType() In broad terms, resolveType() is called with TypeReprs stored inside both Stmts and Decls. To handle the first case, I added a new overload of diagAvailability() that takes a Stmt, to be called from typeCheckStmt(). This doesn't actually walk into any Exprs stored inside the statement; this means it only walks Patterns and such. For the second case, a new DeclAvailabilityChecker is now defined in TypeCheckAccess.cpp. It's structure is analogous to the other three walkers there: - AccessControlChecker - UsableFromInlineChecker - ExportabilityChecker The new implementation of availability checking for types introduces a lot more code than the old online logic it replaces. However, I hope to consolidate some of the code duplication among the four checkers that are defined in TypeCheckAccess.cpp, and do some other cleanups that will make the benefit of the new approach apparent.

view details

Slava Pestov

commit sha baa9d7142aa1e24f4cf07672d250307e71bc90ab

Sema: Pull conformance exportability checking out of resolveType()

view details

Slava Pestov

commit sha 2a678f29dbcfd48b7ace489937e404ff68fb8f1e

Sema: Remove TypeResolutionFlags::AllowUnavailable{,Protocol}

view details

Slava Pestov

commit sha 5b38671b1c6f7199ee8b074a9be560517bad2b7a

sil-opt: Disable parser lookup This caught some invalid SIL in a SIL parser test.

view details

John McCall

commit sha 1cc3a57e9107f0b788c382739ea845f192f1546e

Test the just-built dylibs when building unittests on Darwin

view details

John McCall

commit sha 8ac43627540483dfb8c7bd0562a37cfd59ed8388

Implement a simple library for task cancellation and status management. There are things about this that I'm far from sold on. In particular, I'm concerned that in order to implement escalation correctly, we're going to have to add a status record for the fact that the task is being executed, which means we're going to have to potentially wait to acquire the status lock; overall, that means making an extra runtime function call and doing some atomics whenever we resume or suspend a task, which is an uncomfortable amount of overhead. The testing here is pretty grossly inadequate, but I wanted to lay down the groundwork here.

view details

Erik Eckstein

commit sha 6c85f267bf5e3c63b9fb1c69b27102c6800269bf

SimplifyCFG: fix a crash caused by an unreachable CFG cycles with block arguments. When SimplifyCFG (temporarily) produces an unreachable CFG cycle, some other transformations in SimplifyCFG didn't deal with this situation correctly. Unfortunately I couldn't create a SIL test case for this bug, so I just added a swift test case. https://bugs.swift.org/browse/SR-13650 rdar://problem/69942431

view details

Slava Pestov

commit sha 52b847e9afbb3b1ea74837c75fbf3ba64781ee8d

Merge pull request #34318 from slavapestov/sil-opt-parser-lookup sil-opt: Disable parser lookup

view details

Slava Pestov

commit sha 5cebe1b8d13347786b157e03de76fd2ec760bf71

Merge pull request #34310 from slavapestov/refactor-availability-checking Sema: Pull availability checking out of resolveType()

view details

push time in 5 days

pull request commentapple/swift

[WIP] break a semantic ARC test

Leaving this open for rdar://70397425 ("No identified problems" PR lit test failure with backtrace is not recognized by Jenkins)

atrick

comment created time in 5 days

PR closed apple/swift

[WIP] Break access verify

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+4034 -645

2 comments

43 changed files

atrick

pr closed time in 5 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@swift-ci smoke test

atrick

comment created time in 5 days

push eventatrick/swift

Keith Smiley

commit sha ae0c380f1b0f37e11b111a06634dd4c64e67b96c

Improve -*prefix-map help text Before: ``` -coverage-prefix-map <value> -debug-prefix-map <value> ``` After: ``` -coverage-prefix-map <prefix=replacement> -debug-prefix-map <prefix=replacement> ```

view details

Dave Lee

commit sha 52bbe11161f908d4c58cbdd2a423c68b9688b191

[build] Remove dash-dash from build-presets.ini (NFC)

view details

Arnold Schwaighofer

commit sha 96a0d0e5840045e25d2c05f02999972f804201df

Rename various IncludeUsableFromInlineAndInlineable to IncludeUsableFromInline `@inlinable` implies `@usableFromInline`. NFC intended.

view details

Xi Ge

commit sha 29093b15df24e98dda65cd51e26a7bd618a2d709

Driver: -L= belongs to the linker option group rdar://70300892

view details

Arnold Schwaighofer

commit sha a7259558238eadd1c69a234baef1b67ab45f8492

More renaming

view details

Arnold Schwaighofer

commit sha d6d921d7fafcfa67e500e6013f93ac30f6248b79

IRGen: Fix fixLifetime emission of enums rdar://70270724

view details

Arnold Schwaighofer

commit sha 1c85d201921abcedbd3a693229f597a6d015f81d

Try to appease 32bit tests

view details

Holly Borla

commit sha 1e0038c3be0f6f2fbe1ba6ccb7fa394b7320aa22

[ConstraintSystem] Remove implementation of operator designated types in the solver.

view details

Holly Borla

commit sha 4c0f49f7a6a7a642cd57aeec70e8b392f3296cf1

[ConstraintSystem] Remove selectApplyDisjunction, which was only used by the operator designated types implementation.

view details

Vedant Kumar

commit sha 7145afbd9d5683eeb54d142b0eab5ea2ba91fe32

[Demangler] Null-check a pointer before using it in arithmetic This addresses a UBSan -fsanitize=null diagnostic seen when compiling the stdlib: runtime error: applying non-zero offset 128 to null pointer

view details

Slava Pestov

commit sha 3d0e35e082c5f18da4a6eff30fe08706f26695fa

Sema: Remove a bit of dead code

view details

Slava Pestov

commit sha 94e999a1b55dd14284d96b60e1b67de7aae71dac

Sema: Pull availability checking out of resolveType() We used to diagnose references to unavailable declarations in two places: - inside Exprs, right after type checking the expression - inside TypeReprs, from resolveType() In broad terms, resolveType() is called with TypeReprs stored inside both Stmts and Decls. To handle the first case, I added a new overload of diagAvailability() that takes a Stmt, to be called from typeCheckStmt(). This doesn't actually walk into any Exprs stored inside the statement; this means it only walks Patterns and such. For the second case, a new DeclAvailabilityChecker is now defined in TypeCheckAccess.cpp. It's structure is analogous to the other three walkers there: - AccessControlChecker - UsableFromInlineChecker - ExportabilityChecker The new implementation of availability checking for types introduces a lot more code than the old online logic it replaces. However, I hope to consolidate some of the code duplication among the four checkers that are defined in TypeCheckAccess.cpp, and do some other cleanups that will make the benefit of the new approach apparent.

view details

Slava Pestov

commit sha baa9d7142aa1e24f4cf07672d250307e71bc90ab

Sema: Pull conformance exportability checking out of resolveType()

view details

Slava Pestov

commit sha 2a678f29dbcfd48b7ace489937e404ff68fb8f1e

Sema: Remove TypeResolutionFlags::AllowUnavailable{,Protocol}

view details

Slava Pestov

commit sha 5b38671b1c6f7199ee8b074a9be560517bad2b7a

sil-opt: Disable parser lookup This caught some invalid SIL in a SIL parser test.

view details

John McCall

commit sha 1cc3a57e9107f0b788c382739ea845f192f1546e

Test the just-built dylibs when building unittests on Darwin

view details

John McCall

commit sha 8ac43627540483dfb8c7bd0562a37cfd59ed8388

Implement a simple library for task cancellation and status management. There are things about this that I'm far from sold on. In particular, I'm concerned that in order to implement escalation correctly, we're going to have to add a status record for the fact that the task is being executed, which means we're going to have to potentially wait to acquire the status lock; overall, that means making an extra runtime function call and doing some atomics whenever we resume or suspend a task, which is an uncomfortable amount of overhead. The testing here is pretty grossly inadequate, but I wanted to lay down the groundwork here.

view details

Erik Eckstein

commit sha 6c85f267bf5e3c63b9fb1c69b27102c6800269bf

SimplifyCFG: fix a crash caused by an unreachable CFG cycles with block arguments. When SimplifyCFG (temporarily) produces an unreachable CFG cycle, some other transformations in SimplifyCFG didn't deal with this situation correctly. Unfortunately I couldn't create a SIL test case for this bug, so I just added a swift test case. https://bugs.swift.org/browse/SR-13650 rdar://problem/69942431

view details

Slava Pestov

commit sha 52b847e9afbb3b1ea74837c75fbf3ba64781ee8d

Merge pull request #34318 from slavapestov/sil-opt-parser-lookup sil-opt: Disable parser lookup

view details

Slava Pestov

commit sha 5cebe1b8d13347786b157e03de76fd2ec760bf71

Merge pull request #34310 from slavapestov/refactor-availability-checking Sema: Pull availability checking out of resolveType()

view details

push time in 5 days

pull request commentapple/swift

[WIP] Break access verify

@swift-ci smoke test linux

atrick

comment created time in 5 days

pull request commentapple/swift

[WIP] break a semantic ARC test

@swift-ci smoke test linux

atrick

comment created time in 5 days

pull request commentapple/swift

[WIP] Break access verify

@swift-ci smoke test linux

atrick

comment created time in 5 days

PR opened apple/swift

[WIP] Break access verify

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+4034 -645

0 comment

43 changed files

pr created time in 5 days

create barnchatrick/swift

branch : break-access-verify

created branch time in 5 days

push eventatrick/swift

Andrew Trick

commit sha 69ca2c63e09c15da94acc9f2ee28ae020c17d65e

The verifier should only output to llvm::errs()

view details

push time in 5 days

pull request commentapple/swift

[WIP] break a semantic ARC test

@swift-ci smoke test linux

atrick

comment created time in 5 days

PR opened apple/swift

[WIP] break a semantic ARC test

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+1 -1

0 comment

1 changed file

pr created time in 5 days

create barnchatrick/swift

branch : break-a-test

created branch time in 5 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@gottesmm I've actually been waiting to land this PR until I know all the subsequent functionality, including the load-borrow-checker rewrite will pass all testing and SCK. So the only reason to disable load borrow checking here is to break up the functionality and allow the bots to churn through one piece at a time.

atrick

comment created time in 6 days

push eventatrick/swift

Andrew Trick

commit sha c21e3e78b1631800be7889c31678fe37ce6243d9

Test cases for AccessedStorage with reference casts.

view details

push time in 6 days

push eventatrick/swift

Dave Lee

commit sha 27330f169df5d2dcb018ab2c6615d66be91d04e2

[build] Remove unused lldb cmake

view details

Pavel Yaskevich

commit sha 9239692d00eb7a5362fe18f42dfcd9ddc687f45c

[unittests] Add a fixture for Sema unit tests

view details

Pavel Yaskevich

commit sha 0b22d91c9416e57a37829a6c471770e53f96fee2

[unittests] Extend Sema testing fixture to load stdlib (+ shims) Setup module importers, load stdlib, establish separate testing module and load a single main file there which imports standard library.

view details

Pavel Yaskevich

commit sha b2c31c394b02c0b2ae97f61e57daeeef8c770087

[unittests/Sema] Add an ability to retrieve stdlib types by name

view details

Pavel Yaskevich

commit sha dc7c9c2bfa0167180ec19f7a26029e16ef03dd60

[unittests/Sema] Add a simple integer literal type inference test

view details

Pavel Yaskevich

commit sha 6e470f5fcd55e94d5010e4621bec225314327f50

[unittest/Sema] NFC: Switch to use `AttributedImport` instead of deprecated `ImportedModuleDesc`

view details

Pavel Yaskevich

commit sha fde1af756d336cb4c22067c99fe2c83a3b026012

[unittest/Sema] Use default target triple to fix Windows build

view details

Alexis Laferrière

commit sha 8307a8d58e7ec6c5396b8e27ee4170a2f9fb844e

[Sema] Don't require availability for implicit decls Suppress warnings in synthesized code. The parent decls should already show a warning. require_explicit_availability.StructWithImplicitMembers:2:16: warning: public declarations should have an availability attribute when building with -require-explicit-availability public var hashValue: Int { get } ^

view details

Doug Gregor

commit sha f089ba9464fc164f6dc4ce01dafb1ec2f545912c

[Concurrency] Propagation of actor constraints. Implement propagation rules for global actor constraints, which can come from: * Enclosing extension or type * Superclass of a class * Overridden declaration * Requirement witnessed by a declaration * Storage declaration for an accessor

view details

Dave Lee

commit sha b02dc2b25bc2c9c258370265c54d744c178a101c

LLDB_PATH_TO_SWIFT_SOURCE too

view details

Doug Gregor

commit sha 2f7ff6aa398dfe65f09fb2e44bc5969fdebbc11b

[Concurrency] Allow ActorIsolation in diagnostic messages. ActorIsolation is rendered as a descriptive phrase before an entity, e.g, "actor-independent" or "global actor 'UIActor'-isolated" when used in diagnostics.

view details

Doug Gregor

commit sha 18fd4be17a6a4307e46eeeae5d5220e3b9179c23

[Concurrency] Check actor isolation consistency for overrides & subclasses. Both overriding declarations and subclasses must have the actor isolation as their overridden declarations or superclasses, respectively. Enforce this, ensuring that we're also doing the appropriate substitutions.

view details

Doug Gregor

commit sha 11cf3ceffe20ea7d32678c5d83347735cea94341

[Concurrency] Eliminate actor isolation checking for subclasses. Subclasses inherit the global actor from their superclass by default, but it's okay to change it---it's just a default that can be overridden on a per-member basis anyway.

view details

Doug Gregor

commit sha a5b15ed6309ce9c893204bec9ba8e9a2d19d9b66

[Concurrency] Substitute into superclass global actors when inheriting them.

view details

Doug Gregor

commit sha 3a651a61b7868c6b13a0cb90eaf1a5be92762a7c

[Concurrency] Fix circular reference on isolation propagation.

view details

Alexis Laferrière

commit sha 5d21200fdfc5b863869e6aa7aa285a3a69fd3ef2

Merge pull request #34295 from xymus/require-explicit-avail-ignore-implicit [Sema] Don't require explicit availability for implicit decls

view details

Pavel Yaskevich

commit sha 6a19d371663a4cb27975ab47c3653625862f21e5

Merge pull request #34286 from xedin/add-sema-unittest-fixture [unittests] Add a fixture for Sema unit tests

view details

Doug Gregor

commit sha db8402f998117b65a74ef34df16717526f0b6a36

Merge pull request #34301 from DougGregor/concurrency-actor-constraint-inference [Concurrency] Propagation and consistency checking for actor constraints.

view details

Zoe Carver

commit sha 722cc755f8ee5bd74eb8f6c4e7f0a6514838fd50

[cxx-interop] Cast data to the correct type. (#34266) The implicit conversions are OK in C but C++ will error. To make this header valid in both C and C++ we should just always cast.

view details

Doug Gregor

commit sha 21a0696e165747248ac5f4532feeb942e13e326b

[Concurrency] Clean up inference logic for @asyncHandler.

view details

push time in 6 days

push eventatrick/swift

Dave Lee

commit sha 27330f169df5d2dcb018ab2c6615d66be91d04e2

[build] Remove unused lldb cmake

view details

Pavel Yaskevich

commit sha 9239692d00eb7a5362fe18f42dfcd9ddc687f45c

[unittests] Add a fixture for Sema unit tests

view details

Pavel Yaskevich

commit sha 0b22d91c9416e57a37829a6c471770e53f96fee2

[unittests] Extend Sema testing fixture to load stdlib (+ shims) Setup module importers, load stdlib, establish separate testing module and load a single main file there which imports standard library.

view details

Pavel Yaskevich

commit sha b2c31c394b02c0b2ae97f61e57daeeef8c770087

[unittests/Sema] Add an ability to retrieve stdlib types by name

view details

Pavel Yaskevich

commit sha dc7c9c2bfa0167180ec19f7a26029e16ef03dd60

[unittests/Sema] Add a simple integer literal type inference test

view details

Pavel Yaskevich

commit sha 6e470f5fcd55e94d5010e4621bec225314327f50

[unittest/Sema] NFC: Switch to use `AttributedImport` instead of deprecated `ImportedModuleDesc`

view details

Pavel Yaskevich

commit sha fde1af756d336cb4c22067c99fe2c83a3b026012

[unittest/Sema] Use default target triple to fix Windows build

view details

Alexis Laferrière

commit sha 8307a8d58e7ec6c5396b8e27ee4170a2f9fb844e

[Sema] Don't require availability for implicit decls Suppress warnings in synthesized code. The parent decls should already show a warning. require_explicit_availability.StructWithImplicitMembers:2:16: warning: public declarations should have an availability attribute when building with -require-explicit-availability public var hashValue: Int { get } ^

view details

Doug Gregor

commit sha f089ba9464fc164f6dc4ce01dafb1ec2f545912c

[Concurrency] Propagation of actor constraints. Implement propagation rules for global actor constraints, which can come from: * Enclosing extension or type * Superclass of a class * Overridden declaration * Requirement witnessed by a declaration * Storage declaration for an accessor

view details

Dave Lee

commit sha b02dc2b25bc2c9c258370265c54d744c178a101c

LLDB_PATH_TO_SWIFT_SOURCE too

view details

Doug Gregor

commit sha 2f7ff6aa398dfe65f09fb2e44bc5969fdebbc11b

[Concurrency] Allow ActorIsolation in diagnostic messages. ActorIsolation is rendered as a descriptive phrase before an entity, e.g, "actor-independent" or "global actor 'UIActor'-isolated" when used in diagnostics.

view details

Doug Gregor

commit sha 18fd4be17a6a4307e46eeeae5d5220e3b9179c23

[Concurrency] Check actor isolation consistency for overrides & subclasses. Both overriding declarations and subclasses must have the actor isolation as their overridden declarations or superclasses, respectively. Enforce this, ensuring that we're also doing the appropriate substitutions.

view details

Doug Gregor

commit sha 11cf3ceffe20ea7d32678c5d83347735cea94341

[Concurrency] Eliminate actor isolation checking for subclasses. Subclasses inherit the global actor from their superclass by default, but it's okay to change it---it's just a default that can be overridden on a per-member basis anyway.

view details

Doug Gregor

commit sha a5b15ed6309ce9c893204bec9ba8e9a2d19d9b66

[Concurrency] Substitute into superclass global actors when inheriting them.

view details

Doug Gregor

commit sha 3a651a61b7868c6b13a0cb90eaf1a5be92762a7c

[Concurrency] Fix circular reference on isolation propagation.

view details

Alexis Laferrière

commit sha 5d21200fdfc5b863869e6aa7aa285a3a69fd3ef2

Merge pull request #34295 from xymus/require-explicit-avail-ignore-implicit [Sema] Don't require explicit availability for implicit decls

view details

Pavel Yaskevich

commit sha 6a19d371663a4cb27975ab47c3653625862f21e5

Merge pull request #34286 from xedin/add-sema-unittest-fixture [unittests] Add a fixture for Sema unit tests

view details

Doug Gregor

commit sha db8402f998117b65a74ef34df16717526f0b6a36

Merge pull request #34301 from DougGregor/concurrency-actor-constraint-inference [Concurrency] Propagation and consistency checking for actor constraints.

view details

Zoe Carver

commit sha 722cc755f8ee5bd74eb8f6c4e7f0a6514838fd50

[cxx-interop] Cast data to the correct type. (#34266) The implicit conversions are OK in C but C++ will error. To make this header valid in both C and C++ we should just always cast.

view details

Doug Gregor

commit sha 21a0696e165747248ac5f4532feeb942e13e326b

[Concurrency] Clean up inference logic for @asyncHandler.

view details

push time in 6 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@swift-ci test source compatibility

atrick

comment created time in 7 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@swift-ci test

atrick

comment created time in 7 days

push eventatrick/swift

Dave Lee

commit sha 27330f169df5d2dcb018ab2c6615d66be91d04e2

[build] Remove unused lldb cmake

view details

Pavel Yaskevich

commit sha 9239692d00eb7a5362fe18f42dfcd9ddc687f45c

[unittests] Add a fixture for Sema unit tests

view details

Pavel Yaskevich

commit sha 0b22d91c9416e57a37829a6c471770e53f96fee2

[unittests] Extend Sema testing fixture to load stdlib (+ shims) Setup module importers, load stdlib, establish separate testing module and load a single main file there which imports standard library.

view details

Pavel Yaskevich

commit sha b2c31c394b02c0b2ae97f61e57daeeef8c770087

[unittests/Sema] Add an ability to retrieve stdlib types by name

view details

Pavel Yaskevich

commit sha dc7c9c2bfa0167180ec19f7a26029e16ef03dd60

[unittests/Sema] Add a simple integer literal type inference test

view details

Pavel Yaskevich

commit sha 6e470f5fcd55e94d5010e4621bec225314327f50

[unittest/Sema] NFC: Switch to use `AttributedImport` instead of deprecated `ImportedModuleDesc`

view details

Pavel Yaskevich

commit sha fde1af756d336cb4c22067c99fe2c83a3b026012

[unittest/Sema] Use default target triple to fix Windows build

view details

Alexis Laferrière

commit sha 8307a8d58e7ec6c5396b8e27ee4170a2f9fb844e

[Sema] Don't require availability for implicit decls Suppress warnings in synthesized code. The parent decls should already show a warning. require_explicit_availability.StructWithImplicitMembers:2:16: warning: public declarations should have an availability attribute when building with -require-explicit-availability public var hashValue: Int { get } ^

view details

Doug Gregor

commit sha f089ba9464fc164f6dc4ce01dafb1ec2f545912c

[Concurrency] Propagation of actor constraints. Implement propagation rules for global actor constraints, which can come from: * Enclosing extension or type * Superclass of a class * Overridden declaration * Requirement witnessed by a declaration * Storage declaration for an accessor

view details

Dave Lee

commit sha b02dc2b25bc2c9c258370265c54d744c178a101c

LLDB_PATH_TO_SWIFT_SOURCE too

view details

Doug Gregor

commit sha 2f7ff6aa398dfe65f09fb2e44bc5969fdebbc11b

[Concurrency] Allow ActorIsolation in diagnostic messages. ActorIsolation is rendered as a descriptive phrase before an entity, e.g, "actor-independent" or "global actor 'UIActor'-isolated" when used in diagnostics.

view details

Doug Gregor

commit sha 18fd4be17a6a4307e46eeeae5d5220e3b9179c23

[Concurrency] Check actor isolation consistency for overrides & subclasses. Both overriding declarations and subclasses must have the actor isolation as their overridden declarations or superclasses, respectively. Enforce this, ensuring that we're also doing the appropriate substitutions.

view details

Doug Gregor

commit sha 11cf3ceffe20ea7d32678c5d83347735cea94341

[Concurrency] Eliminate actor isolation checking for subclasses. Subclasses inherit the global actor from their superclass by default, but it's okay to change it---it's just a default that can be overridden on a per-member basis anyway.

view details

Doug Gregor

commit sha a5b15ed6309ce9c893204bec9ba8e9a2d19d9b66

[Concurrency] Substitute into superclass global actors when inheriting them.

view details

Doug Gregor

commit sha 3a651a61b7868c6b13a0cb90eaf1a5be92762a7c

[Concurrency] Fix circular reference on isolation propagation.

view details

Alexis Laferrière

commit sha 5d21200fdfc5b863869e6aa7aa285a3a69fd3ef2

Merge pull request #34295 from xymus/require-explicit-avail-ignore-implicit [Sema] Don't require explicit availability for implicit decls

view details

Pavel Yaskevich

commit sha 6a19d371663a4cb27975ab47c3653625862f21e5

Merge pull request #34286 from xedin/add-sema-unittest-fixture [unittests] Add a fixture for Sema unit tests

view details

Doug Gregor

commit sha db8402f998117b65a74ef34df16717526f0b6a36

Merge pull request #34301 from DougGregor/concurrency-actor-constraint-inference [Concurrency] Propagation and consistency checking for actor constraints.

view details

Zoe Carver

commit sha 722cc755f8ee5bd74eb8f6c4e7f0a6514838fd50

[cxx-interop] Cast data to the correct type. (#34266) The implicit conversions are OK in C but C++ will error. To make this header valid in both C and C++ we should just always cast.

view details

Doug Gregor

commit sha 21a0696e165747248ac5f4532feeb942e13e326b

[Concurrency] Clean up inference logic for @asyncHandler.

view details

push time in 7 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@swift-ci benchmark

atrick

comment created time in 7 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@swift-ci test source compatibility

atrick

comment created time in 7 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@swift-ci test

atrick

comment created time in 7 days

pull request commentapple/swift

Add an AccessPath abstraction and formalize memory access

@gottesmm In order to stage in new verification, load-borrow immutability gets disabled in this PR but immediately reenabled here: https://github.com/atrick/swift/commits/rewrite-loadborrowchecker

atrick

comment created time in 7 days

push eventatrick/swift

Antoine Cœur

commit sha 4c30f8bd6de5487603ed645cc4dd2a2983f4f0ba

appendingPathComponent(:isDirectory:) should account for isDirectory

view details

Xiaodi Wu

commit sha 26cda274ca78b1df246521ba1eeea33285b57d5f

[stdlib] Simplify 'BinaryFloatingPoint.init?<T: BinaryFloatingPoint>(exactly: T)'

view details

Mike Ash

commit sha ece0399d601eec1069131f465bdbe7e16f4c6a50

[Runtime] Have ConcurrentReadableHashMap use 1-byte or 2-byte indices when possible.

view details

Alexis Laferrière

commit sha 14e6772dc04cf778ba393bebc21a0a8b8ada3603

Consider inherited platform unavailability to silence diagnostics rdar://68597591

view details

Arnold Schwaighofer

commit sha 8e8c57caf59f043b4046ad0df6e7c358bcac9903

SIL type lowering: Compute IsTypeExpansionSensitive and use it instead of TypeBase's hasOpaqueArchetypePropertiesOrCases A type is IsTypeExpansionSensitive if it contains an opaque result type that influences how the type is lowered. This could be because the type mentions an opaque archetype and therefore we would look through to the underlying type depending on the type expansion and could get a different SIL type. For example '() -> out some P' could lower to '() -> @out Int'. Or this could be because when we lower an aggregate type some of its fields are opaque types that could be looked through and therefore the aggregate has different lowering (e.g address vs. loadable) in different type expansion contexts. By replacing it this change also fixes an infinite recursion in hasOpaqueArchetypePropertiesOrCases. rdar://68798822

view details

Cassie Jones

commit sha e01893cb56f989b20ba4309286450105211f031e

[build-script] Add a flag for sccache This adds a flag to enable sccache in order to simplify the build-script invocation, particularly for new contributors.

view details

Cassie Jones

commit sha 6d92486c9a6ddc8b71f7c842d546ae3599be5c30

[build-script] Add SWIFT_ prefix to USE_SCCACHE env var

view details

Nate Chandler

commit sha 4cfadfae00f31fc66581ad270176e4916682bf51

[NFC] Documented IRGenFunction::IndirectReturn.

view details

Nate Chandler

commit sha 607772aaa21ce58db04236cb817b5958c72b2123

[Runtime] Stubbed entry points for task de/alloc.

view details

Alexey Komnin

commit sha 4fa17bf59774ae6543a33b1a29f01320705f4dfe

SR-12022: refactor LiteralExpr to combine common initializer code

view details

Xi Ge

commit sha 8ccee27db72e0ce6fbf236a8f13ab2e85984a482

ModuleInterface: refactor ModuleInterfaceChecker out of ModuleInterfaceLoader This refactoring allows us to drop ModuleInterfaceLoader when explicit modules are enabled. Before this change, the dependencies scanner needs the loader to be present to access functionalities like collecting prebuilt module candidates.

view details

Cassie Jones

commit sha 7ef9b3287ab097ce2bdd1ab70f9ed9df20d39ff1

[build-script] Fix CMake sccache test

view details

Josh Learn

commit sha 1fd6ef95ce483dd7447e09935597cde5c42c14fc

[OSLog] Update compiler stubs and tests The compiler stubs for testing the OSLog implementation are in need of an update. This change updates the stubs to be consistent with the current OSLog implementation, updates the existing tests, and adds new tests for String and metatype interpolations. rdar://69719729

view details

Robert Widmann

commit sha 74765a8ba82a14d3fce03e156049f65845c2cbfa

Remove Type Body Fingerprints Flags This infrastructure has more than proven itself. Drop the code paths and tests supporting the status quo.

view details

Joe Groff

commit sha a664a33b52680bca4c80d6749583a86da6bac902

SIL: Add instructions to represent async suspend points. `get_async_continuation[_addr]` begins a suspend operation by accessing the continuation value that can resume the task, which can then be used in a callback or event handler before executing `await_async_continuation` to suspend the task.

view details

Robert Widmann

commit sha 964f640636d848318d35fc48e25df624a55fef91

Drop "Private Deps" Flag In order for type body fingerprints to work, these declarations must always be included. Drop the ability to turn this off.

view details

Saleem Abdulrasool

commit sha da764ebe39fae5a23f32cb852953eaa24e5c20f6

Update README.md Remove the GPU builder status for TensorFlow which is currently not running.

view details

Fero

commit sha 28f3e442135d7ae60c1522e8da41322350f84171

Fix typo

view details

Fero

commit sha b0b546873ca8c47b99cdae99110f94d2cbaa5283

Fix typo

view details

Slava Pestov

commit sha 60427845781ba4c247e932338fde85dd46ec0bcf

Sema: Tweak re-declaration checking behavior to match old logic The parser's own re-declaration checking for local declarations has slightly different behavior than Sema's re-declaration check. Whereas Sema rejects this: class C { let x = 123 func x() {} } The parser accepts this: func f() { let x = 123 func x() {} } With Sema's check now handling both cases, fudge the behavior to match the parser in the local case.

view details

push time in 7 days

push eventatrick/swift

Andrew Trick

commit sha e2f0bdcb43b40924880ace6c3bfd2387e151a7f5

Add AccessUseVisitor and cleanup related APIs. Add AccesssedStorage::compute and computeInScope to mirror AccessPath. Allow recovering the begin_access for Nested storage. Adds AccessedStorage.visitRoots().

view details

Andrew Trick

commit sha 50aeb9116a2b841361e5e2a2bfb49d789708f2a5

Cache 'isLet' within AccessedStorage. Compute 'isLet' from the VarDecl that is available when constructing AccessedStorage so we don't need to recover the VarDecl for the base later. This generally makes more sense and is more efficient, but it will be necessary when we look past class casts when finding the reference root.

view details

Andrew Trick

commit sha b2dd9c6201f228c8e26a1271e446ab611a7f6fed

Add AccessedStorageWithBase to conviently recover the base's VarDecl

view details

Andrew Trick

commit sha eb5f956be9e0002d2811098350ccbf941a31d4fa

Temporarily disable the load-borrow checker. A rewrite is ready and will be merged ASAP.

view details

Andrew Trick

commit sha 871058e22c74bed9fff2e913d956d765741bd5d1

Look past class casts when finding the reference root. For class storage AccessedStorage is now close to what some passes use for RC identity, but it still does not look past wrapping references in an Optional.

view details

Andrew Trick

commit sha a07c314ea6cd6427a942772edea3c539f24a639c

Fix isRCIdentityPreservingCast to handle trivial-to-reference casts And add assertions.

view details

Andrew Trick

commit sha 430a86798d5a34dc2b939253b53a11fe0069c446

Test cases for AccessedStorage with reference casts.

view details

Andrew Trick

commit sha 83e85cb27845a87e1a43bf22d148bfa49d00384c

LoadBorrowInvalidation: fix mysteriously inverted boolean returns.

view details

Andrew Trick

commit sha 80b3348caf5f06d23f4abe3128f4af11b486840a

LoadBorrowImmutabilityChecker renaming. Limit names to a straightforward and unambiguous statement of purpose. They should not pose additional questions which can only be answered by reading the code. Nuanced meaning belongs in descriptions and code comments. These are all examples that legitimately made reading the code very difficult for me: - LoadBorrowInvalidationChecker: what does "invalidation" mean in this context? How does that extend the meaning of "checker"? How can something ever pass a checker and not be invalid? - constructValuesForKey outside of an ADT does not state purpose at all. - wellBehavedWriteAccumulator: Raises questions about what writes are included and the broader semantics of the parent function. It turns out that well-behavedness is handled by the function's return value and has nothing to do with the accumulator.

view details

Andrew Trick

commit sha 70c86c7cc51edd96d9c8d872e28d9484f548965f

Rewrite LoadBorrowImmutabilityChecker using AccessPath. The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses. It is also now wholly consistent with the utilities that it uses, so can be reenabled. We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

view details

Andrew Trick

commit sha 5a61b8c5c2e3aeba233c32d16c8af66998816f69

Reenable load-borrow checker.

view details

push time in 7 days

push eventatrick/swift

Andrew Trick

commit sha 95ab23433d789c55719f778a0a12b410b5a08028

Look past class casts when finding the reference root. For class storage AccessedStorage is now close to what some passes use for RC identity, but it still does not look past wrapping references in an Optional.

view details

Andrew Trick

commit sha 13e2aa6e8742e24ea0f3f47cebecac963d612b37

Fix isRCIdentityPreservingCast to handle trivial-to-reference casts And add assertions.

view details

Andrew Trick

commit sha 75b1179215bd765d4f96934b874a06311c728557

Test cases for AccessedStorage with reference casts.

view details

Andrew Trick

commit sha 942d93a7defb50b8c1a1c4143da46c81cae4322c

LoadBorrowInvalidation: fix mysteriously inverted boolean returns.

view details

Andrew Trick

commit sha 6c4307eeb7c8e86cf13083464d38662c02e15629

LoadBorrowImmutabilityChecker renaming. Limit names to a straightforward and unambiguous statement of purpose. They should not pose additional questions which can only be answered by reading the code. Nuanced meaning belongs in descriptions and code comments. These are all examples that legitimately made reading the code very difficult for me: - LoadBorrowInvalidationChecker: what does "invalidation" mean in this context? How does that extend the meaning of "checker"? How can something ever pass a checker and not be invalid? - constructValuesForKey outside of an ADT does not state purpose at all. - wellBehavedWriteAccumulator: Raises questions about what writes are included and the broader semantics of the parent function. It turns out that well-behavedness is handled by the function's return value and has nothing to do with the accumulator.

view details

Andrew Trick

commit sha f3261a950d3f35bee85bec99dba4f88dfb362716

Rewrite LoadBorrowImmutabilityChecker using AccessPath. The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses. It is also now wholly consistent with the utilities that it uses, so can be reenabled. We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

view details

Andrew Trick

commit sha ee29b8cf4bfb19ea6a2da3ad3fbd9af59281154e

Reenable load-borrow checker.

view details

push time in 7 days

push eventatrick/swift

Andrew Trick

commit sha 32bf800d8a356896addcaa74753e9c46528558f2

Add AccessUseVisitor and cleanup related APIs. Add AccesssedStorage::compute and computeInScope to mirror AccessPath. Allow recovering the begin_access for Nested storage. Adds AccessedStorage.visitRoots().

view details

Andrew Trick

commit sha 08f54f234e3ce7e67c42e3d3b8501c97ddfbfc75

Cache 'isLet' within AccessedStorage. Compute 'isLet' from the VarDecl that is available when constructing AccessedStorage so we don't need to recover the VarDecl for the base later. This generally makes more sense and is more efficient, but it will be necessary when we look past class casts when finding the reference root.

view details

Andrew Trick

commit sha 3c06c10f58aa94f5517cc9d906f61f0055471a42

Add AccessedStorageWithBase to conviently recover the base's VarDecl

view details

Andrew Trick

commit sha 2a2b09bf1533c6d7b334905207d3883c5eef1277

Temporarily disable the load-borrow checker. A rewrite is ready and will be merged ASAP.

view details

Andrew Trick

commit sha ef70a483ddf9e9b49c2382a007775db93830eb79

Look past class casts when finding the reference root. For class storage AccessedStorage is now close to what some passes use for RC identity, but it still does not look past wrapping references in an Optional.

view details

Andrew Trick

commit sha d8d64663a1c2a9d4b2983f2a28d0ffcde8213623

Fix isRCIdentityPreservingCast to handle trivial-to-reference casts And add assertions.

view details

Andrew Trick

commit sha 7e4d6ceb183372255b472b2775045f8cae39da65

Test cases for AccessedStorage with reference casts.

view details

Andrew Trick

commit sha 7e1ad04b70e1d79a002bec8c681e3ed1aa411a76

LoadBorrowInvalidation: fix mysteriously inverted boolean returns.

view details

Andrew Trick

commit sha 585883d6c73cbfbf374a1c5e6c84181431af7ff3

LoadBorrowImmutabilityChecker renaming. Limit names to a straightforward and unambiguous statement of purpose. They should not pose additional questions which can only be answered by reading the code. Nuanced meaning belongs in descriptions and code comments. These are all examples that legitimately made reading the code very difficult for me: - LoadBorrowInvalidationChecker: what does "invalidation" mean in this context? How does that extend the meaning of "checker"? How can something ever pass a checker and not be invalid? - constructValuesForKey outside of an ADT does not state purpose at all. - wellBehavedWriteAccumulator: Raises questions about what writes are included and the broader semantics of the parent function. It turns out that well-behavedness is handled by the function's return value and has nothing to do with the accumulator.

view details

Andrew Trick

commit sha fc8bfe2694e81e4d3d1b37e1bcec900b066baf17

Rewrite LoadBorrowImmutabilityChecker using AccessPath. The verification will now be as complete as it can be within the capability of our SIL utilities. It is much more aggressive with respect to boxes, references, and pointers. It's more efficient in that it only considers "overlapping" uses. It is also now wholly consistent with the utilities that it uses, so can be reenabled. We could probably go even further and remove the switch statement entirely, relying on AccessPath to recognize any operations that propagate addresses, boxes, or pointers. But I didn't want to potentially weaken enforcement without more careful consideration.

view details

Andrew Trick

commit sha 57d0ab385f1963baa38170c65b9d5777ba082f60

Reenable load-borrow checker.

view details

push time in 7 days

push eventatrick/swift

Andrew Trick

commit sha f9b0b8976e1cfe554588a3c5048f85df2918132a

Fix load-borrow to allow non-address uses.

view details

Andrew Trick

commit sha c60b4fdd71a849cb335438280e29a55fbe044320

WIP: Fix isRCIdentityPreservingCast to handle trivial-to-reference casts And add assertions.

view details

push time in 8 days

push eventatrick/swift

Andrew Trick

commit sha cef5bdf7a3878024a382c1a7de7a5ab6b7797cd8

Reenable load-borrow checker.

view details

push time in 8 days

push eventatrick/swift

Alexey Komnin

commit sha 4fa17bf59774ae6543a33b1a29f01320705f4dfe

SR-12022: refactor LiteralExpr to combine common initializer code

view details

Michael Gottesman

commit sha d3e6ffdbad9ed2af857508891a4530b7f11d4c6e

[lldb-toolbox] Add the ability to disassemble-to-file a specific function from a target without running the target. The routine already supports dumping the assembly to file if we are at a breakpoint using the current frame. This adds a -n option so one can without running just dump the assembly to a file of a specific function in a binary.

view details

Mike Ash

commit sha 630aff7b19b80f29445b645424e20fd1bb6bd551

[Runtime] Change SimpleGlobalCache to use ConcurrentReadableHashMap instead of ConcurrentMap. This gives us faster lookups and a small advantage in memory usage. Most of these maps need stable addresses for their entries, so we add a level of indirection to ConcurrentReadableHashMap for these cases to accommodate that. This costs some extra memory, but it's still a net win. A new StableAddressConcurrentReadableHashMap type handles this indirection and adds a convenience getOrInsert to take advantage of it. ConcurrentReadableHashMap is tweaked to avoid any global constructors or destructors when using it as a global variable. ForeignWitnessTables does not need stable addresses and it now uses ConcurrentReadableHashMap directly. rdar://problem/70056398

view details

Alexis Laferrière

commit sha e61ffea42c943044fe4fc8c35d5040bc8815e420

[Sema] Check availability in inlinable code using the explicit version Inlinable functions can be inlined in clients with a lower OS target version than the framework defining the function. For this reason, the availability in inlinable functions should always be checked using the explicit introduction OS version as lower bound and not the minimum deployment version. rdar://problem/67975153

view details

Alexis Laferrière

commit sha 53e04cb39db86d890ff674b775a5dbda47e9d599

[Sema] Test explicit versions in TypeRefinementContext

view details

Alexis Laferrière

commit sha 2f182c2b785f5f7b68ee756d1474f21f3050ba67

[Sema] Consider unavailable functions as being unreachable This has the effect of rejecting unavailable overrides to available methods in a similar way as overrides that are less available than the introduction are rejected.

view details

Alexis Laferrière

commit sha 39ee5916bd656cf56c75ddf45a47e628d0ff1db1

[SIL] Don't print availability for unreachable/unavailable functions

view details

Alexis Laferrière

commit sha c79d5cfbd6952c5dc141a24db10a87d548bc5f4f

[Sema] Still use the current minimum deployment target as fallback

view details

Alexis Laferrière

commit sha 25c9ddd7c817d4dee5a1643cc0fc32f3cf833af2

[Sema] Prioritize unavailability check for protocol witnesses The errors on explicit unavailability are more precise than those on availablity version. Make sure we prioritize the unavailability ones first.

view details

Alexis Laferrière

commit sha f536a581082633e33ea8849b7f1d2f9b0d816c6c

[Sema] Silence an inconsistent availability error for the stdlib Don't raise the error availability_decl_more_than_enclosing in the context is unavailable and if read in a swiftinterface file. This error was present in the stdlib in 5.3 without side effects so we still want to accept it.

view details

Alexis Laferrière

commit sha 429017fc7acc303d70c6251eec7c59c97255fa96

[ClangImporter] Import unavailable decls as unavailable

view details

Alexis Laferrière

commit sha d2343f23a4d14b37f1f603ae13e3421fb5455df4

[Sema] Create a new TypeRefinementContext only for explicit inlinables

view details

Alexis Laferrière

commit sha 1ca852e77a00bf8323494d7445d054ea28466b99

[Sema] Accept unavailable constructors override in unavailable types Preserve the old behavior of accepted unavailable override of constructors as this change would be source breaking.

view details

Alexis Laferrière

commit sha fca7d36cb42b044b1179254d6e38f2b8a263eeed

[Sema] Use the deployment target as minimum OS version in swiftinterfaces Preserve the previous behavior when parsing swiftinterfaces as the Swift stdlib for Swift 5.3 and a few other swiftinterfaces in Xcode 12.0 had issues that would now be reported as errors.

view details

Mishal Shah

commit sha 2324aceec85904e20c5a5fd6ca097c87b854673e

Update the Apple Watch Simulator to Series 5

view details

Daniel Rodríguez Troitiño

commit sha b047f9e25277f3180b3d844b975b10023556bc45

[windows] Provide %long-tmp in Windows for extended length temp paths. In Windows %t might end up very close to the maximum path length of 260 characters. It is possible to use extended lenght paths with a \\?\ prefix. The changes introduce %long-tmp for cases that the test suite is going over those limits and need a hint in Windows that the path might be long. It expands to the same as %t in other platforms. This should fix the test/Misc/stats_dir_profiler.swift in the Windows VS 2017 CI machines and hopefully not affect anything else.

view details

Anthony Latsis

commit sha 826f17e53422d284edeeaf7ed6f13a122cd10f27

Decouple detection of «Self ==» constraints from SelfReferenceKind

view details

Anthony Latsis

commit sha 4ee517f65cded3bcfc707ed277113165db486167

AST: Refactor SelfReferenceKind in preparation for #33767 This will enable us to allow members containing references to Self or associated types only in covariant position to be used on an existential

view details

Erik Eckstein

commit sha 77f16471951fbcdf0bba9929b8e6d5d9228e32f6

RCIdentityAnalysis: some refactoring to improve clarity. NFC.

view details

Simon Evans

commit sha 8c3081c750f2b22075e9bb2efc8ab3647996b7b8

test: Remove duplicate test for -static-executable - test/Driver/static-executable-linux.swift is duplicated by test/Driver/static-executable.swift so remove it. - Additionally, test/Driver/static-executable-linux.swift uses 'file' instead of 'lvm-readelf' to detect if the executable is statically linked and this breaks on Centos7.

view details

push time in 8 days

push eventatrick/swift

Andrew Trick

commit sha 26bef1522dc91d9635552a78b897f5a1dab95558

fixup accesspath_uses.sil for opt-ref-root

view details

Andrew Trick

commit sha 152a8afeb5033c3d151fd3db6aac08d50239a145

fixup accessed_storage.sil for opt-ref-root

view details

push time in 8 days

push eventatrick/swift

Andrew Trick

commit sha 69bafbf899cfe24038eb8c74b5e32caebad60d85

fixup AccessPathDefUseTraversal

view details

Andrew Trick

commit sha 502465e3fba2d23fc3f89d96e74fa7935f975062

Temporarily disable the load-borrow checker. A rewrite is ready and will be merged ASAP.

view details

push time in 8 days

push eventatrick/swift

Alexey Komnin

commit sha 4fa17bf59774ae6543a33b1a29f01320705f4dfe

SR-12022: refactor LiteralExpr to combine common initializer code

view details

Michael Gottesman

commit sha d3e6ffdbad9ed2af857508891a4530b7f11d4c6e

[lldb-toolbox] Add the ability to disassemble-to-file a specific function from a target without running the target. The routine already supports dumping the assembly to file if we are at a breakpoint using the current frame. This adds a -n option so one can without running just dump the assembly to a file of a specific function in a binary.

view details

Mike Ash

commit sha 630aff7b19b80f29445b645424e20fd1bb6bd551

[Runtime] Change SimpleGlobalCache to use ConcurrentReadableHashMap instead of ConcurrentMap. This gives us faster lookups and a small advantage in memory usage. Most of these maps need stable addresses for their entries, so we add a level of indirection to ConcurrentReadableHashMap for these cases to accommodate that. This costs some extra memory, but it's still a net win. A new StableAddressConcurrentReadableHashMap type handles this indirection and adds a convenience getOrInsert to take advantage of it. ConcurrentReadableHashMap is tweaked to avoid any global constructors or destructors when using it as a global variable. ForeignWitnessTables does not need stable addresses and it now uses ConcurrentReadableHashMap directly. rdar://problem/70056398

view details

Alexis Laferrière

commit sha e61ffea42c943044fe4fc8c35d5040bc8815e420

[Sema] Check availability in inlinable code using the explicit version Inlinable functions can be inlined in clients with a lower OS target version than the framework defining the function. For this reason, the availability in inlinable functions should always be checked using the explicit introduction OS version as lower bound and not the minimum deployment version. rdar://problem/67975153

view details

Alexis Laferrière

commit sha 53e04cb39db86d890ff674b775a5dbda47e9d599

[Sema] Test explicit versions in TypeRefinementContext

view details

Alexis Laferrière

commit sha 2f182c2b785f5f7b68ee756d1474f21f3050ba67

[Sema] Consider unavailable functions as being unreachable This has the effect of rejecting unavailable overrides to available methods in a similar way as overrides that are less available than the introduction are rejected.

view details

Alexis Laferrière

commit sha 39ee5916bd656cf56c75ddf45a47e628d0ff1db1

[SIL] Don't print availability for unreachable/unavailable functions

view details

Alexis Laferrière

commit sha c79d5cfbd6952c5dc141a24db10a87d548bc5f4f

[Sema] Still use the current minimum deployment target as fallback

view details

Alexis Laferrière

commit sha 25c9ddd7c817d4dee5a1643cc0fc32f3cf833af2

[Sema] Prioritize unavailability check for protocol witnesses The errors on explicit unavailability are more precise than those on availablity version. Make sure we prioritize the unavailability ones first.

view details

Alexis Laferrière

commit sha f536a581082633e33ea8849b7f1d2f9b0d816c6c

[Sema] Silence an inconsistent availability error for the stdlib Don't raise the error availability_decl_more_than_enclosing in the context is unavailable and if read in a swiftinterface file. This error was present in the stdlib in 5.3 without side effects so we still want to accept it.

view details

Alexis Laferrière

commit sha 429017fc7acc303d70c6251eec7c59c97255fa96

[ClangImporter] Import unavailable decls as unavailable

view details

Alexis Laferrière

commit sha d2343f23a4d14b37f1f603ae13e3421fb5455df4

[Sema] Create a new TypeRefinementContext only for explicit inlinables

view details

Alexis Laferrière

commit sha 1ca852e77a00bf8323494d7445d054ea28466b99

[Sema] Accept unavailable constructors override in unavailable types Preserve the old behavior of accepted unavailable override of constructors as this change would be source breaking.

view details

Alexis Laferrière

commit sha fca7d36cb42b044b1179254d6e38f2b8a263eeed

[Sema] Use the deployment target as minimum OS version in swiftinterfaces Preserve the previous behavior when parsing swiftinterfaces as the Swift stdlib for Swift 5.3 and a few other swiftinterfaces in Xcode 12.0 had issues that would now be reported as errors.

view details

Mishal Shah

commit sha 2324aceec85904e20c5a5fd6ca097c87b854673e

Update the Apple Watch Simulator to Series 5

view details

Daniel Rodríguez Troitiño

commit sha b047f9e25277f3180b3d844b975b10023556bc45

[windows] Provide %long-tmp in Windows for extended length temp paths. In Windows %t might end up very close to the maximum path length of 260 characters. It is possible to use extended lenght paths with a \\?\ prefix. The changes introduce %long-tmp for cases that the test suite is going over those limits and need a hint in Windows that the path might be long. It expands to the same as %t in other platforms. This should fix the test/Misc/stats_dir_profiler.swift in the Windows VS 2017 CI machines and hopefully not affect anything else.

view details

Anthony Latsis

commit sha 826f17e53422d284edeeaf7ed6f13a122cd10f27

Decouple detection of «Self ==» constraints from SelfReferenceKind

view details

Anthony Latsis

commit sha 4ee517f65cded3bcfc707ed277113165db486167

AST: Refactor SelfReferenceKind in preparation for #33767 This will enable us to allow members containing references to Self or associated types only in covariant position to be used on an existential

view details

Erik Eckstein

commit sha 77f16471951fbcdf0bba9929b8e6d5d9228e32f6

RCIdentityAnalysis: some refactoring to improve clarity. NFC.

view details

Simon Evans

commit sha 8c3081c750f2b22075e9bb2efc8ab3647996b7b8

test: Remove duplicate test for -static-executable - test/Driver/static-executable-linux.swift is duplicated by test/Driver/static-executable.swift so remove it. - Additionally, test/Driver/static-executable-linux.swift uses 'file' instead of 'lvm-readelf' to detect if the executable is statically linked and this breaks on Centos7.

view details

push time in 8 days

push eventatrick/swift

Antoine Cœur

commit sha 4c30f8bd6de5487603ed645cc4dd2a2983f4f0ba

appendingPathComponent(:isDirectory:) should account for isDirectory

view details

Xiaodi Wu

commit sha 26cda274ca78b1df246521ba1eeea33285b57d5f

[stdlib] Simplify 'BinaryFloatingPoint.init?<T: BinaryFloatingPoint>(exactly: T)'

view details

Mike Ash

commit sha ece0399d601eec1069131f465bdbe7e16f4c6a50

[Runtime] Have ConcurrentReadableHashMap use 1-byte or 2-byte indices when possible.

view details

Alexis Laferrière

commit sha 14e6772dc04cf778ba393bebc21a0a8b8ada3603

Consider inherited platform unavailability to silence diagnostics rdar://68597591

view details

Arnold Schwaighofer

commit sha 8e8c57caf59f043b4046ad0df6e7c358bcac9903

SIL type lowering: Compute IsTypeExpansionSensitive and use it instead of TypeBase's hasOpaqueArchetypePropertiesOrCases A type is IsTypeExpansionSensitive if it contains an opaque result type that influences how the type is lowered. This could be because the type mentions an opaque archetype and therefore we would look through to the underlying type depending on the type expansion and could get a different SIL type. For example '() -> out some P' could lower to '() -> @out Int'. Or this could be because when we lower an aggregate type some of its fields are opaque types that could be looked through and therefore the aggregate has different lowering (e.g address vs. loadable) in different type expansion contexts. By replacing it this change also fixes an infinite recursion in hasOpaqueArchetypePropertiesOrCases. rdar://68798822

view details

Cassie Jones

commit sha e01893cb56f989b20ba4309286450105211f031e

[build-script] Add a flag for sccache This adds a flag to enable sccache in order to simplify the build-script invocation, particularly for new contributors.

view details

Cassie Jones

commit sha 6d92486c9a6ddc8b71f7c842d546ae3599be5c30

[build-script] Add SWIFT_ prefix to USE_SCCACHE env var

view details

Nate Chandler

commit sha 4cfadfae00f31fc66581ad270176e4916682bf51

[NFC] Documented IRGenFunction::IndirectReturn.

view details

Nate Chandler

commit sha 607772aaa21ce58db04236cb817b5958c72b2123

[Runtime] Stubbed entry points for task de/alloc.

view details

Xi Ge

commit sha 8ccee27db72e0ce6fbf236a8f13ab2e85984a482

ModuleInterface: refactor ModuleInterfaceChecker out of ModuleInterfaceLoader This refactoring allows us to drop ModuleInterfaceLoader when explicit modules are enabled. Before this change, the dependencies scanner needs the loader to be present to access functionalities like collecting prebuilt module candidates.

view details

Cassie Jones

commit sha 7ef9b3287ab097ce2bdd1ab70f9ed9df20d39ff1

[build-script] Fix CMake sccache test

view details

Josh Learn

commit sha 1fd6ef95ce483dd7447e09935597cde5c42c14fc

[OSLog] Update compiler stubs and tests The compiler stubs for testing the OSLog implementation are in need of an update. This change updates the stubs to be consistent with the current OSLog implementation, updates the existing tests, and adds new tests for String and metatype interpolations. rdar://69719729

view details

Robert Widmann

commit sha 74765a8ba82a14d3fce03e156049f65845c2cbfa

Remove Type Body Fingerprints Flags This infrastructure has more than proven itself. Drop the code paths and tests supporting the status quo.

view details

Joe Groff

commit sha a664a33b52680bca4c80d6749583a86da6bac902

SIL: Add instructions to represent async suspend points. `get_async_continuation[_addr]` begins a suspend operation by accessing the continuation value that can resume the task, which can then be used in a callback or event handler before executing `await_async_continuation` to suspend the task.

view details

Robert Widmann

commit sha 964f640636d848318d35fc48e25df624a55fef91

Drop "Private Deps" Flag In order for type body fingerprints to work, these declarations must always be included. Drop the ability to turn this off.

view details

Saleem Abdulrasool

commit sha da764ebe39fae5a23f32cb852953eaa24e5c20f6

Update README.md Remove the GPU builder status for TensorFlow which is currently not running.

view details

Fero

commit sha 28f3e442135d7ae60c1522e8da41322350f84171

Fix typo

view details

Fero

commit sha b0b546873ca8c47b99cdae99110f94d2cbaa5283

Fix typo

view details

Slava Pestov

commit sha 60427845781ba4c247e932338fde85dd46ec0bcf

Sema: Tweak re-declaration checking behavior to match old logic The parser's own re-declaration checking for local declarations has slightly different behavior than Sema's re-declaration check. Whereas Sema rejects this: class C { let x = 123 func x() {} } The parser accepts this: func f() { let x = 123 func x() {} } With Sema's check now handling both cases, fudge the behavior to match the parser in the local case.

view details

Slava Pestov

commit sha 28388384f2f6d65d78ce23838ef296bfc1fe66d2

AST: UnqualifiedLookup only finds forward references to outer local bindings when IncludeOuterResults is set The old behavior was that ASTScope would introduce all VarDecls defined in a BraceStmt at the beginning of the BraceStmt. I recently enabled the use of PatternEntryDeclScopes, which introduce the binding at its actual source location instead of at the beginning of the parent statement. This patch now makes use of the new information by having UnqualifiedLookupFlags::IncludeOuterResults toggle between the two behaviors. When searching for outer results, we also consider all VarDecls in a BraceStmt, not just those in scope. This is implemented by giving AbstractASTScopeDeclConsumer a new entry point, consumePossiblyNotInScope(). When looking up into a BraceStmt, all VarDecls are passed in to this entry point. The default implementation does nothing, which means that ASTScope::lookupSingleLocalDecl() now respects source locations when searching for bindings, just like parse-time lookup. However, Sema's preCheckExpression() pass, which sets Flags::IgnoreOuterResults, will continue to find forward-referenced VarDecls, just as it did with the old context-based DeclContext lookup.

view details

push time in 8 days

push eventatrick/swift

Andrew Trick

commit sha ded5c2f5c3e0d4bad547c233ab5341f29a9261ef

AccessUseVisitor

view details

Andrew Trick

commit sha b45a39d0cbd3b7bc79199b01e596875500dc0b0a

LoadBorrowInvalidation: fix mysteriously inverted boolean returns.

view details

Andrew Trick

commit sha d5b48722e399e2361b3ea1262800475421dfc831

LoadBorrowImmutabilityChecker renaming. Limit names to a straightforward and unambiguous statement of purpose. They should not pose additional questions which can only be answered by reading the code. Nuanced meaning belongs in descriptions and code comments. These are all examples that legitimately made reading the code very difficult for me: - LoadBorrowInvalidationChecker: what does "invalidation" mean in this context? How does that extend the meaning of "checker"? How can something ever pass a checker and not be invalid? - constructValuesForKey outside of an ADT does not state purpose at all. - wellBehavedWriteAccumulator: Raises questions about what writes are included and the broader semantics of the parent function. It turns out that well-behavedness is handled by the function's return value and has nothing to do with the accumulator.

view details

Andrew Trick

commit sha 93191d6f7754707475b90b35c835ed6ba35239da

Update LoadBorrowInvalidationChecker for MemAccessUtils API. The main goal of this checker is to find the access scope. To do that, it needs to use `getAccessBegin`, which in turn needs to handle address_to_pointer. Use isAccessedStorageCast to handle more cases, do a small refactoring, and fix minor issues.

view details

push time in 8 days

push eventatrick/swift

Andrew Trick

commit sha aa5c4b63cf2719ffb48dc92ae591e0901e73ff24

Update LoadBorrowInvalidationChecker for MemAccessUtils API. The main goal of this checker is to find the access scope. To do that, it needs to use `getAccessBegin`, which in turn needs to handle address_to_pointer. Use isAccessedStorageCast to handle more cases, do a small refactoring, and fix minor issues.

view details

Andrew Trick

commit sha e945117450f5e7ce1a71279b119c04bca6d3ac70

fixup use visitor

view details

push time in 8 days

create barnchatrick/swift

branch : rewrite-loadborrowchecker

created branch time in 8 days

push eventatrick/swift

Andrew Trick

commit sha c2224a8bcec09098f8fe03bedadabe0511746cfe

AccessUseVisitor

view details

push time in 8 days

push eventatrick/swift

Mike Ash

commit sha ece0399d601eec1069131f465bdbe7e16f4c6a50

[Runtime] Have ConcurrentReadableHashMap use 1-byte or 2-byte indices when possible.

view details

Nate Chandler

commit sha 4cfadfae00f31fc66581ad270176e4916682bf51

[NFC] Documented IRGenFunction::IndirectReturn.

view details

Nate Chandler

commit sha 607772aaa21ce58db04236cb817b5958c72b2123

[Runtime] Stubbed entry points for task de/alloc.

view details

Nate Chandler

commit sha 59bb1fc23592bcc4eb18bca32dcbff9de4b7e751

[Concurrency] Pass "async" into SILFunctionTypes. This reverts commit 3a48396110d2639d7b90970bc0369a559adbc0c1.

view details

Doug Gregor

commit sha e36011def493dceec79381f2e4a051f1f1e610fe

[Type checker] Delay the diagnosis of missing witnesses further. The handling of "global" missing witnesses would diagnose a missing witness (showing "almost" matches) and then, later, provide the Fix-It to add the declaration if the user wants it. Delay the diagnostic part until later, when we add the missing witness. While here, correct an existing issue with memory corruption that occurs because we would diagnose some of these witnesses, then clear a "global" witness list, while still iterating through parts of that list.

view details

Doug Gregor

commit sha fe4a8bb9f926684d2621fba13cc326580380bcbc

[Clang importer] Allow both sync and async imports with the same name. The Clang importer was filtering out cases where the same declaration is imported twice under the same name, which can now happen when one is synchronous and one is asynchronous. This happens when, e.g., an Objective-C class provides both a completion-hander-based asynchronous version and a synchronous version, and the Swift names line up after the completion-handler parameter is dropped. Stop filtering these out. Overload resolution is capable of handling synchronous/asynchronous overloading based on context.

view details

Doug Gregor

commit sha 50f870566a1a35b4073adb1bce078451790b74a5

Handle conformance with multiple protocol requirements with the same selector. When concurrency is enabled, the same Objective-C method on a protocol can be imported as two different protocol requirements, both of which have the same selector. When performing conformance checking, only treat a given @objc protocol requirement as "unsatisfied" by a conformance if none of the requirements with the same Objective-C selector (+ instance/class designation) are satisfied.

view details

Doug Gregor

commit sha 591e6e89e259818a8dd56bbba41057e776d92c8a

[Concurrency] Only infer @asyncHandler for witnesses within actor classes. Actor classes are by definition new code, so only perform inference of @asyncHandler from a protocol requirement to witnesses when those witnesses are within an actor class. This is partly because @asyncHandler might not have reasonable semantics outside of actor classes anywhere (where would you execute the detached task?), and partly because it is a source-compatibility problem due to the combination of... 1) Inferring @asyncHandler on imported Objective-C protocol methods for existing protocols, 2) Inferring @asyncHandler from those protocol methods to an existing method in a class that conforms to that protocol, and 3) Using an API that is now overloaded for both synchronous and asynchronous callers will end up preferring the asynchronous version, then fail due to a missing "await". The individual steps here are all reasonable, but the result is a source break, so back off on @asyncHandler inference for witnesses outside of actor classes. New code gets the more-asynchronous behavior for free.

view details

Doug Gregor

commit sha bb066b6fa68f06885c84838be7f7e264d70bc0e6

[Concurrency] Make actor-isolated protocol witnesses an error. With actor isolation checking for protocol witnesses moved out of the witness-matching phase, move the corresponding diagnostics from notes (that would have been on the "type does not conform" error) to freestanding errors.

view details

Simon Evans

commit sha 960d0e30ee2b70ba3bb7ec076c16045afab01589

Linux: Fix -static-executable and remove swiftImageInspectionShared - Remove references to swiftImageInspectionShared on Linux and dont have split libraries between static/non-static linked executables. - -static-executable now links correctly Linux. Note: swift::lookupSymbol() will not work on statically linked executables but this can be worked around by using the https://github.com/swift-server/swift-backtrace package.

view details

Vincent Esche

commit sha 6ab35727cf5baed7d7bab1bad7b1201f057c5d59

Fixed docs link to Rust's demand-driven compilation guide

view details

Cassie Jones

commit sha 8ffaf79ec2e106a58dff2402a06210bf9ca97357

[build] Support installing swift-driver without swiftpm The install-swift-driver phase knows how to build swift-driver using CMake. Allowing only install-swift-driver without plain swift-driver allows installing it without requiring swiftpm.

view details

Michael Gottesman

commit sha e7761cf997897aaa38af0d0969ca9acd7e504fbf

[DebuggingTheCompiler] Document a few flags for dumping llvm-ir. I needed to use these and realized they were not documented here. I had them in my brain, but others may not, so seemed good to do.

view details

Argyrios Kyrtzidis

commit sha 73727051fa61fe48b12bfc72233cdf28d804f58f

[AST] Fix linker errors with the parser-only build

view details

Xi Ge

commit sha 00eb2e9db2140d7a7acdd9aa3176e12df9012a7d

Frontend: add a frontend flag to disable building module from textual interface This is for testing purposes to ensure prebuilt modules are up to date. rdar://68770805

view details

Cassie Jones

commit sha 20995ae0bbf765d39cb28c63318e301c27cc2157

[build] Add FILES_MATCHING to CMakeLists.txt The bare "PATTERN" argument by default does nothing, you need either "EXCLUDE" or "FILES_MATCHING" to make it do something. This likely wasn't previously a problem because clang is only installing headers, but it should be fixed for robustness.

view details

Erik Eckstein

commit sha f3d668e3621b96ae37660ac621fb35b49b901d47

SILOptimizer: fix ARC code motion problem for metatype casts. RCIdentityAnalysis must not look through casts which cast from a trivial type, like a metatype, to something which is retainable, like an AnyObject. On some platforms such casts dynamically allocate a ref-counted box for the metatype. Now, if the RCRoot of such an AnyObject would be a trivial type, ARC optimizations get confused and might eliminate a retain of such an object completely. rdar://problem/69900051

view details

ladd

commit sha b23b335ac85695b628deaf199214464d62a042b2

Update CompilerPerformance.md Typo fix, and fix parameter `--raw-clang-ast`

view details

Robert Widmann

commit sha 82e9935885bed95b0091476bfda95f4fdae14e9b

Correct the Serialization of Embedded Swift Dependencies llvm-bcanalyzer does *not* like it when there are multiple block info metadata blocks in the same bitstream file. This patch will skip the emission of that and just jump straight to the metadata block when we're not reading a "standalone" incremental dependency file. While I'm here, also add the right block abbreviation info so we can get a decent dump from llvm-bcanalyzer

view details

Robert Widmann

commit sha d7cd605c3129bd567f5be18b57eec33135dc439e

Adjust the Registration of the Pseudo-Job for External Incremental Dependencies Register the module the external dependencies ride in with the pseudo-job in the Driver. This is a hack.

view details

push time in 9 days

Pull request review commentapple/swift

SILOptimizer: fix a miscompile in TempRValueOpt and improve MemBehavior

 MemBehavior MemoryBehaviorVisitor::visitBuiltinInst(BuiltinInst *BI) { }  MemBehavior MemoryBehaviorVisitor::visitTryApplyInst(TryApplyInst *AI) {-  MemBehavior Behavior = MemBehavior::MayHaveSideEffects;-  // Ask escape analysis.-  if (!EA->canEscapeTo(V, AI))-    Behavior = MemBehavior::None;--  // Otherwise be conservative and return that we may have side effects.-  LLVM_DEBUG(llvm::dbgs() << "  Found tryapply, returning " << Behavior <<'\n');-  return Behavior;+  return getApplyBehavior(AI); }  MemBehavior MemoryBehaviorVisitor::visitApplyInst(ApplyInst *AI) {+  return getApplyBehavior(AI);+} -  FunctionSideEffects ApplyEffects;-  SEA->getCalleeEffects(ApplyEffects, AI);+MemBehavior MemoryBehaviorVisitor::visitBeginApplyInst(BeginApplyInst *AI) {+  return getApplyBehavior(AI);+}++MemBehavior MemoryBehaviorVisitor::visitEndApplyInst(EndApplyInst *EAI) {+  return getApplyBehavior(EAI->getBeginApply());+}++MemBehavior MemoryBehaviorVisitor::visitAbortApplyInst(AbortApplyInst *AAI) {+  return getApplyBehavior(AAI->getBeginApply());+}++/// Returns true if the \p address may have any users which let the address+/// escape in an unusual way, e.g. with an address_to_pointer instruction.+static bool hasEscapingUses(SILValue address, int &numChecks) {+  for (Operand *use : address->getUses()) {+    SILInstruction *user = use->getUser();+    +    // Avoid quadratic complexity in corner cases. A limit of 24 is more than+    // enough in most cases.+    if (++numChecks > 24)+      return true;++    switch (user->getKind()) {+      case SILInstructionKind::DebugValueAddrInst:+      case SILInstructionKind::FixLifetimeInst:+      case SILInstructionKind::LoadInst:+      case SILInstructionKind::StoreInst:+      case SILInstructionKind::CopyAddrInst:+      case SILInstructionKind::DestroyAddrInst:+      case SILInstructionKind::DeallocStackInst:+        // Those instructions have no result and cannot escape the address.+        break;+      case SILInstructionKind::ApplyInst:+      case SILInstructionKind::TryApplyInst:+      case SILInstructionKind::BeginApplyInst:+        // Apply instructions can not let an address escape either. It's not+        // possible that an address, passed as an indirect parameter, escapes+        // the function in any way (which is not unsafe and undefined behavior).+        break;+      case SILInstructionKind::OpenExistentialAddrInst:+      case SILInstructionKind::UncheckedTakeEnumDataAddrInst:+      case SILInstructionKind::StructElementAddrInst:+      case SILInstructionKind::TupleElementAddrInst:+      case SILInstructionKind::UncheckedAddrCastInst:+        // Check the uses of address projections.+        if (hasEscapingUses(cast<SingleValueInstruction>(user), numChecks))+          return true;+        break;+      case SILInstructionKind::AddressToPointerInst:+        // This is _the_ instruction which can let an address escape.+        return true;+      default:+        // To be conservative, also bail for anything we don't handle here.+        return true;+    }+  }+  return false;+} -  MemBehavior Behavior = MemBehavior::None;+MemBehavior MemoryBehaviorVisitor::getApplyBehavior(FullApplySite AS) { -  // We can ignore mayTrap().-  bool any_in_guaranteed_params = false;-  for (auto op : enumerate(AI->getArgumentOperands())) {-    if (op.value().get() == V &&-        AI->getSubstCalleeConv().getSILArgumentConvention(op.index()) == swift::SILArgumentConvention::Indirect_In_Guaranteed) {-      any_in_guaranteed_params = true;-      break;+  // Do a quick check first: if V is directly passed to an in_guaranteed+  // argument, we know that the function cannot write to it.+  for (Operand &argOp : AS.getArgumentOperands()) {+    if (argOp.get() == V &&+        AS.getArgumentConvention(argOp) ==+          swift::SILArgumentConvention::Indirect_In_Guaranteed) {+      return MemBehavior::MayRead;     }   } -  if (any_in_guaranteed_params) {-    // one the parameters in the function call is @in_guaranteed of V, ie. the-    // callee isn't allowed to modify it.-    Behavior = MemBehavior::MayRead;-  } else {-    auto &GlobalEffects = ApplyEffects.getGlobalEffects();-    Behavior = GlobalEffects.getMemBehavior(RetainObserveKind::IgnoreRetains);--    // Check all parameter effects.-    for (unsigned Idx = 0, End = AI->getNumArguments();-         Idx < End && Behavior < MemBehavior::MayHaveSideEffects; ++Idx) {-      auto &ArgEffect = ApplyEffects.getParameterEffects()[Idx];-      auto ArgBehavior = ArgEffect.getMemBehavior(RetainObserveKind::IgnoreRetains);-      if (ArgEffect.mayRelease()) {-        Behavior = MemBehavior::MayHaveSideEffects;-        break;-      }-      auto NewBehavior = combineMemoryBehavior(Behavior, ArgBehavior);-      if (NewBehavior != Behavior) {-        SILValue Arg = AI->getArgument(Idx);-        // We only consider the argument effects if the argument aliases V.-        if (!Arg->getType().isAddress() || mayAlias(Arg))-          Behavior = NewBehavior;-      }+  SILValue object = getUnderlyingObject(V);+  int numUsesChecked = 0;+  +  // For exclusive/local addresses we can do a quick and good check with alias+  // analysis. For everything else we use escape analysis (see below).+  // TODO: The check for not-escaping can probably done easier with the upcoming+  // API of AccessStorage.

Thanks. Yes, AccessedStorage replaces getUnderlyingObject and my current branch has a "use visitor" that hasEscapingUses will trivially plug into. This is exactly how I expected the new API to be used, and this is specifically one of the things I wanted to do to improve alias analysis. The new utilities will remove remove some of the implementation here, ensure that the def-use/use-def logic is symmetric, complete and consistent with all the other address analysis in the compiler, and independently verified/tested.

eeckstein

comment created time in 9 days

Pull request review commentapple/swift

SILOptimizer: fix a miscompile in TempRValueOpt and improve MemBehavior

 class MemoryBehaviorVisitor   // memory this will be unnecessary.

Is this FIXME supposed to go away now?

eeckstein

comment created time in 9 days

Pull request review commentapple/swift

SILOptimizer: fix a miscompile in TempRValueOpt and improve MemBehavior

 MemBehavior MemoryBehaviorVisitor::visitBuiltinInst(BuiltinInst *BI) { }  MemBehavior MemoryBehaviorVisitor::visitTryApplyInst(TryApplyInst *AI) {-  MemBehavior Behavior = MemBehavior::MayHaveSideEffects;-  // Ask escape analysis.-  if (!EA->canEscapeTo(V, AI))-    Behavior = MemBehavior::None;--  // Otherwise be conservative and return that we may have side effects.-  LLVM_DEBUG(llvm::dbgs() << "  Found tryapply, returning " << Behavior <<'\n');-  return Behavior;+  return getApplyBehavior(AI); }  MemBehavior MemoryBehaviorVisitor::visitApplyInst(ApplyInst *AI) {+  return getApplyBehavior(AI);+} -  FunctionSideEffects ApplyEffects;-  SEA->getCalleeEffects(ApplyEffects, AI);+MemBehavior MemoryBehaviorVisitor::visitBeginApplyInst(BeginApplyInst *AI) {+  return getApplyBehavior(AI);+}++MemBehavior MemoryBehaviorVisitor::visitEndApplyInst(EndApplyInst *EAI) {+  return getApplyBehavior(EAI->getBeginApply());+}++MemBehavior MemoryBehaviorVisitor::visitAbortApplyInst(AbortApplyInst *AAI) {+  return getApplyBehavior(AAI->getBeginApply());+}++/// Returns true if the \p address may have any users which let the address+/// escape in an unusual way, e.g. with an address_to_pointer instruction.+static bool hasEscapingUses(SILValue address, int &numChecks) {+  for (Operand *use : address->getUses()) {+    SILInstruction *user = use->getUser();+    +    // Avoid quadratic complexity in corner cases. A limit of 24 is more than+    // enough in most cases.+    if (++numChecks > 24)+      return true;++    switch (user->getKind()) {+      case SILInstructionKind::DebugValueAddrInst:+      case SILInstructionKind::FixLifetimeInst:+      case SILInstructionKind::LoadInst:+      case SILInstructionKind::StoreInst:+      case SILInstructionKind::CopyAddrInst:+      case SILInstructionKind::DestroyAddrInst:+      case SILInstructionKind::DeallocStackInst:+        // Those instructions have no result and cannot escape the address.+        break;+      case SILInstructionKind::ApplyInst:+      case SILInstructionKind::TryApplyInst:+      case SILInstructionKind::BeginApplyInst:+        // Apply instructions can not let an address escape either. It's not+        // possible that an address, passed as an indirect parameter, escapes+        // the function in any way (which is not unsafe and undefined behavior).+        break;+      case SILInstructionKind::OpenExistentialAddrInst:+      case SILInstructionKind::UncheckedTakeEnumDataAddrInst:+      case SILInstructionKind::StructElementAddrInst:+      case SILInstructionKind::TupleElementAddrInst:+      case SILInstructionKind::UncheckedAddrCastInst:+        // Check the uses of address projections.+        if (hasEscapingUses(cast<SingleValueInstruction>(user), numChecks))+          return true;+        break;+      case SILInstructionKind::AddressToPointerInst:+        // This is _the_ instruction which can let an address escape.+        return true;+      default:+        // To be conservative, also bail for anything we don't handle here.+        return true;+    }+  }+  return false;+} -  MemBehavior Behavior = MemBehavior::None;+MemBehavior MemoryBehaviorVisitor::getApplyBehavior(FullApplySite AS) { -  // We can ignore mayTrap().-  bool any_in_guaranteed_params = false;-  for (auto op : enumerate(AI->getArgumentOperands())) {-    if (op.value().get() == V &&-        AI->getSubstCalleeConv().getSILArgumentConvention(op.index()) == swift::SILArgumentConvention::Indirect_In_Guaranteed) {-      any_in_guaranteed_params = true;-      break;+  // Do a quick check first: if V is directly passed to an in_guaranteed+  // argument, we know that the function cannot write to it.+  for (Operand &argOp : AS.getArgumentOperands()) {+    if (argOp.get() == V &&+        AS.getArgumentConvention(argOp) ==+          swift::SILArgumentConvention::Indirect_In_Guaranteed) {+      return MemBehavior::MayRead;     }   } -  if (any_in_guaranteed_params) {-    // one the parameters in the function call is @in_guaranteed of V, ie. the-    // callee isn't allowed to modify it.-    Behavior = MemBehavior::MayRead;-  } else {-    auto &GlobalEffects = ApplyEffects.getGlobalEffects();-    Behavior = GlobalEffects.getMemBehavior(RetainObserveKind::IgnoreRetains);--    // Check all parameter effects.-    for (unsigned Idx = 0, End = AI->getNumArguments();-         Idx < End && Behavior < MemBehavior::MayHaveSideEffects; ++Idx) {-      auto &ArgEffect = ApplyEffects.getParameterEffects()[Idx];-      auto ArgBehavior = ArgEffect.getMemBehavior(RetainObserveKind::IgnoreRetains);-      if (ArgEffect.mayRelease()) {-        Behavior = MemBehavior::MayHaveSideEffects;-        break;-      }-      auto NewBehavior = combineMemoryBehavior(Behavior, ArgBehavior);-      if (NewBehavior != Behavior) {-        SILValue Arg = AI->getArgument(Idx);-        // We only consider the argument effects if the argument aliases V.-        if (!Arg->getType().isAddress() || mayAlias(Arg))-          Behavior = NewBehavior;-      }+  SILValue object = getUnderlyingObject(V);+  int numUsesChecked = 0;+  +  // For exclusive/local addresses we can do a quick and good check with alias+  // analysis. For everything else we use escape analysis (see below).+  // TODO: The check for not-escaping can probably done easier with the upcoming+  // API of AccessStorage.+  bool nonEscapingAddress =+    (isa<AllocStackInst>(object) || isExclusiveArgument(object)) &&+    !hasEscapingUses(object, numUsesChecked);++  FunctionSideEffects applyEffects;+  SEA->getCalleeEffects(applyEffects, AS);++  MemBehavior behavior = MemBehavior::None;+  MemBehavior globalBehavior = applyEffects.getGlobalEffects().getMemBehavior(+                           RetainObserveKind::IgnoreRetains);++  // If it's a non-escaping address, we don't care about the "global" effects+  // of the called function.+  if (!nonEscapingAddress)+    behavior = globalBehavior;+  +  // Check all parameter effects.+  for (unsigned argIdx = 0, end = AS.getNumArguments();+       argIdx < end && behavior < MemBehavior::MayHaveSideEffects;+       ++argIdx) {+    SILValue arg = AS.getArgument(argIdx);+    +    // In case the argument is not an address, alias analysis will always report+    // a no-alias. Therefore we have to treat non-address arguments+    // conservatively here. For example V could be a ref_element_addr of a+    // reference argument. In this case V clearly "aliases" the argument, but+    // this is not reported by alias analysis.+    if ((!nonEscapingAddress && !arg->getType().isAddress()) ||+         mayAlias(arg)) {

The previous code was carefully designed to avoid calling alias analysis unless the argument behavior changed. I think you should change it back.

eeckstein

comment created time in 9 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventatrick/swift

Andrew Trick

commit sha 45e9c5ee7d7da0b4645112c5fec681ca3e59a46c

MemAccessUtils comment

view details

Andrew Trick

commit sha d26f1b54159d8411b9ac9cf3e65ad4f9087151e1

Clarify findAccessedStorage API.

view details

Andrew Trick

commit sha f4713ae8b6bf360069db782d2c4c4ed2691fd0b0

AccessPathDefUseTraversal

view details

Andrew Trick

commit sha b982fe5a3131797a787a2ada9cf15d383062dd76

LoadBorrowInvalidation: fix mysteriously inverted boolean returns.

view details

Andrew Trick

commit sha 5705855d23e0755c9e201bbd274a07153895fd21

LoadBorrowImmutabilityChecker renaming. Limit names to a straightforward and unambiguous statement of purpose. They should not pose additional questions which can only be answered by reading the code. Nuanced meaning belongs in descriptions and code comments. These are all examples that legitimately made reading the code very difficult for me: - LoadBorrowInvalidationChecker: what does "invalidation" mean in this context? How does that extend the meaning of "checker"? How can something ever pass a checker and not be invalid? - constructValuesForKey outside of an ADT does not state purpose at all. - wellBehavedWriteAccumulator: Raises questions about what writes are included and the broader semantics of the parent function. It turns out that well-behavedness is handled by the function's return value and has nothing to do with the accumulator.

view details

Andrew Trick

commit sha dfa498d53a9d3ddc6f9bcac879c61cc06ec6442f

load-borrow

view details

push time in 14 days

push eventatrick/swift

Andrew Trick

commit sha 2b2174f16efe85fc9be041c4807d6735f29c1bec

def-use hacking

view details

push time in 14 days

push eventatrick/swift

Andrew Trick

commit sha 399bd99b8719d4c6e83271adef55cf04edd36d41

fixup def-use traversal

view details

Andrew Trick

commit sha f8bbc99dcc530c8ce2c365967b6ab861cecbabb3

computeForStorage

view details

Andrew Trick

commit sha 949235cbb84eb3000e5671fbe9de04aa565a7af3

def-use hacking

view details

push time in 15 days

push eventatrick/swift

Antoine Cœur

commit sha 4c30f8bd6de5487603ed645cc4dd2a2983f4f0ba

appendingPathComponent(:isDirectory:) should account for isDirectory

view details

Xiaodi Wu

commit sha 26cda274ca78b1df246521ba1eeea33285b57d5f

[stdlib] Simplify 'BinaryFloatingPoint.init?<T: BinaryFloatingPoint>(exactly: T)'

view details

Alexis Laferrière

commit sha 14e6772dc04cf778ba393bebc21a0a8b8ada3603

Consider inherited platform unavailability to silence diagnostics rdar://68597591

view details

Arnold Schwaighofer

commit sha 8e8c57caf59f043b4046ad0df6e7c358bcac9903

SIL type lowering: Compute IsTypeExpansionSensitive and use it instead of TypeBase's hasOpaqueArchetypePropertiesOrCases A type is IsTypeExpansionSensitive if it contains an opaque result type that influences how the type is lowered. This could be because the type mentions an opaque archetype and therefore we would look through to the underlying type depending on the type expansion and could get a different SIL type. For example '() -> out some P' could lower to '() -> @out Int'. Or this could be because when we lower an aggregate type some of its fields are opaque types that could be looked through and therefore the aggregate has different lowering (e.g address vs. loadable) in different type expansion contexts. By replacing it this change also fixes an infinite recursion in hasOpaqueArchetypePropertiesOrCases. rdar://68798822

view details

Cassie Jones

commit sha e01893cb56f989b20ba4309286450105211f031e

[build-script] Add a flag for sccache This adds a flag to enable sccache in order to simplify the build-script invocation, particularly for new contributors.

view details

Cassie Jones

commit sha 6d92486c9a6ddc8b71f7c842d546ae3599be5c30

[build-script] Add SWIFT_ prefix to USE_SCCACHE env var

view details

Cassie Jones

commit sha 7ef9b3287ab097ce2bdd1ab70f9ed9df20d39ff1

[build-script] Fix CMake sccache test

view details

Robert Widmann

commit sha 74765a8ba82a14d3fce03e156049f65845c2cbfa

Remove Type Body Fingerprints Flags This infrastructure has more than proven itself. Drop the code paths and tests supporting the status quo.

view details

Joe Groff

commit sha a664a33b52680bca4c80d6749583a86da6bac902

SIL: Add instructions to represent async suspend points. `get_async_continuation[_addr]` begins a suspend operation by accessing the continuation value that can resume the task, which can then be used in a callback or event handler before executing `await_async_continuation` to suspend the task.

view details

Robert Widmann

commit sha 964f640636d848318d35fc48e25df624a55fef91

Drop "Private Deps" Flag In order for type body fingerprints to work, these declarations must always be included. Drop the ability to turn this off.

view details

Fero

commit sha 28f3e442135d7ae60c1522e8da41322350f84171

Fix typo

view details

Fero

commit sha b0b546873ca8c47b99cdae99110f94d2cbaa5283

Fix typo

view details

Erik Eckstein

commit sha 903786f5ab88056e2abc5b5db99b0107d6d06461

tests: correct availability checks in Interpreter/runtime_name_local_class_opaque_type.swift The test checks a fix, which also affects the runtime. Therefore, the test requires a minimum OS version to run without a crash.

view details

Cassie Jones

commit sha b5247d2c8f9c4133ba165370d92370600cf67ece

Fix formatting issue

view details

Egor Zhdan

commit sha ae9715ac0311e1d65dc4fed957e067ee2654d8ea

WinSDK: extract System submodule with winioctl.h Currently this header gets included into `WinSDK.WinSock2` via windows.h & winscard.h

view details

Slava Pestov

commit sha 554e0f97e60f3873dcdae3e5bfd03ce45345e8c1

AST: Find local property wrappers in ASTScope::lookupLocalDecls() Two fixes here: - The ASTScopeDeclConsumerForLocalLookup needs to visit auxiliary variables - preCheckExpression() should call ASTScope::lookupLocalDecls() even when parser lookup is enabled, since otherwise we won't be able to find auxiliary decls in the current DeclContext.

view details

Robert Widmann

commit sha 92cb6808fe870dcee5afb73b23d25d950a7254f4

Merge pull request #34151 from CodaFi/body-paint Remove Type Body Fingerprints Flags

view details

Joe Groff

commit sha 95f1bd3bf8210e0d584f879770e2ad4142100d0e

Merge pull request #34142 from jckarter/async-await-sil-instructions SIL: Add instructions to represent async suspend points.

view details

Xi Ge

commit sha 11b2251ac18de4fa7e78a132afb9ff0e7457af63

Driver: forwarding driver invocations to the new driver when SWIFT_USE_NEW_DRIVER is defined This allows us to experiment with the new swift-driver without changing build systems.

view details

Slava Pestov

commit sha 836a8eef3f9e22f96c76df854aa0777d5c8efd82

Merge pull request #34164 from slavapestov/fix-local-property-wrappers AST: Find local property wrappers in ASTScope::lookupLocalDecls()

view details

push time in 16 days

push eventatrick/swift

Andrew Trick

commit sha bcddc828d3c4907740cde799d1e686a9a58abe00

Add AccessPathWithBase::computeForAccessScope API.

view details

Andrew Trick

commit sha e66580727bb75e24095b6157f3b3685a4f753211

Hacking on LoadBorrowInvalidation

view details

push time in 17 days

push eventatrick/swift

Owen Voorhees

commit sha 6b6b640e133ca547139c6586eb0dcbf7933b46ec

[Driver] Don't test for null source locations in driver diagnostics swift-driver doesn't emit these, and there's no reason to check that they're present when using the integrated driver.

view details

Joe Groff

commit sha 023066c1966c63ab3b7a4baee31ac24d29b7de36

SILGen: Relax assertion that incorrectly tripped on lowered opaque capture types. When lowering the SILConstantInfo for a closure implementation type with captures, we are more conservative about substituting opaque types in the capture, since the underlying types may only be available in the local context. This means the SILConstantInfo type may not in fact be exactly what you get from `SILFunction::getFunctionTypeInContext` referencing the implementation function from its originating context, since those opaque types will be substituted in the local context. Fixes SR-13480 | rdar://problem/68159831.

view details

Pavel Yaskevich

commit sha 8c6098a3de956ca058d55a0d4875b29e3ce38498

[CSFix] Add a fix to detect when type of couldn't be inferred

view details

Artem Chikin

commit sha d913fc609f191a01bc131f37858b00b87d94a328

[Build Script] Pass down a CMake path to swift-driver's build script

view details

Pavel Yaskevich

commit sha 1fb69a7d43f4c3aa58d88309d54537bce61f3d56

[Diagnostics] Diagnose cases when it's impossible to infer type for `nil` Detect and diagnose situations when it's invalid to use `nil` literal without more context e.g. `_ = nil`, `nil as? Int`, or `_ = nil!`.

view details

Pavel Yaskevich

commit sha 7d6a11021030731e4e617bb5a8a995d20dc65087

[CSSimplify] Allow `optional object` constraint to look through holes If right-hand side (optional type) has been determined to be a hole, let's establish that optional object of a hole is a hole and continue searching for a solution.

view details

Pavel Yaskevich

commit sha 1b5ce2b88f6c1adde6a30cb7b0b15955628a7fde

[CSBindings] Start recording `SpecifyContextualTypeForNil` fix when `nil` is bound to a hole

view details

Pavel Yaskevich

commit sha e30bdacd5792737cb1e31a9ba884b1bf6e513028

[CSBindings] Adjust impact of an event when `nil` is bound to a hole

view details

Pavel Yaskevich

commit sha a2b3b545230df44734077af68f59adde65fc3067

[CSGen] Rework constraint generation for `nil` to avoid failing

view details

Pavel Yaskevich

commit sha f96d6d348679f75313ac97a0e8451a34e3ec10fa

[Diagnostics] Remove obsolete special case for `_ = nil`

view details

Michael Gottesman

commit sha e022a952ca63e4702a79af4e3bedef49c4637ea9

[build-toolchain] Add distcc like integration for using sccache. Disabled by default.

view details

Holly Borla

commit sha 3a47087cc197aab8970a55ee265d395bc4f6f002

[Parser] Don't resolve decl references in the parser if the declaration has a custom attribute.

view details

Daniel Rodríguez Troitiño

commit sha 9a24aaf7140af68cdc8101b73cdfc6a17b4ae9aa

[android] Disable a test that needs LTO support. With Gold from the Android NDK setting up LTO is complicated, and the CI machines are not setup for it. Disable this test in platforms that do not use LLD and LTO (which is basically Android with older NDKs).

view details

Saleem Abdulrasool

commit sha 35d765f87cd2a306759b29bf5bfb287e54f604d1

Merge pull request #34098 from drodriguez/android-disable-lto-test [android] Disable a test that needs LTO support.

view details

Artem Chikin

commit sha 692fdde4fee0a40e5de5e6fa470ca8fd817c7ad8

Move explicit module frontend options out of the set of flags emitted into module interfaces. They never belonged there and were placed there by accident.

view details

Pavel Yaskevich

commit sha 4d0ab13c36fdb59267406c150c98f5d95379254a

Merge pull request #34089 from xedin/nil-as-a-hole [Diagnostics] Diagnose cases when it's impossible to infer type for `nil` literal

view details

Joe Groff

commit sha 6a597d4d04f11f129ffe06422ab33c535ca64a11

Merge pull request #33945 from jckarter/serialized-capture-opaque-type-subst-assert SILGen: Relax assertion that incorrectly tripped on lowered opaque capture types.

view details

Varun Gandhi

commit sha 8e63a4b43f77d8530b58f84939447cffc9692e79

[Serialization] Gate Clang type (de)serialization behind UseClangFunctionTypes.

view details

Varun Gandhi

commit sha 88e256256b72fb6c2d4a25ba21caaa47d27d18e5

[NFC] Tidy up test relying to Clang type serialization.

view details

Mishal Shah

commit sha 1a1e0a64233dafee15e32276c91801f59e23e8f3

Merge pull request #34096 from gottesmm/pr-e09fb1acb2d9141d06c4b2e42e33c6878c07b346 [build-toolchain] Add distcc like integration for using sccache.

view details

push time in 18 days

pull request commentapple/swift

Fix another use-after-free in SILCombine

@gottesmm I looked at the issue with @meg-gupta. The SILBuilder optimizations can be canonicalizations, which means we shouldn't need to update any tests, unless we end up optimizing even more in some cases.

meg-gupta

comment created time in 18 days

pull request commentapple/swift

Fix another use-after-free in SILCombine

@meg-gupta @eeckstein I just want to make it clear that none of these utility APIs should be taking callbacks and the builder should never erase instructions. It's fine for the builder to "fold" a potential new instruction into an existing one. Any other peepholes that the builder does should be in a separate cleanup routine that's called by the pass, given callbacks if needed, given the same BuilderContext, and driven by the list of new instructions.

meg-gupta

comment created time in 19 days

pull request commentapple/swift

Fix another use-after-free in SILCombine

I can't make sense of this design. Why is the builder deleting anything? And why would we pass around callbacks in addition to a builder? The builder is only supposed to create instructions (or find an existing instruction to use), and it keeps a track of any new instructions it creates. Basic SIL utilities, which often take a builder, shouldn't delete anything either, and shouldn't need to take any callbacks. If SILCombine needs to know about new instructions, it can get that from the builder's context.

meg-gupta

comment created time in 19 days

PR opened apple/swift

AccessPath: Look past class casts when finding the reference root.

For class storage AccessedStorage is now close to what some passes use for RC identity, but it still does not look past wrapping references in an Optional.

+3670 -602

0 comment

39 changed files

pr created time in 20 days

push eventatrick/swift

Owen Voorhees

commit sha 6b6b640e133ca547139c6586eb0dcbf7933b46ec

[Driver] Don't test for null source locations in driver diagnostics swift-driver doesn't emit these, and there's no reason to check that they're present when using the integrated driver.

view details

Joe Groff

commit sha 023066c1966c63ab3b7a4baee31ac24d29b7de36

SILGen: Relax assertion that incorrectly tripped on lowered opaque capture types. When lowering the SILConstantInfo for a closure implementation type with captures, we are more conservative about substituting opaque types in the capture, since the underlying types may only be available in the local context. This means the SILConstantInfo type may not in fact be exactly what you get from `SILFunction::getFunctionTypeInContext` referencing the implementation function from its originating context, since those opaque types will be substituted in the local context. Fixes SR-13480 | rdar://problem/68159831.

view details

Pavel Yaskevich

commit sha 8c6098a3de956ca058d55a0d4875b29e3ce38498

[CSFix] Add a fix to detect when type of couldn't be inferred

view details

Kuba Mracek

commit sha a20118b54deebb2aa768294b19ef25de62339b23

When building modules on secondary threads via RunSafelyOnThread, request 8 MB of stack

view details

Doug Gregor

commit sha 6fe5245899d6613e0d7e35a1ee539d8a84114678

Fix grammatical error in a new comment

view details

Artem Chikin

commit sha d913fc609f191a01bc131f37858b00b87d94a328

[Build Script] Pass down a CMake path to swift-driver's build script

view details

Robert Widmann

commit sha 7917d723c3cb0b9b794819797bb5ac53c76d2b13

Teach the Driver to Read Fine-Grained Dependency Graphs in Swiftdeps Files

view details

Robert Widmann

commit sha e35f0601443636cfa9ee75f1ede41e4cd09b9782

Install Incremental External Dependency Integration Code An incremental build involving incremental external dependencies behaves as a hybrid between an external dependency and a normal swiftdeps-laden Swift file. In the simplest case, we will fall back to the behavior of a plain external dependency today. That is, we will check its timestamp, then schedule all jobs that involve these external dependencies if it is out of date. Where things get interesting is when cross-module incremental builds are enabled. In such a case, we know that a previous compiler has already emitted serialized swiftdeps information inside of a swiftmodule file. Moreover, we know that that swiftmodule file was loaded by the build of the current swift module. Finally, thanks to the previous stack of commits, we now know exactly how to extract this information from the swiftmodule file. To bring this all home, we unpack incremental dependency information from external dependencies, then integrate them into the current dependency graph - as though they were any other swiftdeps file. This neatly extends the single-module incremental logic to the multi-module case.

view details

Doug Gregor

commit sha f07c7d15feb4444c603e404f8e10274f275a7104

[Type checker] Eliminate a use-after-free due to C++ temporaries. Found by Brent using ASan, thank you!

view details

Egor Zhdan

commit sha 70a6d2c7c524c1c9576ba1f0d31f53dfa0191b4a

WinSDK: extract version into a separate submodule Currently winver.h gets included into `WinSDK.WinSock2`, however its usages might not be related to sockets, and it requires linking against `Version.Lib`

view details

Slava Pestov

commit sha 29ce77209ce349a4c22740101c0d9e4e3b4ae15d

AST: Convert ConstructorDecl::getDelegatingOrChainedInitKind() into a request This method had a messy contract: - Setting the diags parameter to nullptr inhibited caching - The initExpr out parameter could only used if no result had yet been cached Let's instead use the request evaluator here.

view details

Slava Pestov

commit sha 6b98f8f3b5b9c786912d59f7775996292801c88e

ASTScope: Add a new lookupSingleLocalDecl() entry point This is used in a few places that used to expect parsed but not yet type-checked code to contain DeclRefExprs that reference local bindings. Instead, we can call lookupSingleLocalDecl() with an UnresolvedDeclRefExpr instead.

view details

Slava Pestov

commit sha dcafd585c133319189291b06e213165b6d28b49b

Sema: Use ASTScope::lookupSingleLocalDecl() in MissingOptionalUnwrapFailure

view details

Slava Pestov

commit sha 8ec878bb43cb69570cbec8fd4a60326018c55690

Sema: Use ASTScope::lookupSingleLocalDecl() in CSGen's CollectVarRefs pass When parse-time lookup is disabled, we have to resolve UnresolvedDeclRefExprs inside the closure body, since there's no guarantee that preCheckExpression() has run yet.

view details

Slava Pestov

commit sha ddc0cbd2d4ea1182428c0a88b88a5db2cd1ca3e6

Sema: Use ASTScope::lookupSingleLocalDecl() in BodyInitKindRequest

view details

Slava Pestov

commit sha 6a82f242ac540174111fb346e5d0c47946fd9d53

Sema: Don't trigger ImplInfoRequest from TypeChecker::buildRefExpr() It's too early to do that here, because we may be building a reference to a ParamDecl that is not yet known to be inout, because the constraint solver has not run yet. Instead, always compute the access semantics in CSApply.

view details

Pavel Yaskevich

commit sha 1fb69a7d43f4c3aa58d88309d54537bce61f3d56

[Diagnostics] Diagnose cases when it's impossible to infer type for `nil` Detect and diagnose situations when it's invalid to use `nil` literal without more context e.g. `_ = nil`, `nil as? Int`, or `_ = nil!`.

view details

Pavel Yaskevich

commit sha 7d6a11021030731e4e617bb5a8a995d20dc65087

[CSSimplify] Allow `optional object` constraint to look through holes If right-hand side (optional type) has been determined to be a hole, let's establish that optional object of a hole is a hole and continue searching for a solution.

view details

Pavel Yaskevich

commit sha 1b5ce2b88f6c1adde6a30cb7b0b15955628a7fde

[CSBindings] Start recording `SpecifyContextualTypeForNil` fix when `nil` is bound to a hole

view details

Pavel Yaskevich

commit sha e30bdacd5792737cb1e31a9ba884b1bf6e513028

[CSBindings] Adjust impact of an event when `nil` is bound to a hole

view details

push time in 20 days

push eventatrick/swift

Owen Voorhees

commit sha 6b6b640e133ca547139c6586eb0dcbf7933b46ec

[Driver] Don't test for null source locations in driver diagnostics swift-driver doesn't emit these, and there's no reason to check that they're present when using the integrated driver.

view details

Holly Borla

commit sha 3a47087cc197aab8970a55ee265d395bc4f6f002

[Parser] Don't resolve decl references in the parser if the declaration has a custom attribute.

view details

Brent Royal-Gordon

commit sha aaa4e45fa819ad83f70553bc162532199d436217

[ClangImporter] Update umbrella header diagnostic handling In apple/llvm-project#1860, the diagnostic for a missing import in an umbrella header was improved by moving it to the end of the file and including a fix-it suggesting the import that would be needed. This breaks two things on the Swift side: • One Swift test assumes the old source location will be used. • The `ClangSourceBufferImporter` doesn’t work correctly when a diagnostic is emitted at EOF. It tries to create a virtual file covering EOF..<EOF, but it’s not actually valid to start a virtual file at EOF—it would always be empty. This commit corrects these issues, which should unblock the automerger. Fixes rdar://69707827.

view details

Holly Borla

commit sha 9b2cd5e3ffa09063a8b64250cd0c62850a41fd26

[NameLookup] Teach unqualified lookup to resolve backing property wrapper and projected value references

view details

Holly Borla

commit sha b33dbedd9b8d3dc2e6ee28373c69a24764249745

[SILGen] Teach SIlGen to emit local property wrappers

view details

Holly Borla

commit sha 0842b4212773b36778d773331155df6be20d2c21

[SILGen] Only use assign_by_wrapper for wrapped instance properties inside an initializer, and for wrapped local variables.

view details

Doug Gregor

commit sha ab3c5dee3ea2bea8e29d1e70ed8b9e7a2aeff1be

[Concurrency] Introduce Actor protocol to which actor classes all conform. Introduce a new Actor protocol, which is a class-bound protocol with only one requirement: func enqueue(partialTask: PartialAsyncTask) All actor classes implicitly conform to this protocol, and will synthesize a (currently empty) definition of `enqueue(partialTask:)` unless a suitable one is provided explicitly.

view details

Holly Borla

commit sha 9bd3d0b67fc9599c693735d98c6ff98defccc8e5

[Property Wrappers] Make sure captures are computed for synthesized property wrapper accessors.

view details

Holly Borla

commit sha d8df6217d32cf7ec970d67bc66ff966df0c1a671

[Property Wrappers] Allow property wrappers on local variables.

view details

Holly Borla

commit sha 21cbdfa337dfa41e108573d5d99c6259bee671c9

[Property Wrappers] Add a VarDecl helper method for visiting synthesized property wrapper vars.

view details

Doug Gregor

commit sha 8f3c912f46dc6a2ee3734f741de50bdebf803ec0

[Concurrency] Fix new source file header.

view details

Alexey Komnin

commit sha f18f3daba856ea08660225810e8e84bc2818f145

Fix SR-13490: Fix LT operator and add tests for ImportPath

view details

Ben Langmuir

commit sha 28228eba49a9669ca9c5fb8c88143b8a9c1d2ca5

[code-completion] Fix cache writer for non-decl kind Thanks to Ben Barham for spotting this: sizeof(~static_cast<uint8_t>(...)) is 4, but we need to write a single byte here. Thankfully this code was probably not being hit in the current caching scheme, which only caches declarations. Looking at the history, this code was broken by d8fbaa01eb10, which was fixing an MSVC warning in this code. Unfortunately I do not have access to the version of MSVC to check if there is still a warning here or for what.

view details

Adrian Prantl

commit sha 26b5230f3c93ace3b5ad77ce36826bb5ea5da0d6

Remove stray character.

view details

Pavel Yaskevich

commit sha 427c6478bc448218b11ce04b681502809d3a6c15

[ConstraintSystem] `ConstraintSystem` cannot be const when inferring new bindings It's possible that bindings would need to mutate constraint system e.g. by allocating new locators.

view details

Pavel Yaskevich

commit sha c22027260d69e8f9f0279a27b4b310a2b4bdda5e

[CSBindings] Infer any type variable connected to a code completion token as a potential hole If type variable is associated with a code completion token it's possible that it doesn't have enough contextual information to be resolved to anything, so let's add a hole type which originates from type variable associated with code completion expression to make this relationship explicit and avoid "fixing" problems rooted in fact that type variable is underconstrained due to code completion.

view details

Pavel Yaskevich

commit sha a6c44bfc54faaa96e78f35ed84af80279624210d

[CSBindings] If hole originates from code completion token avoid fixing it If the hole is originated from code completion expression let's not try to add a fix, anything connected to a code completion is allowed to be a hole because presence of a code completion token makes constraint system under-constrained due to e.g. lack of expressions on the right-hand side of the token, which are required for a regular type-check.

view details

Holly Borla

commit sha 2a67c651eecb6ccd6384a90961cfee46338c954e

[Property Wrappers] Generalize a few property wrapper decl context checks to check for type context instead of local context. This generalization will help us implement property wrappers on global variables, which should use the same approach of not adding synthesized accessors to the AST and instead lazily visit them in SILGen.

view details

Doug Gregor

commit sha c2b8565a107920f67ed9074fd4d28d3d7a190fa4

[Concurrency] Implicitly synthesize actor queue storage and enqueue. When an actor class has its `enqueue(partialTask:)` implicitly synthesized, also synthesize a stored property for the actor's queue. The type of the property is defined by the _Concurrency library (`_DefaultActorQueue`), and it will be initialized with a call to `_defaultActorQueueCreate` (also provided by the _Concurrency library). Also synthesize the body of the implicitly-generated `enqueue(partialTask:)`, which will be a call to `_defaultActorQueueEnqueuePartialTask(actor:queue:partialTask:)`. Together, all of these allow us to experiment with the form of the queue and the queue operation without affecting the type checker. When `enqueue(partialTask:)` is not implicitly synthesized, the queue storage is not synthesized either. In such cases, the user has taken over the execution of tasks for the actor, rather than using the default implementation.

view details

Alexey Komnin

commit sha 8615904f768b9e313e796cbc1c6e03cb42bbf974

SR-13490: fix tests to align with new import sorting algorithm

view details

push time in 20 days

more