Skip to content

Commit 120bf0c

Browse files
Merge pull request #2321 from TNorthover/swiftasync-stable
Cherry-picking swiftasync support to the new stable branch.
2 parents 1ef702d + 92a5c09 commit 120bf0c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+585
-27
lines changed

clang/include/clang/AST/Attr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,8 @@ class ParameterABIAttr : public InheritableParamAttr {
209209
switch (getKind()) {
210210
case attr::SwiftContext:
211211
return ParameterABI::SwiftContext;
212+
case attr::SwiftAsyncContext:
213+
return ParameterABI::SwiftAsyncContext;
212214
case attr::SwiftErrorResult:
213215
return ParameterABI::SwiftErrorResult;
214216
case attr::SwiftIndirectResult:

clang/include/clang/Basic/Attr.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2418,6 +2418,11 @@ def SwiftContext : ParameterABIAttr {
24182418
let Documentation = [SwiftContextDocs];
24192419
}
24202420

2421+
def SwiftAsyncContext : ParameterABIAttr {
2422+
let Spellings = [Clang<"swift_async_context">];
2423+
let Documentation = [SwiftAsyncContextDocs];
2424+
}
2425+
24212426
def SwiftErrorResult : ParameterABIAttr {
24222427
let Spellings = [Clang<"swift_error_result">];
24232428
let Documentation = [SwiftErrorResultDocs];

clang/include/clang/Basic/AttrDocs.td

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4551,6 +4551,19 @@ A context parameter must have pointer or reference type.
45514551
}];
45524552
}
45534553

4554+
def SwiftAsyncContextDocs : Documentation {
4555+
let Category = DocCatVariable;
4556+
let Content = [{
4557+
The ``swift_async_context`` attribute marks a parameter as having the
4558+
special asynchronous context-parameter ABI treatment.
4559+
4560+
This treatment generally passes the context value in a special register
4561+
which is normally callee-preserved.
4562+
4563+
A context parameter must have pointer or reference type.
4564+
}];
4565+
}
4566+
45544567
def SwiftErrorResultDocs : Documentation {
45554568
let Category = DocCatVariable;
45564569
let Content = [{

clang/include/clang/Basic/Specifiers.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ namespace clang {
344344
/// This parameter (which must have pointer type) uses the special
345345
/// Swift context-pointer ABI treatment. There can be at
346346
/// most one parameter on a given function that uses this treatment.
347-
SwiftContext
347+
SwiftContext,
348+
349+
/// This parameter (which must have pointer type) uses the special
350+
/// Swift asynchronous context-pointer ABI treatment. There can be at
351+
/// most one parameter on a given function that uses this treatment.
352+
SwiftAsyncContext,
348353
};
349354

350355
/// Assigned inheritance model for a class in the MS C++ ABI. Must match order

clang/lib/AST/ItaniumMangle.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2941,6 +2941,7 @@ CXXNameMangler::mangleExtParameterInfo(FunctionProtoType::ExtParameterInfo PI) {
29412941

29422942
// All of these start with "swift", so they come before "ns_consumed".
29432943
case ParameterABI::SwiftContext:
2944+
case ParameterABI::SwiftAsyncContext:
29442945
case ParameterABI::SwiftErrorResult:
29452946
case ParameterABI::SwiftIndirectResult:
29462947
mangleVendorQualifier(getParameterABISpelling(PI.getABI()));

clang/lib/AST/TypePrinter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,8 @@ StringRef clang::getParameterABISpelling(ParameterABI ABI) {
847847
llvm_unreachable("asking for spelling of ordinary parameter ABI");
848848
case ParameterABI::SwiftContext:
849849
return "swift_context";
850+
case ParameterABI::SwiftAsyncContext:
851+
return "swift_async_context";
850852
case ParameterABI::SwiftErrorResult:
851853
return "swift_error_result";
852854
case ParameterABI::SwiftIndirectResult:

clang/lib/CodeGen/CGCall.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2356,6 +2356,10 @@ void CodeGenModule::ConstructAttributeList(
23562356
case ParameterABI::SwiftContext:
23572357
Attrs.addAttribute(llvm::Attribute::SwiftSelf);
23582358
break;
2359+
2360+
case ParameterABI::SwiftAsyncContext:
2361+
Attrs.addAttribute(llvm::Attribute::SwiftAsync);
2362+
break;
23592363
}
23602364

23612365
if (FI.getExtParameterInfo(ArgNo).isNoEscape())

clang/lib/Sema/SemaDeclAttr.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4958,6 +4958,14 @@ void Sema::AddParameterABIAttr(Decl *D, const AttributeCommonInfo &CI,
49584958
D->addAttr(::new (Context) SwiftContextAttr(Context, CI));
49594959
return;
49604960

4961+
case ParameterABI::SwiftAsyncContext:
4962+
if (!isValidSwiftContextType(type)) {
4963+
Diag(CI.getLoc(), diag::err_swift_abi_parameter_wrong_type)
4964+
<< getParameterABISpelling(abi) << /*pointer to pointer */ 0 << type;
4965+
}
4966+
D->addAttr(::new (Context) SwiftAsyncContextAttr(Context, CI));
4967+
return;
4968+
49614969
case ParameterABI::SwiftErrorResult:
49624970
if (!isValidSwiftErrorResultType(type)) {
49634971
Diag(CI.getLoc(), diag::err_swift_abi_parameter_wrong_type)
@@ -8089,6 +8097,9 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D,
80898097
case ParsedAttr::AT_SwiftContext:
80908098
S.AddParameterABIAttr(D, AL, ParameterABI::SwiftContext);
80918099
break;
8100+
case ParsedAttr::AT_SwiftAsyncContext:
8101+
S.AddParameterABIAttr(D, AL, ParameterABI::SwiftAsyncContext);
8102+
break;
80928103
case ParsedAttr::AT_SwiftErrorResult:
80938104
S.AddParameterABIAttr(D, AL, ParameterABI::SwiftErrorResult);
80948105
break;

clang/lib/Sema/SemaType.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,6 +2783,10 @@ static void checkExtParameterInfos(Sema &S, ArrayRef<QualType> paramTypes,
27832783
checkForSwiftCC(paramIndex);
27842784
continue;
27852785

2786+
case ParameterABI::SwiftAsyncContext:
2787+
// FIXME: might want to require swiftasynccc when it exists
2788+
continue;
2789+
27862790
// swift_error parameters must be preceded by a swift_context parameter.
27872791
case ParameterABI::SwiftErrorResult:
27882792
checkForSwiftCC(paramIndex);

clang/test/CodeGen/arm-swiftcall.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define OUT __attribute__((swift_indirect_result))
77
#define ERROR __attribute__((swift_error_result))
88
#define CONTEXT __attribute__((swift_context))
9+
#define ASYNC_CONTEXT __attribute__((swift_async_context))
910

1011
/*****************************************************************************/
1112
/****************************** PARAMETER ABIS *******************************/
@@ -53,6 +54,9 @@ void test_context_error_1() {
5354
SWIFTCALL void context_error_2(short s, CONTEXT int *self, ERROR float **error) {}
5455
// CHECK-LABEL: define{{.*}} void @context_error_2(i16{{.*}}, i32* swiftself{{.*}}, float** swifterror %0)
5556

57+
SWIFTCALL void async_context_1(ASYNC_CONTEXT void *self) {}
58+
// CHECK-LABEL: define {{.*}} void @async_context_1(i8* swiftasync
59+
5660
/*****************************************************************************/
5761
/********************************** LOWERING *********************************/
5862
/*****************************************************************************/

clang/test/Misc/pragma-attribute-supported-attributes-list.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
// CHECK-NEXT: SetTypestate (SubjectMatchRule_function_is_member)
156156
// CHECK-NEXT: SpeculativeLoadHardening (SubjectMatchRule_function, SubjectMatchRule_objc_method)
157157
// CHECK-NEXT: SwiftAsync (SubjectMatchRule_function, SubjectMatchRule_objc_method)
158+
// CHECK-NEXT: SwiftAsyncContext (SubjectMatchRule_variable_is_parameter)
158159
// CHECK-NEXT: SwiftAsyncName (SubjectMatchRule_objc_method, SubjectMatchRule_function)
159160
// CHECK-NEXT: SwiftBridgedTypedef (SubjectMatchRule_type_alias)
160161
// CHECK-NEXT: SwiftContext (SubjectMatchRule_variable_is_parameter)

clang/test/Sema/attr-swiftcall.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define INDIRECT_RESULT __attribute__((swift_indirect_result))
66
#define ERROR_RESULT __attribute__((swift_error_result))
77
#define CONTEXT __attribute__((swift_context))
8+
#define ASYNC_CONTEXT __attribute__((swift_async_context))
89

910
int notAFunction SWIFTCALL; // expected-warning {{'swiftcall' only applies to function types; type here is 'int'}}
1011
void variadic(int x, ...) SWIFTCALL; // expected-error {{variadic function cannot use swiftcall calling convention}}
@@ -29,3 +30,8 @@ void context_nonswift(CONTEXT void *context); // expected-error {{'swift_context
2930
void context_bad_type(CONTEXT int context) SWIFTCALL; // expected-error {{'swift_context' parameter must have pointer type; type here is 'int'}}
3031
void context_okay(CONTEXT void *context) SWIFTCALL;
3132
void context_okay2(CONTEXT void *context, void *selfType, char **selfWitnessTable) SWIFTCALL;
33+
34+
void async_context_okay_for_now(ASYNC_CONTEXT void *context);
35+
void async_context_bad_type(ASYNC_CONTEXT int context) SWIFTCALL; // expected-error {{'swift_async_context' parameter must have pointer type; type here is 'int'}}
36+
void async_context_okay(ASYNC_CONTEXT void *context) SWIFTCALL;
37+
void async_context_okay2(ASYNC_CONTEXT void *context, void *selfType, char **selfWitnessTable) SWIFTCALL;

llvm/docs/LangRef.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,12 @@ Currently, only the following parameter attributes are defined:
12541254
a valid attribute for return values and can only be applied to one
12551255
parameter.
12561256

1257+
``swiftasync``
1258+
This indicates that the parameter is the asynchronous context parameter and
1259+
triggers the creation of a target-specific extended frame record to store
1260+
this pointer. This is not a valid attribute for return values and can only
1261+
be applied to one parameter.
1262+
12571263
``swifterror``
12581264
This attribute is motivated to model and optimize Swift error handling. It
12591265
can be applied to a parameter with pointer to pointer type or a
@@ -11826,6 +11832,29 @@ Note that calling this intrinsic does not prevent function inlining or
1182611832
other aggressive transformations, so the value returned may not be that
1182711833
of the obvious source-language caller.
1182811834

11835+
'``llvm.swift.async.context.addr``' Intrinsic
11836+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11837+
11838+
Syntax:
11839+
"""""""
11840+
11841+
::
11842+
11843+
declare i8** @llvm.swift.async.context.addr()
11844+
11845+
Overview:
11846+
"""""""""
11847+
11848+
The '``llvm.swift.async.context.addr``' intrinsic returns a pointer to
11849+
the part of the extended frame record containing the asynchronous
11850+
context of a Swift execution.
11851+
11852+
Semantics:
11853+
""""""""""
11854+
11855+
If the function has a ``swiftasync`` parameter, that argument will initially
11856+
be stored at the returned address. If not, it will be initialized to null.
11857+
1182911858
'``llvm.localescape``' and '``llvm.localrecover``' Intrinsics
1183011859
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1183111860

llvm/include/llvm/Bitcode/LLVMBitCodes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,7 @@ enum AttributeKindCodes {
656656
ATTR_KIND_MUSTPROGRESS = 70,
657657
ATTR_KIND_NO_CALLBACK = 71,
658658
ATTR_KIND_HOT = 72,
659+
ATTR_KIND_SWIFT_ASYNC = 73,
659660
};
660661

661662
enum ComdatSelectionKindCodes {

llvm/include/llvm/CodeGen/TargetCallingConv.h

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ namespace ISD {
3939
unsigned IsPreallocated : 1; ///< ByVal without the copy
4040
unsigned IsSplitEnd : 1; ///< Last part of a split
4141
unsigned IsSwiftSelf : 1; ///< Swift self parameter
42+
unsigned IsSwiftAsync : 1; ///< Swift async context parameter
4243
unsigned IsSwiftError : 1; ///< Swift error parameter
4344
unsigned IsCFGuardTarget : 1; ///< Control Flow Guard target
4445
unsigned IsHva : 1; ///< HVA field for
@@ -63,11 +64,12 @@ namespace ISD {
6364

6465
public:
6566
ArgFlagsTy()
66-
: IsZExt(0), IsSExt(0), IsInReg(0), IsSRet(0), IsByVal(0), IsByRef(0),
67-
IsNest(0), IsReturned(0), IsSplit(0), IsInAlloca(0), IsPreallocated(0),
68-
IsSplitEnd(0), IsSwiftSelf(0), IsSwiftError(0), IsCFGuardTarget(0),
69-
IsHva(0), IsHvaStart(0), IsSecArgPass(0), ByValOrByRefAlign(0),
70-
OrigAlign(0), IsInConsecutiveRegsLast(0), IsInConsecutiveRegs(0),
67+
: IsZExt(0), IsSExt(0), IsInReg(0), IsSRet(0), IsByVal(0), IsByRef(0),
68+
IsNest(0), IsReturned(0), IsSplit(0), IsInAlloca(0),
69+
IsPreallocated(0), IsSplitEnd(0), IsSwiftSelf(0), IsSwiftAsync(0),
70+
IsSwiftError(0), IsCFGuardTarget(0), IsHva(0), IsHvaStart(0),
71+
IsSecArgPass(0), ByValOrByRefAlign(0), OrigAlign(0),
72+
IsInConsecutiveRegsLast(0), IsInConsecutiveRegs(0),
7173
IsCopyElisionCandidate(0), IsPointer(0), ByValOrByRefSize(0),
7274
PointerAddrSpace(0) {
7375
static_assert(sizeof(*this) == 3 * sizeof(unsigned), "flags are too big");
@@ -100,6 +102,9 @@ namespace ISD {
100102
bool isSwiftSelf() const { return IsSwiftSelf; }
101103
void setSwiftSelf() { IsSwiftSelf = 1; }
102104

105+
bool isSwiftAsync() const { return IsSwiftAsync; }
106+
void setSwiftAsync() { IsSwiftAsync = 1; }
107+
103108
bool isSwiftError() const { return IsSwiftError; }
104109
void setSwiftError() { IsSwiftError = 1; }
105110

llvm/include/llvm/CodeGen/TargetFrameLowering.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ class TargetFrameLowering {
157157
/// returns false, spill slots will be assigned using generic implementation.
158158
/// assignCalleeSavedSpillSlots() may add, delete or rearrange elements of
159159
/// CSI.
160+
virtual bool assignCalleeSavedSpillSlots(MachineFunction &MF,
161+
const TargetRegisterInfo *TRI,
162+
std::vector<CalleeSavedInfo> &CSI,
163+
unsigned &MinCSFrameIndex,
164+
unsigned &MaxCSFrameIndex) const {
165+
return assignCalleeSavedSpillSlots(MF, TRI, CSI);
166+
}
167+
160168
virtual bool
161169
assignCalleeSavedSpillSlots(MachineFunction &MF,
162170
const TargetRegisterInfo *TRI,

llvm/include/llvm/CodeGen/TargetLowering.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ class TargetLoweringBase {
283283
bool IsPreallocated : 1;
284284
bool IsReturned : 1;
285285
bool IsSwiftSelf : 1;
286+
bool IsSwiftAsync : 1;
286287
bool IsSwiftError : 1;
287288
bool IsCFGuardTarget : 1;
288289
MaybeAlign Alignment = None;
@@ -293,7 +294,7 @@ class TargetLoweringBase {
293294
: IsSExt(false), IsZExt(false), IsInReg(false), IsSRet(false),
294295
IsNest(false), IsByVal(false), IsByRef(false), IsInAlloca(false),
295296
IsPreallocated(false), IsReturned(false), IsSwiftSelf(false),
296-
IsSwiftError(false), IsCFGuardTarget(false) {}
297+
IsSwiftAsync(false), IsSwiftError(false), IsCFGuardTarget(false) {}
297298

298299
void setAttributes(const CallBase *Call, unsigned ArgIdx);
299300
};

llvm/include/llvm/IR/Attributes.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ def SwiftError : EnumAttr<"swifterror">;
241241
/// Argument is swift self/context.
242242
def SwiftSelf : EnumAttr<"swiftself">;
243243

244+
/// Argument is swift async context.
245+
def SwiftAsync : EnumAttr<"swiftasync">;
246+
244247
/// Function must be in a unwind table.
245248
def UWTable : EnumAttr<"uwtable">;
246249

llvm/include/llvm/IR/Intrinsics.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,12 @@ def int_objc_arc_annotation_bottomup_bbstart : Intrinsic<[],
472472
def int_objc_arc_annotation_bottomup_bbend : Intrinsic<[],
473473
[llvm_ptrptr_ty,
474474
llvm_ptrptr_ty]>;
475+
//===--------------- Swift asynchronous context intrinsics ----------------===//
475476

477+
// Returns the location of the Swift asynchronous context (usually stored just
478+
// before the frame pointer), and triggers the creation of a null context if it
479+
// would otherwise be unneeded.
480+
def int_swift_async_context_addr : Intrinsic<[llvm_ptrptr_ty], [], [IntrNoMem]>;
476481

477482
//===--------------------- Code Generator Intrinsics ----------------------===//
478483
//

llvm/include/llvm/Target/TargetCallingConv.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class CCIfPreallocated<CCAction A> : CCIf<"ArgFlags.isPreallocated()", A> {
5151
class CCIfSwiftSelf<CCAction A> : CCIf<"ArgFlags.isSwiftSelf()", A> {
5252
}
5353

54+
/// CCIfSwiftAsync - If the current argument has swiftasync parameter attribute,
55+
/// apply Action A.
56+
class CCIfSwiftAsync<CCAction A> : CCIf<"ArgFlags.isSwiftAsync()", A> {
57+
}
58+
5459
/// CCIfSwiftError - If the current argument has swifterror parameter attribute,
5560
/// apply Action A.
5661
class CCIfSwiftError<CCAction A> : CCIf<"ArgFlags.isSwiftError()", A> {

llvm/lib/AsmParser/LLLexer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,7 @@ lltok::Kind LLLexer::LexIdentifier() {
695695
KEYWORD(speculative_load_hardening);
696696
KEYWORD(swifterror);
697697
KEYWORD(swiftself);
698+
KEYWORD(swiftasync);
698699
KEYWORD(uwtable);
699700
KEYWORD(willreturn);
700701
KEYWORD(writeonly);

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,7 @@ bool LLParser::parseFnAttributeValuePairs(AttrBuilder &B,
14331433
case lltok::kw_sret:
14341434
case lltok::kw_swifterror:
14351435
case lltok::kw_swiftself:
1436+
case lltok::kw_swiftasync:
14361437
case lltok::kw_immarg:
14371438
case lltok::kw_byref:
14381439
HaveError |=
@@ -1759,6 +1760,7 @@ bool LLParser::parseOptionalParamAttrs(AttrBuilder &B) {
17591760
case lltok::kw_signext: B.addAttribute(Attribute::SExt); break;
17601761
case lltok::kw_swifterror: B.addAttribute(Attribute::SwiftError); break;
17611762
case lltok::kw_swiftself: B.addAttribute(Attribute::SwiftSelf); break;
1763+
case lltok::kw_swiftasync: B.addAttribute(Attribute::SwiftAsync); break;
17621764
case lltok::kw_writeonly: B.addAttribute(Attribute::WriteOnly); break;
17631765
case lltok::kw_zeroext: B.addAttribute(Attribute::ZExt); break;
17641766
case lltok::kw_immarg: B.addAttribute(Attribute::ImmArg); break;
@@ -1864,6 +1866,7 @@ bool LLParser::parseOptionalReturnAttrs(AttrBuilder &B) {
18641866
case lltok::kw_sret:
18651867
case lltok::kw_swifterror:
18661868
case lltok::kw_swiftself:
1869+
case lltok::kw_swiftasync:
18671870
case lltok::kw_immarg:
18681871
case lltok::kw_byref:
18691872
HaveError |=

llvm/lib/AsmParser/LLToken.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ enum Kind {
238238
kw_strictfp,
239239
kw_swifterror,
240240
kw_swiftself,
241+
kw_swiftasync,
241242
kw_uwtable,
242243
kw_willreturn,
243244
kw_writeonly,

llvm/lib/Bitcode/Reader/BitcodeReader.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,6 +1519,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
15191519
return Attribute::SwiftError;
15201520
case bitc::ATTR_KIND_SWIFT_SELF:
15211521
return Attribute::SwiftSelf;
1522+
case bitc::ATTR_KIND_SWIFT_ASYNC:
1523+
return Attribute::SwiftAsync;
15221524
case bitc::ATTR_KIND_UW_TABLE:
15231525
return Attribute::UWTable;
15241526
case bitc::ATTR_KIND_WILLRETURN:

llvm/lib/Bitcode/Writer/BitcodeWriter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,8 @@ static uint64_t getAttrKindEncoding(Attribute::AttrKind Kind) {
732732
return bitc::ATTR_KIND_SWIFT_ERROR;
733733
case Attribute::SwiftSelf:
734734
return bitc::ATTR_KIND_SWIFT_SELF;
735+
case Attribute::SwiftAsync:
736+
return bitc::ATTR_KIND_SWIFT_ASYNC;
735737
case Attribute::UWTable:
736738
return bitc::ATTR_KIND_UW_TABLE;
737739
case Attribute::WillReturn:

llvm/lib/CodeGen/GlobalISel/CallLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ addFlagsUsingAttrFn(ISD::ArgFlagsTy &Flags,
5454
Flags.setReturned();
5555
if (AttrFn(Attribute::SwiftSelf))
5656
Flags.setSwiftSelf();
57+
if (AttrFn(Attribute::SwiftAsync))
58+
Flags.setSwiftAsync();
5759
if (AttrFn(Attribute::SwiftError))
5860
Flags.setSwiftError();
5961
}

0 commit comments

Comments
 (0)