Skip to content

Commit d9bc2cb

Browse files
committed
[IRGen] Return typed errors directly in synchronous functions when possible
rdar://129359355 This PR implements the basic support for returning typed errors directly and applies it to synchronous functions.
1 parent db7580f commit d9bc2cb

File tree

11 files changed

+515
-91
lines changed

11 files changed

+515
-91
lines changed

lib/IRGen/CallEmission.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#include "Address.h"
2121
#include "Callee.h"
22+
#include "Explosion.h"
2223
#include "Temporary.h"
2324

2425
namespace llvm {
@@ -88,6 +89,7 @@ class CallEmission {
8889

8990
unsigned IndirectTypedErrorArgIdx = 0;
9091

92+
std::optional<Explosion> typedErrorExplosion;
9193

9294
virtual void setFromCallee();
9395
void emitToUnmappedMemory(Address addr);
@@ -123,6 +125,10 @@ class CallEmission {
123125
return CurCallee.getSubstitutions();
124126
}
125127

128+
std::optional<Explosion> &getTypedErrorExplosion() {
129+
return typedErrorExplosion;
130+
}
131+
126132
virtual void begin();
127133
virtual void end();
128134
virtual SILType getParameterType(unsigned index) = 0;

0 commit comments

Comments
 (0)