Skip to content

Commit 84f5eb5

Browse files
committed
[NFC] Synthesis for @NoEscape closure builtins.
1 parent 59f6cbc commit 84f5eb5

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/swift/AST/ASTSynthesis.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,13 @@ enum FunctionRepresentationSynthesizer {
316316
};
317317
template <class S> struct ThrowsSynthesizer { S sub; };
318318
template <class S> struct AsyncSynthesizer { S sub; };
319+
template <class S> struct NoescapeSynthesizer { S sub; };
319320
template <class S>
320321
constexpr ThrowsSynthesizer<S> _throws(S sub) { return {sub}; }
321322
template <class S>
322323
constexpr AsyncSynthesizer<S> _async(S sub) { return {sub}; }
324+
template <class S>
325+
constexpr NoescapeSynthesizer<S> _noescape(S sub) { return {sub}; }
323326

324327
inline ASTExtInfo synthesizeExtInfo(SynthesisContext &SC,
325328
FunctionRepresentationSynthesizer kind) {
@@ -340,6 +343,11 @@ ASTExtInfo synthesizeExtInfo(SynthesisContext &SC,
340343
const AsyncSynthesizer<S> &s) {
341344
return synthesizeExtInfo(SC, s.sub).withAsync();
342345
}
346+
template <class S>
347+
ASTExtInfo synthesizeExtInfo(SynthesisContext &SC,
348+
const NoescapeSynthesizer<S> &s) {
349+
return synthesizeExtInfo(SC, s.sub).withNoEscape();
350+
}
343351

344352
/// Synthesize a function type.
345353
template <class ExtInfoS, class ResultS, class ParamsS>

0 commit comments

Comments
 (0)