Skip to content

Conversation

pull[bot]
Copy link

@pull pull bot commented May 13, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

ahoppen and others added 30 commits May 7, 2022 08:58
…t part of the AST

The code completion might occur inside an attriubte that isn’t part of the AST because it’s missing a `VarDecl` that it could be attached to. In these cases, record the `CustomAttr` and type check it standalone, pretending it was part of a `DeclContext`.

This also fixes a few issues where code completion previously wouldn’t find the attribute constructor call and thus wasn’t providing code completion inside the property wrapper.

rdar://92842803
… rename

Previously, we only walked the parent scope of the decl context that declared the value to rename if it was a TopLevelCodeDecl. But also functions can have locally declared types that can be used in sibling scopes. Thus, we always need to walk the parent DeclContext of the one declaring the value we are renaming.

rdar://89836229
When a reflection section has a size that only fits a partial record, we detect it, log an error, and abort. However, things like Remote Mirror need to be robust to bad data, so instead handle this by terminating iteration at the last full record.
…nction call

For enum cases with associated values, their construction is modelled by a function. E.g. if you have
```swift
enum Foo {
  case first(associated: Int)
}
```

then `Foo.first` is a function of type `(Int) -> Foo`. But if you write `Foo.first(associated: 2)` in source code, we consider this construct as a referenced, not a call. This causes us to miss renaming of associated value labels during local refactoring.

rdar://84061868
…t succeed.

The shared cache tables can only point to things within the shared cache, so if the protocol, ObjC class, or type descriptor are outside the shared cache, we know that the lookup will fail and we can skip it.

rdar://90427793
…ry results

When a variable is re-declared using shorthand syntax (`[foo]` closure capture or `if let foo {`), the user doesn’t perceive this as a new variable declaration. Thus, we should return the original declaration as a secondary result.

rdar://91311033
rdar://75455650
Previously, we weren’t annotation code completion results for variables with async or throwing getters as 'async' or 'throws'.

rdar://93085311
Treat a prefix operator containing `/` the same as
the unapplied infix operator case, where we
tentatively lex. This means that we bail if there
is no closing `/` or the starting character is
invalid. This leaves binary operator containing
`/` in expression position as the last place where
we know that we definitely have a regex literal.
Previously we would only check for a starting
character of `)` when performing a tentative
lex of a regex literal. Expand this to cover the
entire range of the regex literal, ensuring to
take escapes and custom character classes into
account.
…on-hole-prop

[Sema] Allow optional hole propagation in code completion mode
…d-cache-protocol-conformances

[Runtime] Skip shared cache protocol conformance queries we know won't succeed.
…n-size-handling

[Reflection] Gracefully handle reflection sections with bad sizes.
…ftlang#58729)

* properly handle `isolated` and `_const` type reprs when printing

rdar://92756749

* make switch non-exhaustive
This just deletes some outdated material, but really the whole paper
needs an overhaul and some major additions to describe generic
signature minimization too.
I don’t see much of a reason to limit these to validation-test.

rdar://91972087
…Ref and not a String

and introduce the StringRef struct.
It's more efficient.

Also, rename the `HasName` protocol to `HasShortDescription`, which introduces the new requirement `shortDescription`. This is need because `name` now has `StringRef` type and not `String` anymore
* add the `Ownership` enum and the `Value.ownership` getter
* add `Function.hasOwnership`
* split the PassUtils.swift file into PassContext.swift and Passes.swift
* rework `Builder` bridging allowing more insertion point variations, e.g. inserting at the end of a block.
* add Builder.create functions for more instructions
* add `PassContext.splitBlock`
* move SIL modification functions from PassContext to extensions of the relevant types (e.g. instructions).
* rename `Location.bridgedLocation` -> `Location.bridged`
and re-factor `Value.definingInstruction`
... to get the enum case index with a given name.
…AvailableIn:)

Utilities to make a value available to be used in another basic block.
Inserts required `copy_value` and `destroy_value` operations in case the destination block is in a different control region than the value.
For example, if the destination block is in a loop while the value is not in that loop, the value has to be copied for each loop iteration.
Generation of valid JSON output for parseable output depends on being able to determine file types of inputs and outputs of compilation tasks. FileTypes.def defines multiple file kinds with multiple '.' extensions, such as '.abi.json' or '.features.json', but existing code attempted to compute file outputs only using the trailing suffix of the path after the last '.'. This led to some files not being recognized, which led to us not being able to generate valid JSON.

Resolves rdar://92961252
slavapestov and others added 17 commits May 12, 2022 17:53
RequirementMachine: Minor documentation updates
…WhenEarlyFail

[Parseable Output] Compute file extensions using full extension strings
[Docs] Updating Getting started documentation from JIRA to Swift Issues
'AnyObject' cannot be instantiated, we shouldn't be providing any
initializers on 'AnyObject' type. 'AnyObject(<HERE>' and global
completions with initializers (i.e. `addinitstotoplevel`) showed all
initializers from objc classes.

Note that, 'lookupVisibleMemberDecls()' on 'AnyObject' (i.e.
'AnyObject.<HERE>') doesn't return initializers even before this change.
But 'QualifiedLookup' did.

rdar://93059166
…ttest-modules

[test] Always build StdlibCollectionUnittest and StdlibUnicodeUnittest
…ectinit-rdar93059166

[CodeCompletion] Don't suggest initializers on 'AnyObject'
Improvements and additions to Swift SIL infrastructure
[CodeCompletion] Annotate variables with effectful getters
…property-attribute

[CodeCompletion] Support type checking attributes even if they are not part of the AST
This reverts commit 3be4a03.

The tests were failing on linux because of C++ string interop is now used in Function.name.
As Function.name now returns a StringRef, this should not be a problem anymore.

Though, the underlying problem is not fixed.
Revert "Gating failing SILOptimizer tests"
Previously if you changed `libstdcxx.h` or `libstdcxx.modulemap` locally and ran an incremental build, the artifacts weren't updated.
…info

[CursorInfo] Report values shadowed using shorthand syntax as secondary results
…s-call

[Index] Consider construction of enums with associated values as a function call
…ifferent

[cxx-interop] Copy libstdc++ resources again if the sources changed
rdar://93247418
rdar://92963081
@kateinoigakukun kateinoigakukun merged commit 98dc522 into swiftwasm May 14, 2022
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.