Skip to content

Commit 0337ea9

Browse files
committed
Remove uses of SGF.CurrentSILLoc from SILGenPattern
1 parent 71448d6 commit 0337ea9

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

lib/SILGen/SILGenPattern.cpp

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2760,14 +2760,16 @@ static void switchCaseStmtSuccessCallback(SILGenFunction &SGF,
27602760
}
27612761

27622762
// If we have a loadable address, perform a load [copy].
2763+
SILLocation loc(var);
2764+
loc.markAutoGenerated();
27632765
if (type.isAddress()) {
2764-
value = SGF.B.emitLoadValueOperation(SGF.CurrentSILLoc, value,
2766+
value = SGF.B.emitLoadValueOperation(loc, value,
27652767
LoadOwnershipQualifier::Copy);
27662768
args.push_back(value);
27672769
break;
27682770
}
27692771

2770-
value = SGF.B.emitCopyValueOperation(SGF.CurrentSILLoc, value);
2772+
value = SGF.B.emitCopyValueOperation(loc, value);
27712773
args.push_back(value);
27722774
break;
27732775
}
@@ -3015,14 +3017,16 @@ void SILGenFunction::emitSwitchFallthrough(FallthroughStmt *S) {
30153017
break;
30163018
}
30173019

3020+
SILLocation loc(var);
3021+
loc.markAutoGenerated();
30183022
if (varLoc.box) {
3019-
SILValue argValue = B.emitLoadValueOperation(
3020-
CurrentSILLoc, value, LoadOwnershipQualifier::Copy);
3023+
SILValue argValue =
3024+
B.emitLoadValueOperation(loc, value, LoadOwnershipQualifier::Copy);
30213025
args.push_back(argValue);
30223026
break;
30233027
}
30243028

3025-
auto argValue = B.emitCopyValueOperation(CurrentSILLoc, value);
3029+
auto argValue = B.emitCopyValueOperation(loc, value);
30263030
args.push_back(argValue);
30273031
break;
30283032
}
@@ -3133,14 +3137,16 @@ void SILGenFunction::emitCatchDispatch(DoCatchStmt *S, ManagedValue exn,
31333137
}
31343138

31353139
// If we have a loadable address, perform a load [copy].
3140+
SILLocation loc(var);
3141+
loc.markAutoGenerated();
31363142
if (type.isAddress()) {
3137-
value = B.emitLoadValueOperation(CurrentSILLoc, value,
3143+
value = B.emitLoadValueOperation(loc, value,
31383144
LoadOwnershipQualifier::Copy);
31393145
args.push_back(value);
31403146
break;
31413147
}
31423148

3143-
value = B.emitCopyValueOperation(CurrentSILLoc, value);
3149+
value = B.emitCopyValueOperation(loc, value);
31443150
args.push_back(value);
31453151
break;
31463152
}

0 commit comments

Comments
 (0)