@@ -2943,7 +2943,7 @@ void IRGenSILFunction::visitDebugValueInst(DebugValueInst *i) {
2943
2943
if (isa<SILUndef>(SILVal))
2944
2944
return ;
2945
2945
2946
- StringRef Name = Decl-> getNameStr () ;
2946
+ StringRef Name = i-> getVarInfo (). Name ;
2947
2947
Explosion e = getLoweredExplosion (SILVal);
2948
2948
DebugTypeInfo DbgTy (Decl, Decl->getType (), getTypeInfo (SILVal.getType ()));
2949
2949
// An inout/lvalue type that is described by a debug value has been
@@ -2968,7 +2968,7 @@ void IRGenSILFunction::visitDebugValueAddrInst(DebugValueAddrInst *i) {
2968
2968
if (isa<SILUndef>(SILVal))
2969
2969
return ;
2970
2970
2971
- StringRef Name = Decl-> getName ().str () ;
2971
+ StringRef Name = i-> getVarInfo ().Name ;
2972
2972
auto Addr = getLoweredAddress (SILVal).getAddress ();
2973
2973
DebugTypeInfo DbgTy (Decl, Decl->getType (), getTypeInfo (SILVal.getType ()));
2974
2974
// Put the value into a stack slot at -Onone and emit a debug intrinsic.
@@ -3229,7 +3229,7 @@ static void emitDebugDeclarationForAllocStack(IRGenSILFunction &IGF,
3229
3229
// is stored in the alloca, emitting it as a reference type would
3230
3230
// be wrong.
3231
3231
DbgTy.unwrapLValueOrInOutType ();
3232
- auto Name = Decl-> getName ().empty () ? " _" : Decl-> getName ().str () ;
3232
+ auto Name = i-> getVarInfo ().Name . empty () ? " _" : i-> getVarInfo ().Name ;
3233
3233
auto DS = i->getDebugScope ();
3234
3234
if (DS) {
3235
3235
assert (DS->SILFn == IGF.CurSILFn || DS->InlinedCallSite );
@@ -3245,12 +3245,11 @@ void IRGenSILFunction::visitAllocStackInst(swift::AllocStackInst *i) {
3245
3245
3246
3246
// Derive name from SIL location.
3247
3247
VarDecl *Decl = i->getDecl ();
3248
- StringRef dbgname =
3248
+ StringRef dbgname;
3249
3249
# ifndef NDEBUG
3250
- // If this is a DEBUG build, use pretty names for the LLVM IR.
3251
- Decl ? Decl-> getNameStr () :
3250
+ // If this is a DEBUG build, use pretty names for the LLVM IR.
3251
+ dbgname = i-> getVarInfo (). Name ;
3252
3252
# endif
3253
- " " ;
3254
3253
3255
3254
(void ) Decl;
3256
3255
// If a dynamic alloc_stack is immediately initialized by a copy_addr
@@ -3363,7 +3362,7 @@ void IRGenSILFunction::visitAllocBoxInst(swift::AllocBoxInst *i) {
3363
3362
3364
3363
// Derive name from SIL location.
3365
3364
VarDecl *Decl = i->getDecl ();
3366
- StringRef Name = Decl ? Decl-> getName ().str () : " " ;
3365
+ StringRef Name = i-> getVarInfo ().Name ;
3367
3366
StringRef DbgName =
3368
3367
# ifndef NDEBUG
3369
3368
// If this is a DEBUG build, use pretty names for the LLVM IR.
0 commit comments