Commit Graph

46922 Commits

Author SHA1 Message Date
swift-ci
7be0429830 Merge pull request #37156 from kavon/eff-prop-extension-interface-bug 2021-04-29 23:16:15 -07:00
Doug Gregor
909218b209 Merge pull request #37146 from hamishknight/completion-handler-async-interface
[AST] Mark @completionHandlerAsync user-inaccessible
2021-04-29 22:50:31 -07:00
eeckstein
776c8edaab Merge pull request #37127 from eeckstein/fix-deadobject-elim
DeadObjectAllocation: fix a use-after free crash
2021-04-30 06:33:18 +02:00
swift-ci
bf6c673fd3 Merge pull request #36959 from ktoso/wip-task-locals-revisions 2021-04-29 20:50:01 -07:00
Slava Pestov
64cc3170dc Add regression test for https://bugs.swift.org/browse/SR-12531 2021-04-29 23:35:32 -04:00
Kavon Farvardin
c1f48c6855 fix missing effects specifiers on eff props in swiftinterface
I missed the case where the body is also being printed in the
interface file.
2021-04-29 20:29:50 -07:00
Adrian Prantl
5fe0c03d5f Allow functions marked @LLDBDebuggerFunction to bypass actor isolation checks
In order to allow LLDB to evaluate expressions inside an actor without spawining
async functions and potentially continue all threads, this relaxes the actor
isolation checks in @LLDBDebuggerFunction functions to allow a synchronous call
into an extension method.

rdar://75905336
2021-04-29 20:13:30 -07:00
Rintaro Ishizaki
8672bacc2b Merge pull request #37144 from rintaro/sourcekit-completion-rdar77188260
[CodeCompletion] Prioritize call argument pattern
2021-04-29 19:58:21 -07:00
Holly Borla
af649e7b41 Merge pull request #37143 from hborla/wrapped-parameter-mutability
[Property Wrappers] Always make sure the storage for a wrapped parameter is immutable.
2021-04-29 19:32:25 -07:00
Robert Widmann
6d37167537 Merge pull request #37141 from CodaFi/heaven-send
Don't Force the Interface Type While Checking Isolation
2021-04-29 17:23:40 -07:00
Hamish Knight
c1e4dc3d82 [Refactoring] Improve Void handling for async conversion
When converting a function with a completion handler
that has a Void success parameter, e.g
`(Void?, Error?) -> Void`, or more likely a
`Result<Void, Error>` parameter, make sure to omit
the `-> Void` from the resulting async function
conversion.

In addition, strip any Void bindings from an async
function call, and any explicit Void return values
from inside the async function.

Resolves rdar://75189289
2021-04-30 01:09:04 +01:00
Arnold Schwaighofer
c236f85039 Merge pull request #37139 from aschwaighofer/disable_swift_function_merging_for_async
Disable swift function merging for swift async functions
2021-04-29 16:10:49 -07:00
Rintaro Ishizaki
f6125c0003 Merge pull request #35097 from rintaro/parse-ifconfig-postfixexpr
SE-0308: Postfix '#if' expression
2021-04-29 16:10:17 -07:00
Rintaro Ishizaki
0dc8e2040d Merge pull request #37125 from rintaro/ide-completion-rdar74233797
[Completion] Look through implicit expr when collecting possible callees
2021-04-29 14:49:54 -07:00
Hamish Knight
a2b5f68ac8 [AST] Mark @completionHandlerAsync user-inaccessible
This attribute is only really useful to the
compiler, so don't expose it to the user through
e.g generated interfaces.

Resolves rdar://76685011
2021-04-29 22:29:55 +01:00
Ben Barham
246bb417dc Merge pull request #37130 from bnbarham/do-not-abs-presumed
[Serialization] Do not absolute path the serialized line directive
2021-04-30 07:24:37 +10:00
Rintaro Ishizaki
3c2433c942 [CodeCompletion] Prioritize call argument pattern
struct Foo {
    init(_ arg1: String, arg2: Int) {}
    init(label: Int) {}
  }
  func test(strVal: String) {
    _ = Foo(<HERE>)
  }

In this case, 'strVal' was prioritized because it can use as an argument
for 'init(_:arg2:)'. However, argument labels are almost always
preferable, and if the user actually want 'strVal', they can input a few
characters to get it at the top. So we should always prioritize call
argument patterns.

rdar://77188260
2021-04-29 13:23:15 -07:00
Robert Widmann
847930bfb7 Don't Force the Interface Type While Checking Sendable
Asking for Sendable conformances on this path is going to lead to
a traversal of the stored properties of the type. If there is an
interface type computation ongoing, as is very likely the case, this
traversal can wind up causing a cycle when it forces the interface type
of a member once again.

Request only the non-structural conformances to break the cycle.

rdar://77189542
2021-04-29 13:11:32 -07:00
Holly Borla
d8b5d7d51d [Property Wrapper] For a wrapped parameter that is implementation detail,
make the backing stroage a let-constant.
2021-04-29 12:33:15 -07:00
Karoy Lorentey
7f537b486a Merge pull request #37119 from lorentey/abi-tests-clarifications
[stdlib][test] Update stdlib abi test docs
2021-04-29 12:04:25 -07:00
Arnold Schwaighofer
cf9ed6e4e0 Disable swift function merging for swift async functions
It breaks withCheckedContinuation.

I have not gotten to the bottom of why. But for now disable the pass for
all async functions until we can fix it.

rdar://77166575
2021-04-29 11:45:52 -07:00
Pavel Yaskevich
46bc3b672d Merge pull request #37115 from xedin/disable-only-in-perf
[CSSimplify] Allow overload choices with missing labels to be considered for diagnostics
2021-04-29 10:25:16 -07:00
Erik Eckstein
5a7615444b DeadObjectAllocation: fix a use-after free crash
The optimization tried to optimized a keypath instruction which was already deleted in a previous iteration.

rdar://77180080
2021-04-29 18:59:12 +02:00
Rintaro Ishizaki
ce87bf7537 [Parse] Postfix '#if' expression
Implement postfix ifconfig expression which expands '#if' functionality
to postfix member reference expressions.

rdar://problem/51690082
2021-04-29 09:12:23 -07:00
Alex Hoppen
5d3fb8f26d [SymbolGraph] Fix crasher when retrieving cursor info of method defined in ObjC
In a mixed Objective-C / Swift module, we have a Clang module overlay that’s a Source file, not a serialized AST as is currently assumed. That assumption caused a crash when retrieving the symbol graph as part of a cursor info request to SourceKit, which was invoked on a method defined in the Objective-C part of the module.

To fix the crash, recursively use the same logic that already exists to serialize a module to also serialize the clang overlay module since that function alreayd correctly handles the distinction between source files and serialized ASTs.

Resolves rdar://76951147
2021-04-29 17:54:18 +02:00
Dario Rexin
605a9237b4 Use target-cpu for Linux in lto_autolink test (#36999) 2021-04-29 08:47:45 -07:00
Dario Rexin
8aae5c52fb [Linux] XFAIL typeref_decoding_asan test on linux-aarch64 (#37000)
ASan seems to cause reflection information to not be extractable from binaries on aarch64.

rdar://76975976
2021-04-29 08:47:24 -07:00
Dario Rexin
fe7ade852f [Linux] Add symbol to ignore list in symbol-visibility-linux test (#37001)
This test fails on linux-aarch64 because of the additional weak C++ symbol
2021-04-29 08:47:12 -07:00
Ben Barham
2f29cbe559 [Serialization] Do not absolute path the serialized line directive
Line directive paths are used as-is, do not convert them to their
absolute path during serialization.
2021-04-29 23:07:46 +10:00
Konrad `ktoso` Malawski
38a43a481e [TaskLocals] Enforce @TaskLocal may only be used on static props 2021-04-29 21:44:48 +09:00
Alex Hoppen
370128e6b6 [SymbolGraph] Fix a crash for member in invalid extension
Don’t record a `memberOf` relationship if we couldn’t look up the target, e.g. because the member is declared in an extension whose extended type doesn’t exist.

Resolves rdar://74063899
2021-04-29 14:21:52 +02:00
Konrad `ktoso` Malawski
070f9a773b [TaskLocals] review 2: projected value wrapper 2021-04-29 15:48:23 +09:00
Konrad `ktoso` Malawski
df5ff42d79 [TaskLocals] set task local value in synchronous function 2021-04-29 15:48:23 +09:00
Konrad `ktoso` Malawski
f0781b1f8b [TaskLocals] prettier API thanks to default inits 2021-04-29 15:48:23 +09:00
Konrad `ktoso` Malawski
6f3dac190a [TaskLocals] remove TaskLocalInheritance, we'll introduce when needed 2021-04-29 15:48:22 +09:00
Konrad `ktoso` Malawski
a70cd95667 [TaskLocals] move all tests to new style API 2021-04-29 15:48:22 +09:00
Konrad `ktoso` Malawski
664936cd03 [TaskLocal] crash on illegal withValue 2021-04-29 15:48:22 +09:00
Konrad `ktoso` Malawski
08fddae031 [Lit] add target-fail-simple-swift for tests which want to crash 2021-04-29 15:48:22 +09:00
Konrad `ktoso` Malawski
3d96d05546 [TaskLocals] property wrapper keys 2021-04-29 15:48:09 +09:00
Ben Barham
0fc005dd8e Merge pull request #37105 from bnbarham/serialize-offsets
[Serialization] Store offset of decls in .swiftsourceinfo
2021-04-29 16:37:15 +10:00
Konrad `ktoso` Malawski
22c08874f1 Merge pull request #37108 from ktoso/wip-async_task_async_let_child_cancel-without-sleep
[Concurrency] Harden async_task_async_let_child_cancel so it does not need sleep
2021-04-29 14:09:53 +09:00
Ben Barham
c763ab5d1e [Serialization] Store offset of decls in .swiftsourceinfo
The locations stored in .swiftsourceinfo included the presumed file,
line, and column. When a location is requested it would read these, open
the external file, create a line map, and find the offset corresponding
to that line/column.

The offset is known during serialization though, so output it as well to
avoid having to read the file and generate the line map.

Since the serialized location is returned from `Decl::getLoc()`, it
should not be the presumed location. Instead, also output the line
directives so that the presumed location can be built as per normal
locations.

Finally, move the cache out of `Decl` and into `ASTContext`, since very
few declarations will actually have their locations deserialized. Make
sure to actually write to that cache so it's used - the old cache was
never written to.
2021-04-29 12:33:05 +10:00
Rintaro Ishizaki
a08e3e58a7 [Completion] Look through implicit expr when collecting possible callees
For example:
  class Base {
    init(_: Int) {}
    convenience init(_: Int) { self.init() }
  }
  class Derived: Base {
    convenience init(sub: Int) { self.init(sub) }
  }
  Derived(#^HERE^#

In this case, the call is type checked to 'Base.init(_:)' and 'Derived'
is wrapped with 'MetatypeConversionExpr' with type 'Base.Type'. We need
to look through it to get the 'TypeExpr' with 'Derived.Type'.

rdar://74233797
2021-04-28 18:47:08 -07:00
Robert Widmann
22f3e9620b Remap aarch64_32 to arm64_32 When Searching for Modules
The triple name aarch64_32 does not actually name a valid platform. The
actual platform (and valid triple arch string, confusingly enough) is
arm64_32. Remap between the two to correct for this difference.

rdar://77281393
2021-04-28 17:39:06 -07:00
Karoy Lorentey
40529fbe25 [stdlib][test] Update stdlib abi test docs 2021-04-28 15:39:01 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Mishal Shah
937e1a365c Merge pull request #37114 from apple/revert-36377-NewDriverDefault
Revert "Always build SwiftDriver and use it as default compiler driver"
2021-04-28 14:54:09 -07:00
Karoy Lorentey
b11c6e42ea [stdlib][test] Update stdlib abi test docs 2021-04-28 14:10:06 -07:00
Arnold Schwaighofer
a5440a8abd Disable IDE/print_clang_header(_swift_name).swift on arm64_32
It fails on the non_executable bot.
rdar://77281884
2021-04-28 13:30:36 -07:00
Arnold Schwaighofer
237610e5b6 Disable ClangImporter/nested_protocol_name.swift on arm64_32
It fails on the non_executable bot.
rdar://77281393
2021-04-28 13:21:32 -07:00