Skip to content

Commit 4f39afe

Browse files
committed
[CIR] Apply annotation to CXXConstructorDecl and CXXDestructorDecl too
1 parent 32e3971 commit 4f39afe

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,9 +1648,11 @@ void CIRGenModule::emitGlobalDefinition(GlobalDecl gd, mlir::Operation *op) {
16481648
if (const auto *method = dyn_cast<CXXMethodDecl>(d)) {
16491649
// Make sure to emit the definition(s) before we emit the thunks. This is
16501650
// necessary for the generation of certain thunks.
1651-
if (isa<CXXConstructorDecl>(method) || isa<CXXDestructorDecl>(method))
1651+
if (isa<CXXConstructorDecl>(method) || isa<CXXDestructorDecl>(method)) {
1652+
if (d->getAttr<AnnotateAttr>())
1653+
deferredAnnotations[getMangledName(gd)] = cast<ValueDecl>(d);
16521654
ABI->emitCXXStructor(gd);
1653-
else if (fd->isMultiVersion())
1655+
} else if (fd->isMultiVersion())
16541656
llvm_unreachable("NYI");
16551657
else
16561658
emitGlobalFunctionDefinition(gd, op);

0 commit comments

Comments
 (0)