Skip to content

Commit fdc69fb

Browse files
committed
[embedded] Actually, use 'nounwind' even with C++ interop on, add comment
1 parent 9e8db64 commit fdc69fb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/IRGen/IRGenModule.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,8 +1445,9 @@ void IRGenModule::constructInitialFnAttributes(
14451445
Attrs.addAttribute("stack-protector-buffer-size", llvm::utostr(8));
14461446
}
14471447

1448-
if (Context.LangOpts.hasFeature(Feature::Embedded) &&
1449-
!Context.LangOpts.EnableCXXInterop) {
1448+
// Mark as 'nounwind' to avoid referencing exception personality symbols, this
1449+
// is okay even with C++ interop on because the landinpads are trapping.
1450+
if (Context.LangOpts.hasFeature(Feature::Embedded)) {
14501451
Attrs.addAttribute(llvm::Attribute::NoUnwind);
14511452
}
14521453
}

lib/IRGen/IRGenSIL.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,8 +1846,9 @@ IRGenSILFunction::IRGenSILFunction(IRGenModule &IGM, SILFunction *f)
18461846
CurFn->addFnAttr(llvm::Attribute::NoInline);
18471847
}
18481848

1849-
if (IGM.Context.LangOpts.hasFeature(Feature::Embedded) &&
1850-
!IGM.Context.LangOpts.EnableCXXInterop) {
1849+
// Mark as 'nounwind' to avoid referencing exception personality symbols, this
1850+
// is okay even with C++ interop on because the landinpads are trapping.
1851+
if (IGM.Context.LangOpts.hasFeature(Feature::Embedded)) {
18511852
CurFn->addFnAttr(llvm::Attribute::NoUnwind);
18521853
}
18531854

0 commit comments

Comments
 (0)