Commit Graph

12816 Commits

Author SHA1 Message Date
Karl Wagner
ab4f80ed95 [SE-0404] Allow protocols to be nested in non-generic contexts 2023-10-06 21:04:03 +02:00
Kuba Mracek
7da86b1148 [embedded] Serialize+deserialize vtables, fix using non-generic classes from other modules in embedded Swift 2023-10-06 10:25:22 -07:00
swift-ci
f07b1aefb2 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-06 09:16:41 -07:00
Artem Chikin
bde05b3eeb Merge pull request #69000 from artemcm/FineGrainedAutolinkControls
Fine-grained autolinking control
2023-10-06 09:13:37 -07:00
Arnold Schwaighofer
894095a5f2 Add a flag to enable/disable usage of objective c protocol symbolic references 2023-10-06 08:43:00 -07:00
Kuba Mracek
f808882743 [embedded] Fix IR verification crash when using arrays of zero-sized structs 2023-10-05 21:37:48 -07:00
swift-ci
4a749b3e3d Merge remote-tracking branch 'origin/main' into rebranch 2023-10-05 16:59:34 -07:00
Artem Chikin
57e4f244d1 Fine-grained autolinking control
This change adds the following options to allow for greater control over the compiler's autolinking directive use:
- '-disable-autolink-library': equivalent to an existing '-disable-autolink-framework', this option takes a library name as input and ensures the compiler does not produce an autolink directive '-l<library-name>'.
- '-disable-autolink-frameworks': a boolean disable flag which turns off insertion of autolinking directives for all imported frameworks (of the type '-framework <framework-name>')
- '-disable-all-autolinking': a boolean disable flag which turns off insertion of *any* autolinking directives.

Resolves rdar://100859983
2023-10-05 15:12:48 -07:00
Arnold Schwaighofer
b0424759d7 Add support for objective c protocol symbolic references
Using symbolic references instead of a text based mangling avoids the
expensive type descriptor scan when objective c protocols are requested.

rdar://111536582
2023-10-05 13:11:32 -07:00
Allan Shortlidge
e91580bf0e TBDGen: Teach APIGenRecorder to emit API descriptors during -emit-module.
Make the changes to APIGenRecorder that are necessary to make it capable of
emitting API descriptors during -emit-module jobs. The output in this mode
differs from the output when run on an existing module in a couple of important
ways:

- The value for the `file` key in the descriptor JSON is now the path to the
  source file that defines the declaration responsible for the symbol. In
  `swift-api-extract` mode, the value for this key is the path to the module or
  swiftinterface which is unavailable during an -emit-module job since the module
  is usually not being emitted to its final installed location.
- Some additional symbols may be included in the API descriptor JSON because
  more of the AST is available when emitting the module.

Resolves rdar://110916764
2023-10-05 11:40:53 -07:00
swift-ci
1a6726b90e Merge remote-tracking branch 'origin/main' into rebranch 2023-10-05 11:13:06 -07:00
Allan Shortlidge
0b07c343b6 Merge pull request #68978 from tshortli/improve-api-extract-accuracy
TBDGen: Improve the accuracy of swift-api-extract output
2023-10-05 10:49:21 -07:00
swift-ci
447482505a Merge remote-tracking branch 'origin/main' into rebranch 2023-10-05 08:05:25 -07:00
Egor Zhdan
0b2048d096 Merge pull request #68578 from apple/egorzhdan/cxx-convertible-to-bool
[cxx-interop] Add conversion to Bool for types that define `operator bool()`
2023-10-05 15:52:03 +01:00
Allan Shortlidge
80b1f4c1c2 TBDGen: Improve correctness of API symbol visibility and availability.
By plumbing the currently visited Decl through to APIRecorder we can improve
the correctness of API symbol visibility and availability in swift-api-extract
output.
2023-10-04 22:06:34 -07:00
Allan Shortlidge
6f1f0b0e17 TBDGen: Use isSPI() wrapper more consistently.
This ensures that different kinds of declarations with the `@_spi_available`
attribute are handled consistently.
2023-10-04 21:46:23 -07:00
Allan Shortlidge
0bc3fd3635 TBDGen: Introduce SymbolSource::getDecl() and adopt it.
By adopting this new utility, swift-api-extract more reliably gets the
ValueDecl associated with a symbol and therefore reports more accurate
availability info.
2023-10-04 21:46:23 -07:00
swift-ci
042e9df19d Merge remote-tracking branch 'origin/main' into rebranch 2023-10-04 18:22:41 -07:00
Richard Howell
1bc715a8a1 Fix ASAN use-after-scope in module-file-home-is-cwd.swift 2023-10-04 12:11:48 -07:00
Augusto Noronha
ef45991a2a Keep certain function that are potentially used in the debugger
Currently, when compiling with no optimizations on, we still delete
functions that are sometimes used in the debugger. For example, users
might want to call functions which are unused, or compiler generated
setters/getters.

rdar://101046198
2023-10-04 10:16:31 -07:00
swift-ci
049f867392 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-03 13:58:47 -07:00
Adrian Prantl
df48b60c30 Merge pull request #68865 from rmaz/breadcrumbcwd
Set clang module directory correctly with fmodule-file-home-is-cwd
2023-10-03 13:42:51 -07:00
swift-ci
75ce2f5734 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-03 07:13:54 -07:00
Kuba (Brecka) Mracek
0d2f98a368 Merge pull request #68912 from kubamracek/embedded-closures-heap
[embedded] Support closures with captures and promoting locals to refcounted heap objects
2023-10-03 07:00:46 -07:00
swift-ci
8b0b25f404 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 13:33:12 -07:00
Kuba (Brecka) Mracek
3f35f54f98 Merge pull request #68876 from kubamracek/embedded-throw-traps-stdlib
[embedded] In -throws-as-traps mode, avoid swift_willThrow calls from the stdlib
2023-10-02 13:14:47 -07:00
Kuba Mracek
c6d0e4f76f [embedded] Support closures with captures and promoting locals to refcounted heap objects 2023-10-02 09:45:45 -07:00
swift-ci
00db9cadd6 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 08:55:02 -07:00
Kuba Mracek
2564a25a45 [embedded] In -throws-as-traps mode, avoid swift_willThrow calls from the stdlib 2023-09-29 13:53:30 -07:00
Arnold Schwaighofer
6b74f511d0 Preliminary IRGen support for typed throws
Typed errors are returned indirectly in this version.
No support for non-loadable typed errors
2023-09-29 08:54:49 -07:00
Richard Howell
76dd1f9069 Set clang module directory correctly with fmodule-file-home-is-cwd
When building and importing modules built with
`-fmodule-file-home-is-cwd` we should be setting the debug info
directory to the current working directory. This matches the
behavior in clang: https://reviews.llvm.org/D134911
2023-09-29 08:32:36 -07:00
swift-ci
ddbe38ec7b Merge remote-tracking branch 'origin/main' into rebranch 2023-09-28 09:38:05 -07:00
Yuta Saito
8cfcc245b5 Merge pull request #68524 from kateinoigakukun/katei/expose-wasm-sym
[wasm] Add `@_expose(wasm)` attribute for top-level functions
2023-09-28 09:17:48 -07:00
swift-ci
2e6b1cd2f7 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-28 07:13:53 -07:00
Kuba Mracek
d78482270d [embedded] Move loweredFunctionHasGenericArguments to .isGeneric() on SILFunction 2023-09-27 10:00:39 -07:00
Kuba Mracek
325bc94cd6 [embedded] abort(0) -> llvm_unreachable 2023-09-27 09:19:42 -07:00
Kuba Mracek
b049319487 [embedded] Remove unspecialized functions before running IRGen 2023-09-26 22:25:37 -07:00
Evan Wilde
700aa8aa70 Merge remote-tracking branch 'upstream/main' into rebranch
Merge conflict while removing `nocapture` from
`s21move_function_dbginfo20addressOnlyValueTestyyxAA1PRzlF`. Resolution
was to remove nocapture from the expected output in both cases:
```
// CHECK-LABEL: define swiftcc void @"$s21move_function_dbginfo20addressOnlyValueTestyyxAA1PRzlF"(ptr noalias[-nocapture-] %0, ptr %T, ptr %T.P)
```

Conflict cause: 4858cb6225
This is the same as the original change to this file. The conflict seems
to be due to the next line changing, when moving from llvm.dbg.addr to
llvm.dbg.value.

Conflicts:
  test/DebugInfo/move_function_dbginfo.swift
2023-09-26 13:36:57 -07:00
Kuba (Brecka) Mracek
c92f6af7a8 Merge pull request #68748 from kubamracek/embedded-arm64e-deinit
[embedded] Fix incorrectly ptrauth signed destructor in vtables
2023-09-26 09:50:12 -07:00
Alex Lorenz
6ecea1ac09 Merge pull request #68481 from hyp/eng/no-nocapture
[IRGen][interop] do not add 'nocapture' to not bitwise takable types
2023-09-26 07:52:05 -07:00
Yuta Saito
6d378a3ec3 [wasm] add @_expose(wasm) attribute support
This attribute instructs the compiler that this function declaration
should be "export"ed from this .wasm module. It's equivalent of Clang's
`__attribute__((export_name("name")))`
2023-09-26 14:13:33 +00:00
swift-ci
daeae9870d Merge remote-tracking branch 'origin/main' into rebranch 2023-09-25 21:51:57 -07:00
Kuba (Brecka) Mracek
67b68d1d87 Merge pull request #68739 from kubamracek/embedded-arm64e
[embedded] Start building arm64e embedded stdlib
2023-09-25 19:51:02 -07:00
Alex Lorenz
4858cb6225 [IRGen][interop] do not add 'nocapture' to not bitwise takable types
The use of 'nocapture' for parameters and return values is incorrect for C++ types, as they can actually capture a pointer into its own value (e.g. std::string in libstdc++)

rdar://115062687
2023-09-25 17:43:34 -07:00
Ben Barham
0163a34e38 Merge remote-tracking branch 'origin/main' into 20230925-merge-rebranch
Conflicts:
  - `lib/IRGen/IRGen.cpp` in the `case
    IRGenOutputKind::LLVMAssemblyAfterOptimization` branch caused by an
    additional parameter on rebranch
2023-09-25 13:23:47 -07:00
Kuba Mracek
a454d9a8a9 [embedded] Fix incorrectly ptrauth signed destructor in vtables 2023-09-25 12:18:36 -07:00
eeckstein
ebc0be2b02 Merge pull request #68699 from eeckstein/fix-disable-llvm-optzns
IRGen: fix -disable-llvm-optzns
2023-09-25 21:18:13 +02:00
zoecarver
bed427b29d [embedded][ptrauth] Guard extra ptrauth verification on objc interop being enabled.
This verification runs on ObjC briging types which are not present in embedded stdlib or when objc interop is not enabled.
2023-09-25 10:17:31 -07:00
swift-ci
c211e09c5a Merge remote-tracking branch 'origin/main' into rebranch 2023-09-25 01:17:00 -07:00
Erik Eckstein
b5de7e4e49 IRGen: fix -disable-llvm-optzns
If LLVM optimizations are to be disabled, we cannot just not run all LLVM passes, because there are some mandatory LLVM passes, like coro splitting.
Instead, just run the -O0 LLVM pipeline if -disable-llvm-optzns is used.

Fixes compiler crashes if -disable-llvm-optzns is used.

Note: if one wants to see the output of IRGen, -emit-irgen can be used.
2023-09-25 09:20:04 +02:00