Skip to content

Commit d4c51f3

Browse files
committed
update
1 parent 904732f commit d4c51f3

File tree

3 files changed

+14
-16
lines changed

3 files changed

+14
-16
lines changed

clang/lib/CIR/CodeGen/CIRGenFunction.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -764,16 +764,14 @@ cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn,
764764
// Generate the body of the function.
765765
// TODO: PGO.assignRegionCounters
766766
assert(!cir::MissingFeatures::shouldInstrumentFunction());
767-
if (isa<CXXDestructorDecl>(fd)) {
768-
auto dtor = dyn_cast<CXXDestructorDecl>(fd);
767+
if (auto dtor = dyn_cast<CXXDestructorDecl>(fd)) {
769768
auto cxxDtor = cir::CXXDtorAttr::get(
770769
&getMLIRContext(),
771770
convertType(getContext().getRecordType(dtor->getParent())));
772771
fn.setCxxDtorAttr(cxxDtor);
773772

774773
emitDestructorBody(args);
775-
} else if (isa<CXXConstructorDecl>(fd)) {
776-
auto ctor = dyn_cast<CXXConstructorDecl>(fd);
774+
} else if (auto ctor = dyn_cast<CXXConstructorDecl>(fd)) {
777775
auto cxxCtor = cir::CXXCtorAttr::get(
778776
&getMLIRContext(),
779777
convertType(getContext().getRecordType(ctor->getParent())),

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2742,16 +2742,14 @@ cir::FuncOp CIRGenModule::createCIRFunction(mlir::Location loc, StringRef name,
27422742
if (fd) {
27432743
CIRGenFunction cgf{*this, builder};
27442744

2745-
if (isa<CXXDestructorDecl>(fd)) {
2746-
auto dtor = dyn_cast<CXXDestructorDecl>(fd);
2745+
if (auto dtor = dyn_cast<CXXDestructorDecl>(fd)) {
27472746
auto cxxDtor = cir::CXXDtorAttr::get(
27482747
&getMLIRContext(),
27492748
convertType(cgf.getContext().getRecordType(dtor->getParent())));
27502749
f.setCxxDtorAttr(cxxDtor);
27512750
}
27522751

2753-
if (isa<CXXConstructorDecl>(fd)) {
2754-
auto ctor = dyn_cast<CXXConstructorDecl>(fd);
2752+
if (auto ctor = dyn_cast<CXXConstructorDecl>(fd)) {
27552753
auto cxxCtor = cir::CXXCtorAttr::get(
27562754
&getMLIRContext(),
27572755
convertType(cgf.getContext().getRecordType(ctor->getParent())),

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,14 +2679,16 @@ void cir::FuncOp::print(OpAsmPrinter &p) {
26792679
function_interface_impl::printFunctionAttributes(
26802680
p, *this,
26812681
// These are all omitted since they are custom printed already.
2682-
{getAliaseeAttrName(), getBuiltinAttrName(), getCoroutineAttrName(),
2683-
getDsoLocalAttrName(), getExtraAttrsAttrName(),
2684-
getFunctionTypeAttrName(), getGlobalCtorAttrName(),
2685-
getGlobalDtorAttrName(), getLambdaAttrName(), getLinkageAttrName(),
2686-
getCallingConvAttrName(), getNoProtoAttrName(),
2687-
getSymVisibilityAttrName(), getArgAttrsAttrName(), getResAttrsAttrName(),
2688-
getComdatAttrName(), getGlobalVisibilityAttrName(),
2689-
getAnnotationsAttrName(), getCxxCtorAttrName(), getCxxDtorAttrName()});
2682+
{getAliaseeAttrName(), getBuiltinAttrName(),
2683+
getCoroutineAttrName(), getDsoLocalAttrName(),
2684+
getExtraAttrsAttrName(), getFunctionTypeAttrName(),
2685+
getGlobalCtorAttrName(), getGlobalDtorAttrName(),
2686+
getLambdaAttrName(), getLinkageAttrName(),
2687+
getCallingConvAttrName(), getNoProtoAttrName(),
2688+
getSymVisibilityAttrName(), getArgAttrsAttrName(),
2689+
getResAttrsAttrName(), getComdatAttrName(),
2690+
getGlobalVisibilityAttrName(), getAnnotationsAttrName(),
2691+
getCxxCtorAttrName(), getCxxDtorAttrName()});
26902692

26912693
if (auto aliaseeName = getAliasee()) {
26922694
p << " alias(";

0 commit comments

Comments
 (0)