@@ -1778,36 +1778,14 @@ const TypeLayoutEntry &IRGenModule::getTypeLayoutEntry(SILType T) {
17781778 return Types.getTypeLayoutEntry (T);
17791779}
17801780
1781- // / Return whether FrameLowering should always set the "extended frame
1782- // / present" bit in FP, or set it based on a symbol in the runtime.
1783- static bool isSwiftAsyncContextIsDynamicallySet (llvm::Triple TT) {
1784- // Older OS versions (particularly system unwinders) are confused by the
1785- // Swift extended frame, so when building code that might be run on them we
1786- // must dynamically query the concurrency library to determine whether
1787- // extended frames should be flagged as present.
1788- unsigned Major, Minor, Micro;
1789- TT.getOSVersion (Major, Minor, Micro);
1790- switch (TT.getOS ()) {
1791- default :
1792- return false ;
1793- case llvm::Triple::IOS:
1794- case llvm::Triple::TvOS:
1795- return Major < 15 ;
1796- case llvm::Triple::WatchOS:
1797- return Major < 8 ;
1798- case llvm::Triple::MacOSX:
1799- case llvm::Triple::Darwin:
1800- return Major < 12 ;
1801- }
1802- }
18031781
18041782void IRGenModule::emitSwiftAsyncExtendedFrameInfoWeakRef () {
18051783 if (!hasSwiftAsyncFunctionDef || extendedFramePointerFlagsWeakRef)
18061784 return ;
18071785 if (IRGen.Opts .SwiftAsyncFramePointer !=
18081786 SwiftAsyncFramePointerKind::Auto)
18091787 return ;
1810- if (! isSwiftAsyncContextIsDynamicallySet (Triple ))
1788+ if (isConcurrencyAvailable ( ))
18111789 return ;
18121790
18131791 // Emit a weak reference to the `swift_async_extendedFramePointerFlags` symbol
@@ -1819,3 +1797,10 @@ void IRGenModule::emitSwiftAsyncExtendedFrameInfoWeakRef() {
18191797 llvm::GlobalValue::ExternalWeakLinkage, nullptr ,
18201798 symbolName);
18211799}
1800+
1801+ bool IRGenModule::isConcurrencyAvailable () {
1802+ auto &ctx = getSwiftModule ()->getASTContext ();
1803+ auto deploymentAvailability =
1804+ AvailabilityContext::forDeploymentTarget (ctx);
1805+ return deploymentAvailability.isContainedIn (ctx.getConcurrencyAvailability ());
1806+ }
0 commit comments