Skip to content

Conversation

MaxDesiatov
Copy link

No description provided.

meg-gupta and others added 30 commits November 1, 2021 14:03
We remove the existing `swift_reflection_iterateAsyncTaskAllocations` API that attempts to provide all necessary information about a tasks's allocations starting from the task. Instead, we split it into two pieces: `swift_reflection_asyncTaskSlabPointer` to get the first slab for a task, and `+swift_reflection_asyncTaskSlabAllocations` to get the allocations in a slab, and a pointer to the next slab.

We also add a dummy metadata pointer to the beginning of each slab. This allows tools to identify slab allocations on the heap without needing to locate every single async task object. They can then use `swift_reflection_asyncTaskSlabAllocations` on such allocations to find out about the contents.

rdar://82549631
…ambiguous

If there are multiple overloads and all of them require closure
to have a parameter, let's diagnose that as such instead of
ambiguity.
…d code

While building a closure to inject `checkExpect` code, clone member
references associated with assignment. Re-using AST nodes is generally
invalid. This is visible with multi-statement closure inference enabled,
because the body is type-checked together with enclosing context
and both elements end up sharing `DeclRefExpr` and `MemberRefExpr`s.
This preserves previous behavior where multi-statement closures
where always type-checked without context.
…Unchecked` flag

Propagate `LeaveClosureBodyUnchecked` flag from `typeCheckASTNodeAtLoc`
down to declaration checker to skip checking closures associated with
pattern binding entry initializers. This is no-op until multi-statement
inference becomes enabled by default.
…es when inference is enabled

When multi-statement closure inference is enabled it's body is
type-checked together with enclosing context, so they could be
walked directly just like single-expressions ones.
… closures

Extract diagnostic into a method and use it while type-checking
`for-in` in top-level code and in closures.
…t inference is enabled

Scope down previous check to avoid walking into patterns that appear
in multi-statement closures if the inference is enabled.
Preserve pre SE-0326 for code completion, so it could be ported
gradually.
Put some common logic related to local declaration to the base
class and refactor other walkers to use it instead of `ASTWalker`.
…ic parameter holes

Closure result type or generic parameter associated with such a location
could bw inferred from a body of a multi-statement closure (when inference
is enabled), so we need to give closure a chance to run before attemtping
a hole for such positions in diagnostic mode.
Each of the elements in the result builder has to be fully pre-checked
now that multi-statement inference has been enabled.
Allow `LinkedExprAnalyzer` to capture `??` operator and walk into
its arguments because they could have valuable type information,
but don't attempt to favor or link operators if `??` is present in a chain.

Resolves: rdar://85277993
Despite being otherwise disconnected from the
constraint system, it's possible for it to affect
how we type-check tuple matches in certain cases.

This is due to the fact that:
- It can have a lower type variable ID than an
opened generic parameter type, so becomes the
representative when merged with it. And because it
has a different locator, this can influence
binding prioritization.
- Tuple subtyping is broken, as it's currently a
*weaker* relationship than conversion.

Therefore, temporarily restore this bit of logic
for language versions < 6. If possible, we should
try and fix tuple subtying in Swift 6 mode to not
accept label mismatches, so that it's not more
permissive than tuple conversion.

rdar://85263844
This is something that we'd like to fix to bring
in line with tuple conversion, so start warning on
cases where it occurs.
SwiftVersionType needs 5 components, and ClangVersionType needs to match
SwiftVersionType because some build automation wants to mark the clang
version as being the same as the Swift version while generating version
numbers.

Fixes rdar://85508050
xedin and others added 23 commits November 17, 2021 10:12
[CSGen] Rework nil-coalescing operator handling in `LinkedExprAnalyzer`
…for-multi-stmt-closures

[TypeChecker] SE-0326: Enable multi-statement closure inference by default
These were originally meant to be no-return functions since they're going to abort. They were accidentally changed to no-discard functions despite not having a return value.
This is useful if one wants to quickly compile a stdlib with asan enabled
without recompiling the toolchain.
…lab-inspection

[Reflection] Add API for inspecting async task allocation slabs.
Fix OSSA Outliner for scoped guaranteed values
…ser-NINJA_STATUS

[build] Don't overwrite user NINJA_STATUS
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.
…2287592abe13dbc50bbc76d

[build-script] Add some standalone stdlib asan variants.
# Conflicts:
#	cmake/modules/AddSwift.cmake
@kateinoigakukun kateinoigakukun marked this pull request as ready for review November 19, 2021 07:41
@MaxDesiatov MaxDesiatov merged commit 5492814 into swiftwasm Nov 19, 2021
@MaxDesiatov MaxDesiatov deleted the maxd/main-merge branch November 19, 2021 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.