================
@@ -822,6 +822,104 @@ def CIR_GlobalDtorAttr : CIR_GlobalCtorDtor<"Dtor",
"dtor"> {
}];
}
+//===----------------------------------------------------------------------===//
+// CXX SpecialMemberAttr
+//===----------------------------------------------------------------------===//
+
+def CIR_CtorKind : CIR_I32EnumAttr<"CtorKind", "CXX Constructor Kind", [
+ I32EnumAttrCase<"Custom", 0, "custom">,
+ I32EnumAttrCase<"Default", 1, "default">,
+ I32EnumAttrCase<"Copy", 2, "copy">,
+ I32EnumAttrCase<"Move", 3, "move">,
+]> {
+ let genSpecializedAttr = 0;
+}
+
+def CIR_CXXCtorAttr : CIR_Attr<"CXXCtor", "cxx_ctor"> {
+ let summary = "Marks a function as a CXX constructor";
+ let description = [{
+ Functions with this attribute are CXX constructors.
+ The `custom` kind is used if the constructor is a custom constructor.
+ The `default` kind is used if the constructor is a default constructor.
+ The `copy` kind is used if the constructor is a copy constructor.
+ The `move` kind is used if the constructor is a move constructor.
+ }];
+ let parameters = (ins "mlir::Type":$type,
+ EnumParameter<CIR_CtorKind>:$ctorKind,
+ "bool":$is_trivial);
+
+ let assemblyFormat = [{
+ `<` $type `,` $ctorKind `,` $is_trivial `>`
----------------
HendrikHuebner wrote:
Ohh right, this generates the `special_member<#cir.cxx_ctor<!rec_Foo, default,
false>>` in the CIR output
https://github.com/llvm/llvm-project/pull/167975
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits