Skip to content

[CIR][CodeGen] Introduce CIR CXXSpecialMember attribute #1711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions clang/include/clang/CIR/Dialect/IR/CIRAttrs.td
Original file line number Diff line number Diff line change
Expand Up @@ -1351,6 +1351,62 @@ def GlobalDtorAttr : CIR_GlobalCtorDtor<"Dtor", "dtor",
"A function with this attribute excutes before module unloading"
>;

def CIR_CtorKind : CIR_I32EnumAttr<"CtorKind", "CXX Constructor Kind", [
I32EnumAttrCase<"Custom", 0, "custom">,
I32EnumAttrCase<"Default", 1, "default">,
I32EnumAttrCase<"Copy", 2, "copy">,
]> {
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.
}];
let parameters = (ins "mlir::Type":$type,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need type here?

If we want to tag that this is member function from specific class it might make more sense to be more generic and have attribute MemberFunctionOf that is not just tied to ctors/dtor.

Consequently these ctor/dtor attributes will be just enum attribute and unit attribute respectively.

@bcardosolopes what do you think?

Copy link
Member

@bcardosolopes bcardosolopes Jul 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need type here?

The idea is to have the type around for grabbing any extra information we might need about the class (versus making assumptions on the type of the function this/first param). We don't have a use case for it just yet tho! That's usually a somewhat blocker for me, but I'm fine with keeping this one around.

If we want to tag that this is member function from specific class it might make more sense to be more generic and have attribute MemberFunctionOf that is not just tied to ctors/dtor.

That's the idea moving forward, but starting off with ctor/dtor and go incrementally.

what do you think?

I like the idea of a member_function_of<type, ctor<copy>>.

EnumParameter<CIR_CtorKind>:$ctorKind);

let assemblyFormat = [{
`<` $type `,` $ctorKind `>`
}];
// Printing and parsing also available in CIRDialect.cpp

let builders =
[AttrBuilderWithInferredContext<(ins "mlir::Type":$type,
CArg<"CtorKind", "cir::CtorKind::Custom">:$ctorKind), [{
return $_get(type.getContext(), type, ctorKind);
}]>];
}

def CIR_CXXDtorAttr
: CIR_Attr<"CXXDtor", "cxx_dtor"> {
let summary = "Marks a function as a CXX destructor";
let description = [{
Functions with this attribute are CXX destructors
}];
let parameters = (ins "mlir::Type":$type);

let assemblyFormat = [{
`<` $type `>`
}];
// Printing and parsing also available in CIRDialect.cpp

let builders =
[AttrBuilderWithInferredContext<(ins "mlir::Type":$type), [{
return $_get(type.getContext(), type);
}]>];
}

def CIR_CXXSpecialMemberAttr : AnyAttrOf<[
CIR_CXXCtorAttr,
CIR_CXXDtorAttr
]>;

def BitfieldInfoAttr : CIR_Attr<"BitfieldInfo", "bitfield_info"> {
let summary = "Represents a bit field info";
let description = [{
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/CIR/Dialect/IR/CIROps.td
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,7 @@ def FuncOp : CIR_Op<"func", [
OptionalAttr<GlobalCtorAttr>:$global_ctor,
OptionalAttr<GlobalDtorAttr>:$global_dtor,
OptionalAttr<ArrayAttr>:$annotations,
OptionalAttr<CIR_CXXSpecialMemberAttr>:$cxx_special_member,
OptionalAttr<AnyASTFunctionDeclAttr>:$ast
);

Expand Down
29 changes: 22 additions & 7 deletions clang/lib/CIR/CodeGen/CIRGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -764,15 +764,29 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn,
// Generate the body of the function.
// TODO: PGO.assignRegionCounters
assert(!cir::MissingFeatures::shouldInstrumentFunction());
if (isa<CXXDestructorDecl>(fd))
if (auto dtor = dyn_cast<CXXDestructorDecl>(fd)) {
auto cxxDtor = cir::CXXDtorAttr::get(
convertType(getContext().getRecordType(dtor->getParent())));
fn.setCxxSpecialMemberAttr(cxxDtor);

emitDestructorBody(args);
else if (isa<CXXConstructorDecl>(fd))
} else if (auto ctor = dyn_cast<CXXConstructorDecl>(fd)) {
cir::CtorKind ctorKind = cir::CtorKind::Custom;
if (ctor->isDefaultConstructor())
ctorKind = cir::CtorKind::Default;
if (ctor->isCopyConstructor())
ctorKind = cir::CtorKind::Copy;

auto cxxCtor = cir::CXXCtorAttr::get(
convertType(getContext().getRecordType(ctor->getParent())), ctorKind);
fn.setCxxSpecialMemberAttr(cxxCtor);

emitConstructorBody(args);
else if (getLangOpts().CUDA && !getLangOpts().CUDAIsDevice &&
fd->hasAttr<CUDAGlobalAttr>())
} else if (getLangOpts().CUDA && !getLangOpts().CUDAIsDevice &&
fd->hasAttr<CUDAGlobalAttr>()) {
CGM.getCUDARuntime().emitDeviceStub(*this, fn, args);
else if (isa<CXXMethodDecl>(fd) &&
cast<CXXMethodDecl>(fd)->isLambdaStaticInvoker()) {
} else if (isa<CXXMethodDecl>(fd) &&
cast<CXXMethodDecl>(fd)->isLambdaStaticInvoker()) {
// The lambda static invoker function is special, because it forwards or
// clones the body of the function call operator (but is actually
// static).
Expand All @@ -788,8 +802,9 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn,
fn.erase();
return nullptr;
}
} else
} else {
llvm_unreachable("no definition for emitted function");
}

assert(builder.getInsertionBlock() && "Should be valid");

Expand Down
21 changes: 21 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2739,6 +2739,27 @@ cir::FuncOp CIRGenModule::createCIRFunction(mlir::Location loc, StringRef name,
f.setExtraAttrsAttr(
cir::ExtraFuncAttributesAttr::get(builder.getDictionaryAttr({})));

if (fd) {
if (auto dtor = dyn_cast<CXXDestructorDecl>(fd)) {
auto cxxDtor = cir::CXXDtorAttr::get(
convertType(getASTContext().getRecordType(dtor->getParent())));
f.setCxxSpecialMemberAttr(cxxDtor);
}

if (auto ctor = dyn_cast<CXXConstructorDecl>(fd)) {
cir::CtorKind ctorKind = cir::CtorKind::Custom;
if (ctor->isDefaultConstructor())
ctorKind = cir::CtorKind::Default;
if (ctor->isCopyConstructor())
ctorKind = cir::CtorKind::Copy;

auto cxxCtor = cir::CXXCtorAttr::get(
convertType(getASTContext().getRecordType(ctor->getParent())),
ctorKind);
f.setCxxSpecialMemberAttr(cxxCtor);
}
}

if (!curCGF)
theModule.push_back(f);
}
Expand Down
48 changes: 47 additions & 1 deletion clang/lib/CIR/Dialect/IR/CIRDialect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ REGISTER_ENUM_TYPE(GlobalLinkageKind);
REGISTER_ENUM_TYPE(VisibilityKind);
REGISTER_ENUM_TYPE(CallingConv);
REGISTER_ENUM_TYPE(SideEffect);
REGISTER_ENUM_TYPE(CtorKind);
} // namespace

/// Parse an enum from the keyword, or default to the provided default value.
Expand Down Expand Up @@ -2538,6 +2539,7 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
auto visibilityNameAttr = getGlobalVisibilityAttrName(state.name);
auto dsoLocalNameAttr = getDsoLocalAttrName(state.name);
auto annotationsNameAttr = getAnnotationsAttrName(state.name);
auto cxxSpecialMemberAttr = getCxxSpecialMemberAttrName(state.name);
if (::mlir::succeeded(parser.parseOptionalKeyword(builtinNameAttr.strref())))
state.addAttribute(builtinNameAttr, parser.getBuilder().getUnitAttr());
if (::mlir::succeeded(
Expand Down Expand Up @@ -2618,6 +2620,37 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
state.addAttribute(annotationsNameAttr, annotations);
}

// Parse CXXSpecialMember attribute
if (mlir::succeeded(parser.parseOptionalKeyword("cxx_ctor"))) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still sounds simple enough that we shouldn't need these to be hand written, what specific problems are you hitting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update this once the syntax of the attribute is approved. I am also happy with member_function_of<type, ctor<copy>>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I'll defer this to @xlauko cause I'm going to be out until next week. One important part here is not to have a custom parser/printer because this is simple enough that it doesn't need one (see more examples in the LLVM dialect for inspiration).

if (parser.parseLess().failed())
return failure();
mlir::Type type;
if (parser.parseType(type).failed())
return failure();
if (parser.parseComma().failed())
return failure();
cir::CtorKind ctorKind;
if (parseCIRKeyword<cir::CtorKind>(parser, ctorKind).failed())
return failure();
if (parser.parseGreater().failed())
return failure();

state.addAttribute(cxxSpecialMemberAttr,
cir::CXXCtorAttr::get(type, ctorKind));
}

if (mlir::succeeded(parser.parseOptionalKeyword("cxx_dtor"))) {
if (parser.parseLess().failed())
return failure();
mlir::Type type;
if (parser.parseType(type).failed())
return failure();
if (parser.parseGreater().failed())
return failure();

state.addAttribute(cxxSpecialMemberAttr, cir::CXXDtorAttr::get(type));
}

// If additional attributes are present, parse them.
if (parser.parseOptionalAttrDictWithKeyword(state.attributes))
return failure();
Expand Down Expand Up @@ -2798,6 +2831,19 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
p.printAttribute(annotations);
}

if (getCxxSpecialMember()) {
if (auto cxxCtor = dyn_cast<cir::CXXCtorAttr>(*getCxxSpecialMember())) {
if (cxxCtor.getCtorKind() != cir::CtorKind::Custom)
p << " cxx_ctor<" << cxxCtor.getType() << ", " << cxxCtor.getCtorKind()
<< ">";
} else if (auto cxxDtor =
dyn_cast<cir::CXXDtorAttr>(*getCxxSpecialMember())) {
p << " cxx_dtor<" << cxxDtor.getType() << ">";
} else {
assert(false && "expected a CXX special member");
}
}

function_interface_impl::printFunctionAttributes(
p, *this,
// These are all omitted since they are custom printed already.
Expand All @@ -2808,7 +2854,7 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
getCallingConvAttrName(), getNoProtoAttrName(),
getSymVisibilityAttrName(), getArgAttrsAttrName(), getResAttrsAttrName(),
getComdatAttrName(), getGlobalVisibilityAttrName(),
getAnnotationsAttrName()});
getAnnotationsAttrName(), getCxxSpecialMemberAttrName()});

if (auto aliaseeName = getAliasee()) {
p << " alias(";
Expand Down
18 changes: 11 additions & 7 deletions clang/lib/CIR/Dialect/Transforms/LifetimeCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct LifetimeCheckPass : public LifetimeCheckBase<LifetimeCheckPass> {
void checkLambdaCaptureStore(StoreOp storeOp);
void trackCallToCoroutine(CallOp callOp);

void checkCtor(CallOp callOp, ASTCXXConstructorDeclInterface ctor);
void checkCtor(CallOp callOp, cir::CXXCtorAttr ctor);
void checkMoveAssignment(CallOp callOp, ASTCXXMethodDeclInterface m);
void checkCopyAssignment(CallOp callOp, ASTCXXMethodDeclInterface m);
void checkNonConstUseOfOwner(mlir::Value ownerAddr, mlir::Location loc);
Expand Down Expand Up @@ -1549,8 +1549,7 @@ bool LifetimeCheckPass::isCtorInitPointerFromOwner(CallOp callOp) {
return false;
}

void LifetimeCheckPass::checkCtor(CallOp callOp,
ASTCXXConstructorDeclInterface ctor) {
void LifetimeCheckPass::checkCtor(CallOp callOp, cir::CXXCtorAttr ctor) {
// TODO: zero init
// 2.4.2 if the initialization is default initialization or zero
// initialization, example:
Expand All @@ -1559,7 +1558,7 @@ void LifetimeCheckPass::checkCtor(CallOp callOp,
// string_view p;
//
// both results in pset(p) == {null}
if (ctor.isDefaultConstructor()) {
if (ctor.getCtorKind() == cir::CtorKind::Default) {
// First argument passed is always the alloca for the 'this' ptr.

// Currently two possible actions:
Expand All @@ -1583,7 +1582,7 @@ void LifetimeCheckPass::checkCtor(CallOp callOp,
}

// User defined copy ctor calls ...
if (ctor.isCopyConstructor()) {
if (ctor.getCtorKind() == cir::CtorKind::Copy) {
llvm_unreachable("NYI");
}

Expand Down Expand Up @@ -1788,8 +1787,13 @@ void LifetimeCheckPass::checkCall(CallOp callOp) {

// From this point on only owner and pointer class methods handling,
// starting from special methods.
if (auto ctor = dyn_cast<ASTCXXConstructorDeclInterface>(methodDecl))
return checkCtor(callOp, ctor);
if (auto fnName = callOp.getCallee()) {
auto calleeFuncOp = getCalleeFromSymbol(theModule, *fnName);
if (calleeFuncOp && calleeFuncOp.getCxxSpecialMember())
if (auto cxxCtor =
dyn_cast<cir::CXXCtorAttr>(*calleeFuncOp.getCxxSpecialMember()))
return checkCtor(callOp, cxxCtor);
}
if (methodDecl.isMoveAssignmentOperator())
return checkMoveAssignment(callOp, methodDecl);
if (methodDecl.isCopyAssignmentOperator())
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/CodeGen/ctor-alias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ B::B() {
// CHECK: %1 = cir.load %0 : !cir.ptr<!cir.ptr<!rec_B>>, !cir.ptr<!rec_B>
// CHECK: cir.return
// CHECK: }
// CHECK: cir.func private dso_local @_ZN1BC1Ev(!cir.ptr<!rec_B>) alias(@_ZN1BC2Ev)
// CHECK: cir.func private dso_local @_ZN1BC1Ev(!cir.ptr<!rec_B>) cxx_ctor<!rec_B, default> alias(@_ZN1BC2Ev)
4 changes: 2 additions & 2 deletions clang/test/CIR/CodeGen/static.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static Init __ioinit2(false);

// BEFORE: module {{.*}} {
// BEFORE-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr<!rec_Init>, !cir.bool)
// BEFORE-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr<!rec_Init>)
// BEFORE-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr<!rec_Init>) cxx_dtor<!rec_Init>
// BEFORE-NEXT: cir.global "private" internal dso_local @_ZL8__ioinit = ctor : !rec_Init {
// BEFORE-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr<!rec_Init>
// BEFORE-NEXT: %1 = cir.const #true
Expand All @@ -42,7 +42,7 @@ static Init __ioinit2(false);
// AFTER-NEXT: cir.global "private" external @__dso_handle : i8
// AFTER-NEXT: cir.func private @__cxa_atexit(!cir.ptr<!cir.func<(!cir.ptr<!void>)>>, !cir.ptr<!void>, !cir.ptr<i8>)
// AFTER-NEXT: cir.func private @_ZN4InitC1Eb(!cir.ptr<!rec_Init>, !cir.bool)
// AFTER-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr<!rec_Init>)
// AFTER-NEXT: cir.func private @_ZN4InitD1Ev(!cir.ptr<!rec_Init>) cxx_dtor<!rec_Init>
// AFTER-NEXT: cir.global "private" internal dso_local @_ZL8__ioinit = #cir.zero : !rec_Init {alignment = 1 : i64, ast = #cir.var.decl.ast}
// AFTER-NEXT: cir.func internal private @__cxx_global_var_init()
// AFTER-NEXT: %0 = cir.get_global @_ZL8__ioinit : !cir.ptr<!rec_Init>
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CIR/CodeGen/temporaries.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ void f() {
!E();
}

// CIR: cir.func private @_ZN1EC1Ev(!cir.ptr<!rec_E>) extra(#fn_attr)
// CIR: cir.func private @_ZN1EC1Ev(!cir.ptr<!rec_E>) cxx_ctor<!rec_E, default> extra(#fn_attr)
// CIR-NEXT: cir.func private @_ZN1EntEv(!cir.ptr<!rec_E>) -> !rec_E
// CIR-NEXT: cir.func private @_ZN1ED1Ev(!cir.ptr<!rec_E>) extra(#fn_attr)
// CIR-NEXT: cir.func private @_ZN1ED1Ev(!cir.ptr<!rec_E>) cxx_dtor<!rec_E> extra(#fn_attr)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like we could also drop "cxx": dtor<!rec_E> is probably good enough? No need to change this right now, let's converge on the syntax first (see other comment).

// CIR-NEXT: cir.func dso_local @_Z1fv() extra(#fn_attr1) {
// CIR-NEXT: cir.scope {
// CIR-NEXT: %[[ONE:[0-9]+]] = cir.alloca !rec_E, !cir.ptr<!rec_E>, ["agg.tmp.ensured"] {alignment = 1 : i64}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CIR/CodeGen/tempref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
struct A { ~A(); };
A &&a = dynamic_cast<A&&>(A{});

// CHECK: cir.func private @_ZN1AD1Ev(!cir.ptr<!rec_A>) extra(#fn_attr)
// CHECK: cir.func private @_ZN1AD1Ev(!cir.ptr<!rec_A>) cxx_dtor<!rec_A> extra(#fn_attr)
// CHECK-NEXT: cir.global external @a = #cir.ptr<null> : !cir.ptr<!rec_A> {alignment = 8 : i64, ast = #cir.var.decl.ast}
// CHECK-NEXT: cir.func internal private @__cxx_global_var_init() {
// CHECK-NEXT: cir.scope {
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CIR/CodeGen/virtual-destructor-calls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct B : A {
// LLVM: call void @_ZN1AD2Ev

// Complete dtor: just an alias because there are no virtual bases.
// CIR: cir.func private dso_local @_ZN1BD1Ev(!cir.ptr<!rec_B>) alias(@_ZN1BD2Ev)
// CIR: cir.func private dso_local @_ZN1BD1Ev(!cir.ptr<!rec_B>) cxx_dtor<!rec_B> alias(@_ZN1BD2Ev)
// FIXME: LLVM output should be: @_ZN1BD1Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev
// LLVM: declare dso_local void @_ZN1BD1Ev(ptr)

Expand All @@ -43,11 +43,11 @@ struct B : A {

// (aliases from C)
// CIR: cir.func dso_local @_ZN1CD2Ev(%arg0: !cir.ptr<!rec_C>{{.*}})) {{.*}} {
// CIR: cir.func private dso_local @_ZN1CD1Ev(!cir.ptr<!rec_C>) alias(@_ZN1CD2Ev)
// CIR: cir.func private dso_local @_ZN1CD1Ev(!cir.ptr<!rec_C>) cxx_dtor<!rec_C> alias(@_ZN1CD2Ev)

// CIR_O1-NOT: cir.func dso_local @_ZN1CD2Ev(%arg0: !cir.ptr<!rec_C>{{.*}})) {{.*}} {
// CIR_O1: cir.func private dso_local @_ZN1CD2Ev(!cir.ptr<!rec_C>) alias(@_ZN1BD2Ev)
// CIR_O1: cir.func private dso_local @_ZN1CD1Ev(!cir.ptr<!rec_C>) alias(@_ZN1CD2Ev)
// CIR_O1: cir.func private dso_local @_ZN1CD2Ev(!cir.ptr<!rec_C>) cxx_dtor<!rec_C> alias(@_ZN1BD2Ev)
// CIR_O1: cir.func private dso_local @_ZN1CD1Ev(!cir.ptr<!rec_C>) cxx_dtor<!rec_C> alias(@_ZN1CD2Ev)

// FIXME: LLVM output should be: @_ZN1CD2Ev ={{.*}} unnamed_addr alias {{.*}} @_ZN1BD2Ev
// LLVM: define dso_local void @_ZN1CD2Ev(ptr
Expand Down
20 changes: 20 additions & 0 deletions clang/test/CIR/IR/cxx-special-member.cir
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// RUN: cir-opt %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s

!s32i = !cir.int<s, 32>
!rec_S = !cir.record<struct "S" {!s32i}>
module {
cir.func private @_ZN1SC1ERKS_(!cir.ptr<!rec_S>, !cir.ptr<!rec_S>) cxx_ctor<!rec_S, copy>
cir.func private @_ZN1SC2Ei(!cir.ptr<!rec_S>, !cir.ptr<!rec_S>)
cir.func private @_ZN1SC2Ev(!cir.ptr<!rec_S>) cxx_ctor<!rec_S, default>
cir.func private @_ZN1SD2Ev(!cir.ptr<!rec_S>) cxx_dtor<!rec_S>
}

// CHECK: !s32i = !cir.int<s, 32>
// CHECK: !rec_S = !cir.record<struct "S" {!s32i}>
// CHECK: module {
// CHECK: cir.func private @_ZN1SC1ERKS_(!cir.ptr<!rec_S>, !cir.ptr<!rec_S>) cxx_ctor<!rec_S, copy>
// CHECK: cir.func private @_ZN1SC2Ei(!cir.ptr<!rec_S>, !cir.ptr<!rec_S>)
// CHECK: cir.func private @_ZN1SC2Ev(!cir.ptr<!rec_S>) cxx_ctor<!rec_S, default>
// CHECK: cir.func private @_ZN1SD2Ev(!cir.ptr<!rec_S>) cxx_dtor<!rec_S>
// CHECK: }
Loading