Skip to content

[IRGen] Reintroduce typed throws ABI #76630

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
ffd9f20
[IRGen] Re-introduce typed throws ABI
drexin Sep 28, 2024
5785d45
[TypedThrows] Don't return undef : void.
nate-chandler Sep 12, 2024
cdcdeb9
[IRGen] Fix return values for typed throws with empty error
drexin Sep 17, 2024
60afdd3
[IRGen] Fix return value mapping in typed throwing async protocol thunks
drexin Sep 19, 2024
e62cab2
[IRGen] Add synchronous typed throws implementation to typed_throws_a…
drexin Sep 20, 2024
26521cd
[IRGen] Properly handle empty results in direct error return in emitA…
drexin Sep 20, 2024
a60794a
[Test] Fix expected return value in typed_throws_thunks.swift
drexin Sep 20, 2024
0b5f193
[Test] Add test calling sync impls to IRGen/typed_throws_abi.swift
drexin Sep 20, 2024
03c3d98
[IRGen] Assign error flag after calling direct error returning async …
drexin Sep 20, 2024
5b46045
[Test] Add async throwing non-empty error tests to IRGen/typed_throws…
drexin Sep 21, 2024
06a9e9f
[Test] Add executable tests for typed throws ABI
drexin Sep 21, 2024
cff0585
[Test] Add test for sync direct error return with non-maching error/r…
drexin Sep 23, 2024
874b013
[Test] Add test for async direct error return with non-maching error/…
drexin Sep 23, 2024
d6689d8
[Test] Add executable tests for non-matching error/result values in d…
drexin Sep 23, 2024
57cab6d
[Test] Fix IRGen/typed_throws_abi.swift on Windows
drexin Sep 28, 2024
8beed30
[Test] Add more test coverage for typed throws ABI
drexin Oct 17, 2024
f6e7c16
[IRGen] Map types into context in typed throws code gen
drexin Nov 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lib/IRGen/CallEmission.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "Address.h"
#include "Callee.h"
#include "Explosion.h"
#include "Temporary.h"

namespace llvm {
Expand Down Expand Up @@ -90,6 +91,7 @@ class CallEmission {

unsigned IndirectTypedErrorArgIdx = 0;

std::optional<Explosion> typedErrorExplosion;

virtual void setFromCallee();
void emitToUnmappedMemory(Address addr);
Expand All @@ -110,6 +112,11 @@ class CallEmission {
TemporarySet &temporaries,
bool isOutlined);

bool mayReturnTypedErrorDirectly() const;
void emitToUnmappedExplosionWithDirectTypedError(SILType resultType,
llvm::Value *result,
Explosion &out);

CallEmission(IRGenFunction &IGF, llvm::Value *selfValue, Callee &&callee)
: IGF(IGF), selfValue(selfValue), CurCallee(std::move(callee)) {}

Expand All @@ -129,6 +136,10 @@ class CallEmission {
UseProfilingThunk = true;
}

std::optional<Explosion> &getTypedErrorExplosion() {
return typedErrorExplosion;
}

virtual void begin();
virtual void end();
virtual SILType getParameterType(unsigned index) = 0;
Expand Down
Loading