Skip to content

Commit 9e8db64

Browse files
committed
[embedded] Don't apply 'nounwind' if C++ interop is enabled
1 parent bb7823c commit 9e8db64

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/IRGen/IRGenModule.cpp

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

1448-
if (Context.LangOpts.hasFeature(Feature::Embedded)) {
1448+
if (Context.LangOpts.hasFeature(Feature::Embedded) &&
1449+
!Context.LangOpts.EnableCXXInterop) {
14491450
Attrs.addAttribute(llvm::Attribute::NoUnwind);
14501451
}
14511452
}

lib/IRGen/IRGenSIL.cpp

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

1849-
if (IGM.Context.LangOpts.hasFeature(Feature::Embedded)) {
1849+
if (IGM.Context.LangOpts.hasFeature(Feature::Embedded) &&
1850+
!IGM.Context.LangOpts.EnableCXXInterop) {
18501851
CurFn->addFnAttr(llvm::Attribute::NoUnwind);
18511852
}
18521853

0 commit comments

Comments
 (0)