@@ -82,7 +82,7 @@ template <> struct llvm::DenseMapInfo<VariableID> {
82
82
}
83
83
};
84
84
85
- using VarLocInsertPt = PointerUnion<const Instruction *, const DPValue *>;
85
+ using VarLocInsertPt = PointerUnion<const Instruction *, const DbgRecord *>;
86
86
87
87
namespace std {
88
88
template <> struct hash <VarLocInsertPt> {
@@ -218,14 +218,14 @@ void FunctionVarLocs::init(FunctionVarLocsBuilder &Builder) {
218
218
// block includes VarLocs for any DPValues attached to that instruction.
219
219
for (auto &P : Builder.VarLocsBeforeInst ) {
220
220
// Process VarLocs attached to a DPValue alongside their marker Instruction.
221
- if (isa<const DPValue *>(P.first ))
221
+ if (isa<const DbgRecord *>(P.first ))
222
222
continue ;
223
223
const Instruction *I = cast<const Instruction *>(P.first );
224
224
unsigned BlockStart = VarLocRecords.size ();
225
225
// Any VarLocInfos attached to a DPValue should now be remapped to their
226
226
// marker Instruction, in order of DPValue appearance and prior to any
227
227
// VarLocInfos attached directly to that instruction.
228
- for (const DPValue &DPV : I->getDbgValueRange ()) {
228
+ for (const DPValue &DPV : DPValue::filter ( I->getDbgValueRange () )) {
229
229
// Even though DPV defines a variable location, VarLocsBeforeInst can
230
230
// still be empty if that VarLoc was redundant.
231
231
if (!Builder.VarLocsBeforeInst .count (&DPV))
@@ -829,7 +829,7 @@ class MemLocFragmentFill {
829
829
void process (BasicBlock &BB, VarFragMap &LiveSet) {
830
830
BBInsertBeforeMap[&BB].clear ();
831
831
for (auto &I : BB) {
832
- for (auto &DPV : I.getDbgValueRange ()) {
832
+ for (DPValue &DPV : DPValue::filter ( I.getDbgValueRange () )) {
833
833
if (const auto *Locs = FnVarLocs->getWedge (&DPV)) {
834
834
for (const VarLocInfo &Loc : *Locs) {
835
835
addDef (Loc, &DPV, *I.getParent (), LiveSet);
@@ -1492,7 +1492,7 @@ const char *locStr(AssignmentTrackingLowering::LocKind Loc) {
1492
1492
}
1493
1493
#endif
1494
1494
1495
- VarLocInsertPt getNextNode (const DPValue *DPV) {
1495
+ VarLocInsertPt getNextNode (const DbgRecord *DPV) {
1496
1496
auto NextIt = ++(DPV->getIterator ());
1497
1497
if (NextIt == DPV->getMarker ()->getDbgValueRange ().end ())
1498
1498
return DPV->getMarker ()->MarkedInstr ;
@@ -1507,7 +1507,7 @@ VarLocInsertPt getNextNode(const Instruction *Inst) {
1507
1507
VarLocInsertPt getNextNode (VarLocInsertPt InsertPt) {
1508
1508
if (isa<const Instruction *>(InsertPt))
1509
1509
return getNextNode (cast<const Instruction *>(InsertPt));
1510
- return getNextNode (cast<const DPValue *>(InsertPt));
1510
+ return getNextNode (cast<const DbgRecord *>(InsertPt));
1511
1511
}
1512
1512
1513
1513
DbgAssignIntrinsic *CastToDbgAssign (DbgVariableIntrinsic *DVI) {
@@ -1915,7 +1915,7 @@ void AssignmentTrackingLowering::process(BasicBlock &BB, BlockInfo *LiveSet) {
1915
1915
// attached DPValues, or a non-debug instruction with attached unprocessed
1916
1916
// DPValues.
1917
1917
if (II != EI && II->hasDbgValues ()) {
1918
- for (DPValue &DPV : II->getDbgValueRange ()) {
1918
+ for (DPValue &DPV : DPValue::filter ( II->getDbgValueRange () )) {
1919
1919
resetInsertionPoint (DPV);
1920
1920
processDPValue (DPV, LiveSet);
1921
1921
assert (LiveSet->isValid ());
@@ -2172,7 +2172,7 @@ static AssignmentTrackingLowering::OverlapMap buildOverlapMapAndRecordDeclares(
2172
2172
};
2173
2173
for (auto &BB : Fn) {
2174
2174
for (auto &I : BB) {
2175
- for (auto &DPV : I.getDbgValueRange ())
2175
+ for (DPValue &DPV : DPValue::filter ( I.getDbgValueRange () ))
2176
2176
ProcessDbgRecord (&DPV, DPDeclares);
2177
2177
if (auto *DII = dyn_cast<DbgVariableIntrinsic>(&I)) {
2178
2178
ProcessDbgRecord (DII, InstDeclares);
@@ -2462,7 +2462,7 @@ bool AssignmentTrackingLowering::emitPromotedVarLocs(
2462
2462
for (auto &BB : Fn) {
2463
2463
for (auto &I : BB) {
2464
2464
// Skip instructions other than dbg.values and dbg.assigns.
2465
- for (DPValue &DPV : I.getDbgValueRange ())
2465
+ for (DPValue &DPV : DPValue::filter ( I.getDbgValueRange () ))
2466
2466
if (DPV.isDbgValue () || DPV.isDbgAssign ())
2467
2467
TranslateDbgRecord (&DPV);
2468
2468
auto *DVI = dyn_cast<DbgValueInst>(&I);
@@ -2564,7 +2564,7 @@ removeRedundantDbgLocsUsingBackwardScan(const BasicBlock *BB,
2564
2564
}
2565
2565
};
2566
2566
HandleLocsForWedge (&I);
2567
- for (DPValue &DPV : reverse (I.getDbgValueRange ()))
2567
+ for (DPValue &DPV : reverse (DPValue::filter ( I.getDbgValueRange () )))
2568
2568
HandleLocsForWedge (&DPV);
2569
2569
}
2570
2570
@@ -2629,7 +2629,7 @@ removeRedundantDbgLocsUsingForwardScan(const BasicBlock *BB,
2629
2629
}
2630
2630
};
2631
2631
2632
- for (DPValue &DPV : I.getDbgValueRange ())
2632
+ for (DPValue &DPV : DPValue::filter ( I.getDbgValueRange () ))
2633
2633
HandleLocsForWedge (&DPV);
2634
2634
HandleLocsForWedge (&I);
2635
2635
}
@@ -2715,7 +2715,7 @@ removeUndefDbgLocsFromEntryBlock(const BasicBlock *BB,
2715
2715
Changed = true ;
2716
2716
}
2717
2717
};
2718
- for (DPValue &DPV : I.getDbgValueRange ())
2718
+ for (DPValue &DPV : DPValue::filter ( I.getDbgValueRange () ))
2719
2719
HandleLocsForWedge (&DPV);
2720
2720
HandleLocsForWedge (&I);
2721
2721
}
0 commit comments