[embedded] Actually, use 'nounwind' even with C++ interop on, add comment

This commit is contained in:
Kuba Mracek
2023-12-11 10:09:06 -08:00
parent 9e8db64f45
commit fdc69fb6a1
2 changed files with 6 additions and 4 deletions

View File

@@ -1445,8 +1445,9 @@ void IRGenModule::constructInitialFnAttributes(
Attrs.addAttribute("stack-protector-buffer-size", llvm::utostr(8));
}
if (Context.LangOpts.hasFeature(Feature::Embedded) &&
!Context.LangOpts.EnableCXXInterop) {
// Mark as 'nounwind' to avoid referencing exception personality symbols, this
// is okay even with C++ interop on because the landinpads are trapping.
if (Context.LangOpts.hasFeature(Feature::Embedded)) {
Attrs.addAttribute(llvm::Attribute::NoUnwind);
}
}