summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/IR/Instruction.cpp')
-rw-r--r--llvm/lib/IR/Instruction.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/llvm/lib/IR/Instruction.cpp b/llvm/lib/IR/Instruction.cpp
index e863ef3eb8d6..e0892398f434 100644
--- a/llvm/lib/IR/Instruction.cpp
+++ b/llvm/lib/IR/Instruction.cpp
@@ -161,12 +161,13 @@ void Instruction::insertBefore(BasicBlock &BB,
// maintenence code that you intend the PHI to be ahead of everything,
// including any debug-info.
assert(!isa<PHINode>(this) && "Inserting PHI after debug-records!");
- adoptDbgValues(&BB, InsertPos, false);
+ adoptDbgRecords(&BB, InsertPos, false);
}
}
// If we're inserting a terminator, check if we need to flush out
- // TrailingDPValues.
+ // TrailingDPValues. Inserting instructions at the end of an incomplete
+ // block is handled by the code block above.
if (isTerminator())
getParent()->flushTerminatorDbgValues();
}
@@ -231,7 +232,7 @@ void Instruction::moveBeforeImpl(BasicBlock &BB, InstListType::iterator I,
// If we're inserting at point I, and not in front of the DPValues attached
// there, then we should absorb the DPValues attached to I.
if (!InsertAtHead && NextMarker && !NextMarker->empty()) {
- adoptDbgValues(&BB, I, false);
+ adoptDbgRecords(&BB, I, false);
}
}
@@ -243,7 +244,7 @@ iterator_range<DbgRecord::self_iterator> Instruction::cloneDebugInfoFrom(
const Instruction *From, std::optional<DbgRecord::self_iterator> FromHere,
bool InsertAtHead) {
if (!From->DbgMarker)
- return DPMarker::getEmptyDPValueRange();
+ return DPMarker::getEmptyDbgRecordRange();
assert(getParent()->IsNewDbgInfoFormat);
assert(getParent()->IsNewDbgInfoFormat ==
@@ -269,15 +270,15 @@ Instruction::getDbgReinsertionPosition() {
return NextMarker->StoredDPValues.begin();
}
-bool Instruction::hasDbgValues() const { return !getDbgValueRange().empty(); }
+bool Instruction::hasDbgRecords() const { return !getDbgRecordRange().empty(); }
-void Instruction::adoptDbgValues(BasicBlock *BB, BasicBlock::iterator It,
- bool InsertAtHead) {
+void Instruction::adoptDbgRecords(BasicBlock *BB, BasicBlock::iterator It,
+ bool InsertAtHead) {
DPMarker *SrcMarker = BB->getMarker(It);
auto ReleaseTrailingDPValues = [BB, It, SrcMarker]() {
if (BB->end() == It) {
SrcMarker->eraseFromParent();
- BB->deleteTrailingDPValues();
+ BB->deleteTrailingDbgRecords();
}
};
@@ -313,13 +314,13 @@ void Instruction::adoptDbgValues(BasicBlock *BB, BasicBlock::iterator It,
}
}
-void Instruction::dropDbgValues() {
+void Instruction::dropDbgRecords() {
if (DbgMarker)
- DbgMarker->dropDbgValues();
+ DbgMarker->dropDbgRecords();
}
-void Instruction::dropOneDbgValue(DbgRecord *DPV) {
- DbgMarker->dropOneDbgValue(DPV);
+void Instruction::dropOneDbgRecord(DbgRecord *DPV) {
+ DbgMarker->dropOneDbgRecord(DPV);
}
bool Instruction::comesBefore(const Instruction *Other) const {