Commit Graph

13074 Commits

Author SHA1 Message Date
Anthony Latsis
d15a148d09 IRGen: Conservatively adjust uses of llvm::PassBuilder::registerOptimizerLastEPCallback (lambda parameter added)
Per 390300d9f41df6ad71f0f4196ef4885d4bd5dc48 (llvm-project).
2025-04-24 01:52:48 +01:00
Anthony Latsis
e124bca3e1 IRGen: Adjust uses of llvm::DIBuilder::insertDbgValueIntrinsic (parameter type changed)
Per 1083ec647f16314bcc9af8c4d6b11f50d288bca6 (llvm-project).
2025-04-24 01:52:48 +01:00
Anthony Latsis
4e972c0e75 IRGen: Adjust uses of llvm::BasicBlock::getFirstNonPHIOrDbg (return type changed)
Per 81d18ad86419fc612c7071e888d11aa923eaeb8a (llvm-project).
2025-04-24 01:52:48 +01:00
Anthony Latsis
f0236c262f DriverTool, IRGen: Adjust uses of llvm::Module::setTargetTriple (parameter type changed)
Per 979c275097a642e9b96c6b0a12f013c831af3a6e (llvm-project).
2025-04-24 01:52:48 +01:00
Anthony Latsis
66a6df9a44 IRGen: Conservatively adjust use of llvm::DIBuilder::createObjectPointerType (parameter added)
Per a5fb2bbb2ad8488482843e2298fbe6f6a1d45bbd (llvm-project).
2025-04-24 01:52:48 +01:00
Anthony Latsis
5996a95c21 IRGen: Adjust uses of clang::FieldDecl::getBitWidthValue (parameter removed)
Per cfe26358e3051755961fb1f3b46328dc2c326895 (llvm-project).
2025-04-24 01:52:48 +01:00
Anthony Latsis
124608b481 IRGen: Conservatively handle new HLSL clang::ParameterABI enum cases
Per 89fb8490a99e612f7a574e8678b21a90f689f5b4 (llvm-project).
2025-04-24 01:52:47 +01:00
Anthony Latsis
3eda91e511 ClangImporter, IRGen: Conservatively handle new clang::HLSLAttributedResourceType
Per e00e9a3f8294c9b96cb0328bf136fab72aeec749 (llvm-project).
2025-04-24 01:52:47 +01:00
Anthony Latsis
547a8910c2 AST, ClangImporter, IRGen: Conservatively handle new HLSL clang::BuiltinType::Kind enum case
Per 52956b0f705499ae4a268d3629b402ecdc2cbbab (llvm-project).
2025-04-24 01:52:46 +01:00
Anthony Latsis
3ef9816213 Adjust includes of moved LLVM header
Per 2ae968a0d9fb61606b020e898d884c82dd0ed8b5 (llvm-project).
2025-04-24 01:52:45 +01:00
Anthony Latsis
f93aba0770 IRGen, LLVMPasses: Switch from obsoleted nocapture to captures(none)
Per 29441e4f5fa5f5c7709f7cf180815ba97f611297 (llvm-project).
2025-04-24 01:52:45 +01:00
Anthony Latsis
0d2d6cb8a0 IRGen, LLVMPasses: Switch from obsoleted APIs to llvm::getPointerAuthStableSipHash
Per d68f8b96b1ff39cfcfcad94d5b16d28adaf6b5d0 (llvm-project).
2025-04-24 01:52:45 +01:00
Dario Rexin
4b7edce861 Merge pull request #80746 from drexin/wip-149007227
[IRGen] Set generic context before getting call emission in visitFull…
2025-04-23 15:37:17 -07:00
Arnold Schwaighofer
3f8c743aed IRGen: Centralize logic that decides whether the platform suppports typed malloc
NFC intended
2025-04-23 10:43:06 -07:00
Arnold Schwaighofer
521fb07523 LoadableByAddress: Fix shouldTransformYields to use substituted types
rdar://149281263
issues/80818
2025-04-21 13:46:41 -07:00
Konrad `ktoso` Malawski
d7887132a5 Merge pull request #80588 from ktoso/wip-regression-test-for-b-da-bad-access
[Distributed] Reproducer for generics and library evolution mode
2025-04-21 20:03:27 +09:00
eeckstein
ad82261cbd Merge pull request #80884 from eeckstein/embedded-error-message2
embedded: support default methods in existentials and improve embedded error reporting
2025-04-18 22:12:18 +02:00
Erik Eckstein
8e874cd2b2 SIL: add better support for specialized witness tables.
Store specialize witness tables in a separate lookup table in the module. This allows that for a normal conformance there can exist the original _and_ a specialized witness table.
Also, add a boolean property `isSpecialized` to `WitnessTable` which indicates whether the witness table is specialized or not.
2025-04-18 06:58:34 +02:00
Konrad 'ktoso' Malawski
957a95be63 [Distributed] Distributed actor usage through protocol with lib-evo must work
This corrects how we were dealing with dispatch thunks -- mostly be
removing a lot of special casing we did but doesn't seem necessary and
instead we correct and emit all the necessary information int TBD.

This builds on  https://github.com/swiftlang/swift/pull/74935 by further refining how we fixed that issue, and adds more regression tests. It also removes a load of special casing of distributed thunks in library evolution mode, which is great.

Resolves and adds regression test for for rdar://145292018

This is also a more proper fix to the previously resolved but in a not-great-way which caused other issues:
- resolves rdar://128284016
- resolves rdar://128310903
2025-04-18 11:21:01 +09:00
Arnold Schwaighofer
370b7e8219 LargeTypesReg2Mem: Add unchecked_bitwise_cast to the projections we need to propagate largeness from destination to source operand
rdar://148545382
2025-04-17 09:18:31 -07:00
eeckstein
6e6328dc2a Merge pull request #80882 from eeckstein/fix-warning
IRGen: fix a compiler warning
2025-04-17 17:29:51 +02:00
Arnold Schwaighofer
5762912af5 Merge pull request #80639 from aschwaighofer/store_once_async_context_addr
IRGen: Don't stored the current async frame to llvm.swift.async.context.addr twice
2025-04-17 08:23:22 -07:00
Erik Eckstein
db65f2f4e2 IRGen: fix a compiler warning
Move a static inline function into the cpp file.
Fixes
```
warning: unused function 'getCoroFrameAllocStubFn'
```

NFC
2025-04-17 13:01:17 +02:00
Dario Rexin
e9062b257f [IRGen] Set generic context before getting call emission in visitFullApplySite
rdar://149007227

Without the generic context, the result type can't be mapped into the current context, causing the compiler to crash.
2025-04-10 15:13:00 -07:00
Andrew Trick
21480b8021 Merge pull request #80708 from atrick/irgen-addressable
Fix IRGen for @_addressable params which may be "captured".
2025-04-10 14:22:01 -07:00
Andrew Trick
2d9df8ff78 Fix IRGen for @_addressable params which may be "captured".
Simply omit the 'nocapture' attribute on the parameter.

Fixes rdar://148039510 ([nonescapable] IRGen: lower addressable
params to LLVM: captures(ret: address, provenance))
2025-04-10 09:40:19 -07:00
Adrian Prantl
19145734ee Merge pull request #80691 from adrian-prantl/147797657
[LLDB] Fix conditional to also support AccessLevel::Open
2025-04-10 08:52:50 -07:00
Slava Pestov
5d94a32d50 Merge pull request #80675 from slavapestov/fix-rdar148698142
IRGen: Fix silly mistake in MetadataPath::followComponent()
2025-04-10 07:55:31 -04:00
John Hui
dd2f465025 [cxx-interop] Do not get private discriminator for private Clang types (#80485)
When generating debug symbols for private Clang types (which we started
importing recently), the compiler crashes due to an assertion failure
from ClangModuleUnit::getDiscriminatorForPrivateDecl(), which is called
by getFilePrivateScope().

This patch fixes the issue crash by not calling getFilePrivateScope()
for Clang types. A discriminator is usually needed to disambiguate
private Swift types declared in different files, but Clang types follow
different scoping conventions that make this discriminator unnecessary.

rdar://148481025
2025-04-09 22:32:12 -07:00
Adrian Prantl
c4f073d39a [IRGenSIL] Factor out shouldUseDispatchThunk() (NFC) 2025-04-09 12:32:15 -07:00
Adrian Prantl
5a36f3baac [IRGen] Improve legibility of conditional (NFC) 2025-04-09 12:32:06 -07:00
Adrian Prantl
f4a0f4b339 [LLDB] Fix conditional to also support AccessLevel::Open
This fixes crashes in LLDB expression evaluation when calling virtual
Open functions.

rdar://147797657
2025-04-09 11:28:56 -07:00
Slava Pestov
6fd0c24f76 IRGen: Convert null pointer derefs into unconditional asserts 2025-04-09 11:34:28 -04:00
Slava Pestov
5a39c81d8a IRGen: Fix silly mistake in MetadataPath::followComponent()
This fixes a regression from a00157ec43.

My change made it so that sourceKey.Kind was checked after being
overwritten with an abstract conformance, so we would never take
the if statement. Incredibly, it almost worked.

Fixes rdar://problem/148698142.
2025-04-09 11:34:15 -04:00
Arnold Schwaighofer
0bb30d6ed3 Fix type continued 2025-04-09 07:26:41 -07:00
Arnold Schwaighofer
7bfa9387f8 Fix typo => popAsyncContext 2025-04-09 07:24:06 -07:00
Rashmi Mudduluru
5e2f20b2d8 [SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function (#79889)
* [SUA][IRGen] Add stub for swift_coroFrameAlloc that weakly links against the runtime function

This commit modifies IRGen to emit a stub function `__swift_coroFrameAllocStub` instead of the
newly introduced swift-rt function `swift_coroFrameAlloc`. The stub checks whether the runtime has the symbol
`swift_coroFrameAlloc` and dispatches to it if it exists, uses `malloc` otherwise. This ensures the
ability to back deploy the feature to older OS targets.

rdar://145239850
2025-04-08 09:58:24 -07:00
Arnold Schwaighofer
50ebb3f579 IRGen: Don't stored the current async frame to llvm.swift.async.context.addr twice
rdar://148826951
2025-04-08 08:12:07 -07:00
Slava Pestov
b94a0448f2 SIL: Remove SILWitnessTable::ConditionalConformance 2025-04-07 21:36:05 -04:00
nate-chandler
2c335eef5a Merge pull request #80556 from nate-chandler/bug/20250404/2
[IRGen] Fix type of deleted coro error func.
2025-04-07 14:44:03 -07:00
Konrad `ktoso` Malawski
97be02d5b2 [Distributed] Dont emit TBD also for distributed thunks (#80526)
* [Distributed] Accessor must be available cross module in resilient mode

This is an important fix for libraries using @Resolvable in resilient
libraries. Without the fix we're missing an accessor and this will fail
some remote calls which make use of remote calls on resolvable
protocols. This would manifest as missing accessor error thrown by the
executeDistributedTarget function.

resolves rdar://148224780

* Disable test on windows since %env not supported

* [Distributed] Dont emit TBD also for distributed thunks

This resolves pedantic "all" TBD validation issues, i.e. we dont emit
unexpected records anymore - we would before as we only checked for
is_distributed but we also want to skip those for is_distributed_thunk

resolves rdar://128284016
2025-04-07 06:55:19 -07:00
Konrad `ktoso` Malawski
f21d029b82 [Distributed] Accessor must be available cross module in resilient mode (#80523)
* [Distributed] Accessor must be available cross module in resilient mode

This is an important fix for libraries using @Resolvable in resilient
libraries. Without the fix we're missing an accessor and this will fail
some remote calls which make use of remote calls on resolvable
protocols. This would manifest as missing accessor error thrown by the
executeDistributedTarget function.

resolves rdar://148224780

* Disable test on windows since %env not supported
2025-04-07 02:09:23 -07:00
Nate Chandler
ce61e2ea11 [IRGen] Fix type of deleted coro error func.
It was previously erroneously an async function pointer.  Also fix the
name.
2025-04-04 18:18:11 -07:00
nate-chandler
0063af561f Merge pull request #80520 from nate-chandler/general-coro/20250403/1
[CoroutineAccessors] Use async bit in descriptors.
2025-04-04 15:47:19 -07:00
Slava Pestov
9148ae32bd Merge pull request #80482 from slavapestov/abstract-conformance-cleanup
AST: Simplify ProtocolConformanceRef operations a little bit
2025-04-04 10:37:49 -04:00
nate-chandler
0e2ca9a07d Merge pull request #80483 from nate-chandler/general-coro/20250327/2
[CoroutineAccessors] Open-code a task_dealloc_thru
2025-04-03 21:21:06 -07:00
Nate Chandler
66ca0d8d4b [CoroutineAccessors] Use async bit in descriptors.
To facilitate back deployment, make use of the fact that the async bit
has up to now never been set for read and modify accessors and claim
that set bit to indicate that it is a callee-allocated coroutine.  This
has the virtue of being completely back deployable because like async
function pointers coro function pointers must be auth'd and signed as
data.
2025-04-03 19:49:44 -07:00
Augusto Noronha
cac0abbfde Merge pull request #80380 from augusto2112/fix-opaque
[DebugInfo] Use underlying type of global variables with opaque type
2025-04-03 15:39:11 -07:00
Slava Pestov
e475b08011 AST: Remove AssociatedType 2025-04-03 17:35:35 -04:00
Slava Pestov
f455898ae8 IRGen: Remove calls to ProtocolConformanceRef::getAssociatedType() 2025-04-03 17:35:34 -04:00