File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -928,7 +928,7 @@ class IRGenSILFunction :
928
928
// Mark variables in async functions that don't generate a shadow copy for
929
929
// lifetime extension, so they get spilled into the async context.
930
930
if (!IGM.IRGen .Opts .shouldOptimize () && CurSILFn->isAsync ())
931
- if (isa<llvm::AllocaInst>(Storage) || isa<llvm::Constant>(Storage) ) {
931
+ if (isa<llvm::AllocaInst>(Storage)) {
932
932
if (emitLifetimeExtendingUse (Storage))
933
933
if (ValueVariables.insert (Storage).second )
934
934
ValueDomPoints.push_back ({Storage, getActiveDominancePoint ()});
@@ -4718,8 +4718,8 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
4718
4718
return ;
4719
4719
4720
4720
IndirectionKind Indirection = DirectValue;
4721
- if (CurSILFn->isAsync () &&
4722
- !i-> getDebugScope ()-> InlinedCallSite ) {
4721
+ if (CurSILFn->isAsync () && !i-> getDebugScope ()-> InlinedCallSite &&
4722
+ (Copy. empty () || !isa<llvm::Constant>(Copy[ 0 ])) ) {
4723
4723
Indirection = CoroDirectValue;
4724
4724
}
4725
4725
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ func getString() async -> String {
12
12
func wait( ) async throws { }
13
13
14
14
public func makeDinner( ) async throws -> String {
15
+ let local_constant = 5
15
16
let local = await getString ( )
16
17
try await wait ( )
17
18
// CHECK-LABEL: define {{.*}} void @"$s1a10makeDinnerSSyYKF.resume.0"
You can’t perform that action at this time.
0 commit comments