Skip to content

Commit 1861174

Browse files
committed
more changes
1 parent 5e8de9b commit 1861174

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

clang/lib/CIR/Dialect/IR/CIRDialect.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2804,19 +2804,11 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
28042804
p.printAttribute(annotations);
28052805
}
28062806

2807-
if (getCxxSpecialMember()) {
2808-
if (auto cxxCtor = dyn_cast<cir::CXXCtorAttr>(*getCxxSpecialMember())) {
2809-
p << " special_member<";
2810-
p.printAttribute(cxxCtor);
2811-
p << '>';
2812-
} else if (auto cxxDtor =
2813-
dyn_cast<cir::CXXDtorAttr>(*getCxxSpecialMember())) {
2814-
p << " special_member<";
2815-
p.printAttribute(cxxDtor);
2816-
p << '>';
2817-
} else {
2818-
assert(false && "expected a CXX special member");
2819-
}
2807+
if (auto specialMemberAttr = getCxxSpecialMember()) {
2808+
assert((mlir::isa<cir::CXXCtorAttr, cir::CXXDtorAttr>(*specialMemberAttr)));
2809+
p << " special_member<";
2810+
p.printAttribute(*specialMemberAttr);
2811+
p << '>';
28202812
}
28212813

28222814
function_interface_impl::printFunctionAttributes(

0 commit comments

Comments
 (0)