Skip to content

Commit 9ab3b1f

Browse files
committed
[IRGen] Disable on-stack pack metadata via attr.
When lowering a SIL function, if it bears the no_onstack_pack_metadata annotation, disable on-stack pack metadata.
1 parent ad70cbb commit 9ab3b1f

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/IRGen/IRGenFunction.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,12 @@ class IRGenFunction {
201201
llvm::Value *AsyncCoroutineCurrentResume = nullptr;
202202
llvm::Value *AsyncCoroutineCurrentContinuationContext = nullptr;
203203

204+
protected:
204205
// Whether pack metadata stack promotion is disabled for this function in
205206
// particular.
206207
bool packMetadataStackPromotionDisabled = false;
207208

209+
private:
208210
Address asyncContextLocation;
209211

210212
/// The unique block that calls @llvm.coro.end.

lib/IRGen/IRGenSIL.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2359,6 +2359,9 @@ void IRGenSILFunction::emitSILFunction() {
23592359
if (IGM.DebugInfo)
23602360
IGM.DebugInfo->emitFunction(*CurSILFn, CurFn);
23612361

2362+
if (!CurSILFn->useStackForPackMetadata())
2363+
packMetadataStackPromotionDisabled = true;
2364+
23622365
// Map the entry bb.
23632366
LoweredBBs[&*CurSILFn->begin()] = LoweredBB(&CurFn->back(), {});
23642367
// Create LLVM basic blocks for the other bbs.

0 commit comments

Comments
 (0)