Skip to content

Commit 08b3c95

Browse files
Merge pull request #77452 from aschwaighofer/enable_async_metadata
IRGen: Enable EmitAsyncFramePushPopMetadata per default
2 parents 971d106 + 1c1d95a commit 08b3c95

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

include/swift/AST/IRGenOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ class IRGenOptions {
590590
DisableReadonlyStaticObjects(false), CollocatedMetadataFunctions(false),
591591
ColocateTypeDescriptors(true), UseRelativeProtocolWitnessTables(false),
592592
UseFragileResilientProtocolWitnesses(false), EnableHotColdSplit(false),
593-
EmitAsyncFramePushPopMetadata(false), EmitYieldOnce2AsYieldOnce(true),
593+
EmitAsyncFramePushPopMetadata(true), EmitYieldOnce2AsYieldOnce(true),
594594
AsyncFramePointerAll(false), UseProfilingMarkerThunks(false),
595595
DebugInfoForProfiling(false), CmdArgs(),
596596
SanitizeCoverage(llvm::SanitizerCoverageOptions()),

lib/IRGen/IRGenSIL.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2605,7 +2605,8 @@ void IRGenSILFunction::emitSILFunction() {
26052605
LinkEntity::forSILFunction(CurSILFn),
26062606
getAsyncContextLayout(*this).getSize());
26072607

2608-
if (IGM.getOptions().EmitAsyncFramePushPopMetadata) {
2608+
if (IGM.getOptions().EmitAsyncFramePushPopMetadata &&
2609+
IGM.TargetInfo.OutputObjectFormat == llvm::Triple::MachO) {
26092610
CurFn->addFnAttr("async_entry");
26102611
CurFn->addFnAttr(llvm::Attribute::NoInline);
26112612
}

test/IRGen/async_frame_entry_return_metadata.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %target-swift-frontend -primary-file %s -emit-ir -module-name async -target %target-swift-5.1-abi-triple -enable-async-frame-push-pop-metadata | %FileCheck %s --check-prefix=ENABLED
22
// RUN: %target-swift-frontend -primary-file %s -emit-ir -module-name async -target %target-swift-5.1-abi-triple -O -enable-async-frame-push-pop-metadata | %FileCheck %s --check-prefix=ENABLED
33
// RUN: %target-swift-frontend -primary-file %s -emit-ir -module-name async -target %target-swift-5.1-abi-triple -disable-async-frame-push-pop-metadata | %FileCheck %s --check-prefix=DISABLED
4-
// RUN: %target-swift-frontend -primary-file %s -emit-ir -module-name async -target %target-swift-5.1-abi-triple | %FileCheck %s --check-prefix=DISABLED
4+
// RUN: %target-swift-frontend -primary-file %s -emit-ir -module-name async -target %target-swift-5.1-abi-triple | %FileCheck %s --check-prefix=ENABLED
55

66
// REQUIRES: OS=macosx || OS=iphoneos
77
// REQUIRES: PTRSIZE=64

0 commit comments

Comments
 (0)