Skip to content

Commit 3c1ef77

Browse files
committed
[DebugInfo] Fix specialization of debug variable types
1 parent 0cff76e commit 3c1ef77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/swift/SIL/SILCloner.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,8 @@ SILCloner<ImplClass>::visitAllocStackInst(AllocStackInst *Inst) {
875875
Loc = MandatoryInlinedLocation::getAutoGeneratedLocation();
876876
VarInfo = std::nullopt;
877877
}
878+
if (VarInfo && VarInfo->Type)
879+
VarInfo->Type = getOpType(*VarInfo->Type);
878880
auto *NewInst = getBuilder().createAllocStack(
879881
Loc, getOpType(Inst->getElementType()), VarInfo,
880882
Inst->hasDynamicLifetime(), Inst->isLexical(), Inst->isFromVarDecl(),
@@ -1408,6 +1410,8 @@ SILCloner<ImplClass>::visitDebugValueInst(DebugValueInst *Inst) {
14081410
// Since we want the debug info to survive, we do not remap the location here.
14091411
SILDebugVariable VarInfo = *Inst->getVarInfo();
14101412
getBuilder().setCurrentDebugScope(getOpScope(Inst->getDebugScope()));
1413+
if (VarInfo.Type)
1414+
VarInfo.Type = getOpType(*VarInfo.Type);
14111415
auto *NewInst = getBuilder().createDebugValue(
14121416
Inst->getLoc(), getOpValue(Inst->getOperand()), VarInfo,
14131417
Inst->poisonRefs(), Inst->usesMoveableValueDebugInfo(), Inst->hasTrace());

0 commit comments

Comments
 (0)