Commit Graph

38524 Commits

Author SHA1 Message Date
Pavel Yaskevich
eee923bc42 [IRGen] [AST] NFC: Remove @runtimeMetadata related code and metadata records 2023-08-15 12:17:31 -07:00
Pavel Yaskevich
23d838af32 [SIL/SILGen] [AST] NFC: Remove @runtimeMetadata related code 2023-08-15 12:17:31 -07:00
Pavel Yaskevich
0ab131c452 [Mangling] NFC: Remove mangling logic and Ha postfix used by @runtimeMetadata records 2023-08-15 12:17:31 -07:00
Pavel Yaskevich
b21e8426a0 [AST] NFC: Remove @runtimeMetadata related code 2023-08-15 12:16:40 -07:00
Kavon Farvardin
7b3916e4f1 Merge pull request #67902 from kavon/remove-forget-spelling
remove support for `_forget`, the old spelling of `discard`
2023-08-14 17:39:12 -07:00
Becca Royal-Gordon
ad960a1e2d Temporarily soften @objcImpl errors into warnings
Temporarily cherry-pick Swift 5.9’s behavior of turning @objcImplementation errors into warnings to 5.10 until we fix the last few bugs in these diagnostics.
2023-08-14 16:49:51 -07:00
nate-chandler
b68e5f60eb Merge pull request #67913 from nate-chandler/opaque-values/20230814/partial-apply-loadable
[AddressLowering] Rewrite indirect partial_apply.
2023-08-14 16:20:21 -07:00
Zak Kent
c0a16d06ed [Immediate] Drop back to RuntimeDyld on Linux 2023-08-14 13:28:23 -07:00
Zak Kent
4616e03f61 [Immediate] Only add renamer plugin on macOS 2023-08-14 13:28:23 -07:00
Zak Kent
03b539d06e [TBD] [Immediate] Revert implementation of SymbolSourceMap 2023-08-14 13:28:23 -07:00
Zak Kent
289b812a14 [Immediate] Add frontend option for lazy compilation 2023-08-14 13:28:22 -07:00
Zak Kent
56ebd612b6 [Immediate] Add documentation for new JIT stacks 2023-08-14 13:28:22 -07:00
Zak Kent
5181270a87 [Immediate] Remove unused functions in SwiftJIT 2023-08-14 13:28:22 -07:00
Zak Kent
473a18d2ce [Immediate] Implement EagerSwiftMaterializationUnit 2023-08-14 13:28:22 -07:00
Zak Kent
6abc5c5d39 [Immediate] Re-introduce lazy reexports 2023-08-14 13:28:22 -07:00
Zak Kent
48c36c956d [Immediate] Move SwiftMaterializationUnit to public library 2023-08-14 13:28:22 -07:00
Zak Kent
148cd6acc4 [Immediate] [Sema] Implemented Lazy Type Checking
Implements lazy type checking in Swift Immediate mode,
allowing functions to be type-checked as they are
executed.
2023-08-14 13:28:22 -07:00
Zak Kent
17fedabb5e [Immediate] Implemented SwiftMaterializationUnit
Implemented SwiftMaterializationUnit, supporting
lazy compilation of individual Swift functions.
2023-08-14 13:28:22 -07:00
Saleem Abdulrasool
73ab16886c Merge pull request #67833 from hjyamauchi/lldblog
[lldb] Capture error messages from parseASTSection to log from caller
2023-08-14 13:08:54 -07:00
swift-ci
933fa26c4e Merge pull request #65904 from gwynne/patch-1
Update `-strict-concurrency` help text
2023-08-14 11:12:59 -07:00
Nate Chandler
f5adfa2f56 [SIL] Deoptionalize asFullApplySite.
The FullApplySite itself can already be null, and indeed this function
was producing `llvm::Some(FullApplySite())` when called on ApplySite
instances which weren't actually full.
2023-08-14 10:38:21 -07:00
Nishith Shah
8e2e625543 [Diagnostics] Use imperative msg for protocol conformance & switch-case fixits
This commit changes fixit messages from a question/suggestion to an
imperative message for protocol conformances and switch-case. Addresses
https://github.com/apple/swift/issues/67510.
2023-08-13 22:34:26 -07:00
Ben Barham
ebe3a00ad7 Merge pull request #67885 from bnbarham/improve-macro-diag
[Diagnostics] Reduce missing external macro diagnostic
2023-08-11 17:53:27 -07:00
Allan Shortlidge
91b4757aa7 Merge pull request #67896 from tshortli/revert-67528
AST: Downgrade diagnostic for @backDeployed with opaque result type to warning
2023-08-11 15:50:54 -07:00
Kavon Farvardin
4e7e6f41cb remove support for _forget, the old spelling of discard
resolves rdar://112549258
2023-08-11 15:42:25 -07:00
Tony Allevato
9d53f54f5c Merge pull request #67619 from redsun82/c++20-compatibility
NFC: make headers compatible with C++20
2023-08-11 14:36:08 -04:00
Ben Barham
10a5ead2e0 [Diagnostics] Reduce missing external macro diagnostic
This is a very large diagnostic, where the second half is mostly aimed
at macro authors rather than clients. Cut it down to the base
diagnostic.

Resolves rdar://113646544.
2023-08-11 09:47:04 -07:00
Allan Shortlidge
be2d4d8ffd Revert "Revert "Sema: temporarily downgrade backdeployed_opaque_result_not_supported to a warning""
This reverts commit e3453ca32a.
2023-08-11 09:38:38 -07:00
Andrew Trick
8de369467c Revert "Verify that on-stack closures do not take owned arguments"
This reverts commit 20f99b2822.

The assert triggers in in the i386 build in the function:
// specialized Substring.UnicodeScalarView.replaceSubrange<A>(_:with:)
2023-08-11 08:53:04 -07:00
Mike Ash
07cbed62ce Merge pull request #67868 from mikeash/class-copy-fixup-heap-destroyer
[Runtime] Fix up the heap destroyer in objc_setClassCopyFixupHandler.
2023-08-11 10:27:53 -04:00
Paolo Tranquilli
5b755228c3 Fix Compilation::Result constructor 2023-08-11 12:34:05 +02:00
Hamish Knight
1ef4f801db Merge pull request #67800 from hamishknight/conjunction-order 2023-08-11 10:33:11 +01:00
swift-ci
2667df0799 Merge pull request #67760 from atrick/fix-closure-moveonly-arg
Fix compiler crashes with consuming and borrowing keywords.
2023-08-11 00:32:41 -07:00
Andrew Trick
f46d79149d ClosureLifetimeFixup review feedback 2023-08-10 18:51:48 -07:00
Michael Gottesman
33eedc1574 Merge pull request #67874 from gottesmm/pr-179e2ec3ed29bb0d8c35dc99f710a18571a0a24e
[sil] Convert AddressWalker from using virtual methods to use CRTP and add a transitive -> endpoint user API
2023-08-10 17:18:27 -07:00
Hiroshi Yamauchi
24dfc905f5 [lldb] Capture error messages from parseASTSection to log from the caller.
This helps fix a lldb console output mixup between the lldb logging
and the llvm::dbgs() messages from parseASTSection.
2023-08-10 17:08:25 -07:00
swift-ci
fbfeb4fbfc Merge pull request #67750 from artemcm/SeparateClangScannerCachePath
[Dependency Scanning] Separate module output path from Clang scanner's module cache
2023-08-10 16:41:15 -07:00
Egor Zhdan
8acfbd828e Merge pull request #67866 from apple/egorzhdan/cxx-mutable-rac-iter
[cxx-interop] Add `UnsafeCxxMutableRandomAccessIterator` protocol
2023-08-10 23:17:24 +01:00
Michael Gottesman
273c357599 Add the ability to customize AddressWalker to visit a transitive use as an end point use. 2023-08-10 12:58:51 -07:00
Michael Gottesman
29350907fc Convert TransitiveAddressWalker to use CRTP instead of virtual functions. 2023-08-10 12:58:50 -07:00
Michael Gottesman
308a6fed58 Move AddressWalker::walk into the header and eliminate AddressWalker.cpp. 2023-08-10 12:58:50 -07:00
Michael Gottesman
62fb241a8d Remove dead code. 2023-08-10 12:58:50 -07:00
Mike Ash
dbd2f82739 [Runtime] Fix up the heap destroyer in objc_setClassCopyFixupHandler.
We fix up the VWT pointer, but not the heap destroyer. This doesn't matter for classes which use ObjC refcounting, which is the common case for dynamic subclasses, because that doesn't use the heap destroyer pointer. But it does matter for classes that use native Swift refcounting, such as classes that don't inherit from NSObject, or actors.

rdar://113657917
2023-08-10 15:19:18 -04:00
Egor Zhdan
3723ff1401 [cxx-interop] Add UnsafeCxxMutableRandomAccessIterator protocol
This will be used to provide a safe overload of `std::vector::erase` in Swift.

`std::vector::erase` is not currently imported into Swift because it returns a C++ iterator.

rdar://113704853
2023-08-10 19:58:51 +01:00
Erik Eckstein
7e33e554ef SIL: a few changes regarding access to a GlobalVariable's static initializer instructions
* add `GlobalVariable.staticInitializerInstructions` to access all initializer instructions of a global
* implement `GlobalVariable.staticInitValue` with `GlobalVariable.staticInitializerInstructions`
* this requires that `InstructionList.reversed()` works without accessing the parent block of the iterator instruction
* allow `Context.erase(instruction:)` to delete instructions from a global's initializer list, which means to handle the case where a deleted instruction has no parent function.
2023-08-10 20:49:20 +02:00
Erik Eckstein
89d3326ff4 Swift Optimizer: add a simplification for pointer_to_address
For a redundant pair of pointer-address conversions, e.g.

   %2 = address_to_pointer %1
   %3 = pointer_to_address %2 [strict]

replace all uses of %3 with %1.
2023-08-10 20:49:20 +02:00
eeckstein
7ca5998bbf Merge pull request #67860 from eeckstein/fix-mandatory-optmization-inlining
MandatoryPerformanceOptimizations: fix some problems with inilning
2023-08-10 20:47:27 +02:00
Andrew Trick
20f99b2822 Verify that on-stack closures do not take owned arguments 2023-08-10 11:17:53 -07:00
Andrew Trick
83ce3a1777 Rename getArgumentOperandConvention to getCaptureConvention
The name was misleading and problematic. There is already a
getArgumentConvention which is completely different.
2023-08-10 11:17:53 -07:00
Andrew Trick
9c24933bd4 Fix compiler crashes with consuming and borrowing keywords.
Without this fix, the new 'consuming' and 'borrowing' keywords cannot
be used with trivial types. Which means, for example, they can't be
used in macro expansions that work on various types.

Fixes patterns like:

public func test1(i: consuming Int) -> Int {
  takeClosure { [i = copy i] in i }
}

public func test2(i: borrowing Int) -> Int {
  takeClosure { [i = copy i] in i }
}

public func test3(i: consuming Int) -> Int {
  takeClosure { i }
}

// Sadly, test4 is still incorrectly diagnosed.
public func test4(i: borrowing Int) -> Int {
  takeClosure { i }
}

Fixes rdar://112795074 (Crash compiling function that has a macro annotation and uses `consuming`)
2023-08-10 11:17:45 -07:00