@@ -426,10 +426,15 @@ SILValue VariableNameInferrer::findDebugInfoProvidingValueHelper(
426
426
return SILValue ();
427
427
}
428
428
429
- variableNamePath.push_back (allocInst);
429
+ variableNamePath.push_back (DebugVarCarryingInst ( allocInst). getName () );
430
430
return allocInst;
431
431
}
432
432
433
+ if (auto *abi = dyn_cast<AllocBoxInst>(searchValue)) {
434
+ variableNamePath.push_back (DebugVarCarryingInst (abi).getName ());
435
+ return abi;
436
+ }
437
+
433
438
// If we have a store_borrow, always look at the dest. We are going to see
434
439
// if we can determine if dest is a temporary alloc_stack.
435
440
if (auto *sbi = dyn_cast<StoreBorrowInst>(searchValue)) {
@@ -438,7 +443,7 @@ SILValue VariableNameInferrer::findDebugInfoProvidingValueHelper(
438
443
}
439
444
440
445
if (auto *globalAddrInst = dyn_cast<GlobalAddrInst>(searchValue)) {
441
- variableNamePath.push_back (globalAddrInst);
446
+ variableNamePath.push_back (VarDeclCarryingInst ( globalAddrInst). getName () );
442
447
return globalAddrInst;
443
448
}
444
449
@@ -448,7 +453,7 @@ SILValue VariableNameInferrer::findDebugInfoProvidingValueHelper(
448
453
}
449
454
450
455
if (auto *rei = dyn_cast<RefElementAddrInst>(searchValue)) {
451
- variableNamePath.push_back (rei);
456
+ variableNamePath.push_back (VarDeclCarryingInst ( rei). getName () );
452
457
searchValue = rei->getOperand ();
453
458
continue ;
454
459
}
@@ -662,15 +667,6 @@ void VariableNameInferrer::popSingleVariableName() {
662
667
663
668
if (std::holds_alternative<SILInstruction *>(next)) {
664
669
auto *inst = std::get<SILInstruction *>(next);
665
- if (auto i = DebugVarCarryingInst (inst)) {
666
- resultingString += i.getName ();
667
- return ;
668
- }
669
-
670
- if (auto i = VarDeclCarryingInst (inst)) {
671
- resultingString += i.getName ();
672
- return ;
673
- }
674
670
675
671
if (auto f = dyn_cast<FunctionRefBaseInst>(inst)) {
676
672
if (auto dc = f->getInitiallyReferencedFunction ()->getDeclContext ()) {
0 commit comments