aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2024-03-12 14:53:13 +0000
committerGitHub <noreply@github.com>2024-03-12 14:53:13 +0000
commit15f3f446c504d1bb85282fb3bd98db6eab69829d (patch)
tree2f4e67587df9d3911c179bcddfd9d45655cf6fcc /llvm/lib/Transforms/Utils/Local.cpp
parent0aefd702f6c5346f216d29c704c4d0e4ec7397ac (diff)
downloadllvm-15f3f446c504d1bb85282fb3bd98db6eab69829d.zip
llvm-15f3f446c504d1bb85282fb3bd98db6eab69829d.tar.gz
llvm-15f3f446c504d1bb85282fb3bd98db6eab69829d.tar.bz2
[RemoveDIs][NFC] Rename common interface functions for DPValues->DbgRecords (#84793)
As part of the effort to rename the DbgRecord classes, this patch renames the widely-used functions that operate on DbgRecords but refer to DbgValues or DPValues in their names to refer to DbgRecords instead; all such functions are defined in one of `BasicBlock.h`, `Instruction.h`, and `DebugProgramInstruction.h`. This patch explicitly does not change the names of any comments or variables, except for where they use the exact name of one of the renamed functions. The reason for this is reviewability; this patch can be trivially examined to determine that the only changes are direct string substitutions and any results from clang-format responding to the changed line lengths. Future patches will cover renaming variables and comments, and then renaming the classes themselves.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index a44536e..7b74caa 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1657,7 +1657,7 @@ static void insertDbgValueOrDPValue(DIBuilder &Builder, Value *DV,
// DPValue directly instead of a dbg.value intrinsic.
ValueAsMetadata *DVAM = ValueAsMetadata::get(DV);
DPValue *DV = new DPValue(DVAM, DIVar, DIExpr, NewLoc.get());
- Instr->getParent()->insertDPValueBefore(DV, Instr);
+ Instr->getParent()->insertDbgRecordBefore(DV, Instr);
}
}
@@ -1675,7 +1675,7 @@ static void insertDbgValueOrDPValueAfter(DIBuilder &Builder, Value *DV,
// DPValue directly instead of a dbg.value intrinsic.
ValueAsMetadata *DVAM = ValueAsMetadata::get(DV);
DPValue *DV = new DPValue(DVAM, DIVar, DIExpr, NewLoc.get());
- Instr->getParent()->insertDPValueAfter(DV, &*Instr);
+ Instr->getParent()->insertDbgRecordAfter(DV, &*Instr);
}
}
@@ -1794,7 +1794,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DPValue *DPV, StoreInst *SI,
DV = UndefValue::get(DV->getType());
ValueAsMetadata *DVAM = ValueAsMetadata::get(DV);
DPValue *NewDPV = new DPValue(DVAM, DIVar, DIExpr, NewLoc.get());
- SI->getParent()->insertDPValueBefore(NewDPV, SI->getIterator());
+ SI->getParent()->insertDbgRecordBefore(NewDPV, SI->getIterator());
}
/// Inserts a llvm.dbg.value intrinsic after a phi that has an associated
@@ -1856,7 +1856,7 @@ void llvm::ConvertDebugDeclareToDebugValue(DPValue *DPV, LoadInst *LI,
// Create a DPValue directly and insert.
ValueAsMetadata *LIVAM = ValueAsMetadata::get(LI);
DPValue *DV = new DPValue(LIVAM, DIVar, DIExpr, NewLoc.get());
- LI->getParent()->insertDPValueAfter(DV, LI);
+ LI->getParent()->insertDbgRecordAfter(DV, LI);
}
/// Determine whether this alloca is either a VLA or an array.
@@ -1911,7 +1911,7 @@ bool llvm::LowerDbgDeclare(Function &F) {
for (Instruction &BI : FI) {
if (auto *DDI = dyn_cast<DbgDeclareInst>(&BI))
Dbgs.push_back(DDI);
- for (DPValue &DPV : DPValue::filter(BI.getDbgValueRange())) {
+ for (DPValue &DPV : DPValue::filter(BI.getDbgRecordRange())) {
if (DPV.getType() == DPValue::LocationType::Declare)
DPVs.push_back(&DPV);
}
@@ -1996,7 +1996,7 @@ static void insertDPValuesForPHIs(BasicBlock *BB,
// Map existing PHI nodes to their DPValues.
DenseMap<Value *, DPValue *> DbgValueMap;
for (auto &I : *BB) {
- for (DPValue &DPV : DPValue::filter(I.getDbgValueRange())) {
+ for (DPValue &DPV : DPValue::filter(I.getDbgRecordRange())) {
for (Value *V : DPV.location_ops())
if (auto *Loc = dyn_cast_or_null<PHINode>(V))
DbgValueMap.insert({Loc, &DPV});
@@ -2044,7 +2044,7 @@ static void insertDPValuesForPHIs(BasicBlock *BB,
auto InsertionPt = Parent->getFirstInsertionPt();
assert(InsertionPt != Parent->end() && "Ill-formed basic block");
- Parent->insertDPValueBefore(NewDbgII, InsertionPt);
+ Parent->insertDbgRecordBefore(NewDbgII, InsertionPt);
}
}
@@ -2620,7 +2620,7 @@ static bool rewriteDebugUsers(
LLVM_DEBUG(dbgs() << "MOVE: " << *DPV << '\n');
DPV->removeFromParent();
// Ensure there's a marker.
- DomPoint.getParent()->insertDPValueAfter(DPV, &DomPoint);
+ DomPoint.getParent()->insertDbgRecordAfter(DPV, &DomPoint);
Changed = true;
} else if (!DT.dominates(&DomPoint, MarkedInstr)) {
UndefOrSalvageDPV.insert(DPV);
@@ -2766,7 +2766,7 @@ bool llvm::handleUnreachableTerminator(
Instruction *I, SmallVectorImpl<Value *> &PoisonedValues) {
bool Changed = false;
// RemoveDIs: erase debug-info on this instruction manually.
- I->dropDbgValues();
+ I->dropDbgRecords();
for (Use &U : I->operands()) {
Value *Op = U.get();
if (isa<Instruction>(Op) && !Op->getType()->isTokenTy()) {
@@ -2797,7 +2797,7 @@ llvm::removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB) {
if (Inst->isEHPad() || Inst->getType()->isTokenTy()) {
// EHPads can't have DPValues attached to them, but it might be possible
// for things with token type.
- Inst->dropDbgValues();
+ Inst->dropDbgRecords();
EndInst = Inst;
continue;
}
@@ -2806,7 +2806,7 @@ llvm::removeAllNonTerminatorAndEHPadInstructions(BasicBlock *BB) {
else
++NumDeadInst;
// RemoveDIs: erasing debug-info must be done manually.
- Inst->dropDbgValues();
+ Inst->dropDbgRecords();
Inst->eraseFromParent();
}
return {NumDeadInst, NumDeadDbgInst};
@@ -3582,7 +3582,7 @@ void llvm::hoistAllInstructionsInto(BasicBlock *DomBlock, Instruction *InsertPt,
if (I->isUsedByMetadata())
dropDebugUsers(*I);
// RemoveDIs: drop debug-info too as the following code does.
- I->dropDbgValues();
+ I->dropDbgRecords();
if (I->isDebugOrPseudoInst()) {
// Remove DbgInfo and pseudo probe Intrinsics.
II = I->eraseFromParent();