@@ -2957,17 +2957,6 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
2957
2957
i->getVarInfo ().getArgNo ());
2958
2958
}
2959
2959
2960
- // / InOut- and Archetypes are already implicitly indirect.
2961
- static IndirectionKind getIndirectionForDebugValueAddr (swift::TypeBase *Ty) {
2962
- switch (Ty->getKind ()) {
2963
- case TypeKind::InOut:
2964
- case TypeKind::Archetype:
2965
- return DirectValue;
2966
- default :
2967
- return IndirectValue;
2968
- }
2969
- }
2970
-
2971
2960
void IRGenSILFunction::visitDebugValueAddrInst (DebugValueAddrInst *i) {
2972
2961
if (!IGM.DebugInfo )
2973
2962
return ;
@@ -2983,10 +2972,9 @@ void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) {
2983
2972
auto Addr = getLoweredAddress (SILVal).getAddress ();
2984
2973
DebugTypeInfo DbgTy (Decl, Decl->getType (), getTypeInfo (SILVal.getType ()));
2985
2974
// Put the value into a stack slot at -Onone and emit a debug intrinsic.
2986
- emitDebugVariableDeclaration (
2987
- emitShadowCopy (Addr, Name), DbgTy, i->getDebugScope (), Name,
2988
- i->getVarInfo ().getArgNo (),
2989
- getIndirectionForDebugValueAddr (DbgTy.getType ()));
2975
+ emitDebugVariableDeclaration (emitShadowCopy (Addr, Name), DbgTy,
2976
+ i->getDebugScope (), Name,
2977
+ i->getVarInfo ().getArgNo (), IndirectValue);
2990
2978
}
2991
2979
2992
2980
void IRGenSILFunction::visitLoadWeakInst (swift::LoadWeakInst *i) {
@@ -3400,16 +3388,11 @@ void IRGenSILFunction::visitAllocBoxInst(swift::AllocBoxInst *i) {
3400
3388
// arguments.
3401
3389
if (Name == IGM.Context .Id_self .str ())
3402
3390
return ;
3403
- auto Indirection = IndirectValue;
3404
- // LValues and inout args are implicitly indirect because of their type.
3405
- if (Decl->getType ()->getKind () == TypeKind::LValue ||
3406
- Decl->getType ()->getKind () == TypeKind::InOut)
3407
- Indirection = DirectValue;
3408
3391
3409
3392
IGM.DebugInfo ->emitVariableDeclaration (
3410
3393
Builder, emitShadowCopy (addr.getAddress (), Name),
3411
3394
DebugTypeInfo (Decl, i->getElementType ().getSwiftType (), type),
3412
- i->getDebugScope (), Name, 0 , Indirection );
3395
+ i->getDebugScope (), Name, 0 , IndirectValue );
3413
3396
}
3414
3397
}
3415
3398
0 commit comments