@@ -1279,6 +1279,7 @@ def CIR_CtorKind : CIR_I32EnumAttr<"CtorKind", "CXX Constructor Kind", [
12791279 I32EnumAttrCase<"Custom", 0, "custom">,
12801280 I32EnumAttrCase<"Default", 1, "default">,
12811281 I32EnumAttrCase<"Copy", 2, "copy">,
1282+ I32EnumAttrCase<"Move", 3, "move">,
12821283]> {
12831284 let genSpecializedAttr = 0;
12841285}
@@ -1290,6 +1291,7 @@ def CIR_CXXCtorAttr : CIR_Attr<"CXXCtor", "cxx_ctor"> {
12901291 The `custom` kind is used if the constructor is a custom constructor.
12911292 The `default` kind is used if the constructor is a default constructor.
12921293 The `copy` kind is used if the constructor is a copy constructor.
1294+ The `move` kind is used if the constructor is a move constructor.
12931295 }];
12941296 let parameters = (ins "mlir::Type":$type,
12951297 EnumParameter<CIR_CtorKind>:$ctorKind);
@@ -1324,9 +1326,39 @@ def CIR_CXXDtorAttr : CIR_Attr<"CXXDtor", "cxx_dtor"> {
13241326 ];
13251327}
13261328
1329+ def CIR_AssignKind : CIR_I32EnumAttr<"AssignKind", "CXX Assignment Operator Kind", [
1330+ I32EnumAttrCase<"Copy", 0, "copy">,
1331+ I32EnumAttrCase<"Move", 1, "move">,
1332+ ]> {
1333+ let genSpecializedAttr = 0;
1334+ }
1335+
1336+ def CIR_CXXAssignAttr : CIR_Attr<"CXXAssign", "cxx_assign"> {
1337+ let summary = "Marks a function as a CXX assignment operator";
1338+ let description = [{
1339+ Functions with this attribute are CXX assignment operators.
1340+ The `copy` kind is used if the assignment operator is a copy assignment operator.
1341+ The `move` kind is used if the assignment operator is a move assignment operator.
1342+ }];
1343+ let parameters = (ins "mlir::Type":$type,
1344+ EnumParameter<CIR_AssignKind>:$assignKind);
1345+
1346+ let assemblyFormat = [{
1347+ `<` $type `,` $assignKind `>`
1348+ }];
1349+
1350+ let builders = [
1351+ AttrBuilderWithInferredContext<(ins "mlir::Type":$type,
1352+ CArg<"AssignKind">:$assignKind), [{
1353+ return $_get(type.getContext(), type, assignKind);
1354+ }]>
1355+ ];
1356+ }
1357+
13271358def CIR_CXXSpecialMemberAttr : AnyAttrOf<[
13281359 CIR_CXXCtorAttr,
1329- CIR_CXXDtorAttr
1360+ CIR_CXXDtorAttr,
1361+ CIR_CXXAssignAttr
13301362]>;
13311363
13321364def CIR_BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
0 commit comments