aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/IR/DebugInfoTest.cpp
diff options
context:
space:
mode:
authorStephen Tozer <stephen.tozer@sony.com>2024-03-13 16:39:35 +0000
committerGitHub <noreply@github.com>2024-03-13 16:39:35 +0000
commit360da83858655ad8297f3c0467c8c97ebedab5ed (patch)
tree16413b2309b940779276d3db4576ad22a2259c04 /llvm/unittests/IR/DebugInfoTest.cpp
parent69afb9d7875d79fdacaaa2f22b5ee3a06faf5373 (diff)
downloadllvm-360da83858655ad8297f3c0467c8c97ebedab5ed.zip
llvm-360da83858655ad8297f3c0467c8c97ebedab5ed.tar.gz
llvm-360da83858655ad8297f3c0467c8c97ebedab5ed.tar.bz2
[RemoveDI][NFC] Rename DPValue->DbgRecord in comments and varnames (#84939)
This patch continues the ongoing rename work, replacing DPValue with DbgRecord in comments and the names of variables, both members and fn-local. This is the most labour-intensive part of the rename, as it is where the most decisions have to be made about whether a given comment or variable is referring to DPValues (equivalent to debug variable intrinsics) or DbgRecords (a catch-all for all debug intrinsics); these decisions are not individually difficult, but comprise a fairly large amount of text to review. This patch still largely performs basic string substitutions followed by clang-format; there are almost* no places where, for example, a comment has been expanded or modified to reflect the semantic difference between DPValues and DbgRecords. I don't believe such a change is generally necessary in LLVM, but it may be useful in the docs, and so I'll be submitting docs changes as a separate patch. *In a few places, `dbg.values` was replaced with `debug intrinsics`.
Diffstat (limited to 'llvm/unittests/IR/DebugInfoTest.cpp')
-rw-r--r--llvm/unittests/IR/DebugInfoTest.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/llvm/unittests/IR/DebugInfoTest.cpp b/llvm/unittests/IR/DebugInfoTest.cpp
index 0b019c2..4bd11d2 100644
--- a/llvm/unittests/IR/DebugInfoTest.cpp
+++ b/llvm/unittests/IR/DebugInfoTest.cpp
@@ -951,7 +951,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
ExitBlock->createMarker(FirstInst);
ExitBlock->createMarker(RetInst);
- // Insert DPValues into markers, order should come out DPV2, DPV1.
+ // Insert DbgRecords into markers, order should come out DPV2, DPV1.
FirstInst->DbgMarker->insertDbgRecord(DPV1, false);
FirstInst->DbgMarker->insertDbgRecord(DPV2, true);
unsigned int ItCount = 0;
@@ -964,7 +964,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
// Clone them onto the second marker -- should allocate new DPVs.
RetInst->DbgMarker->cloneDebugInfoFrom(FirstInst->DbgMarker, std::nullopt, false);
- EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 2u);
+ EXPECT_EQ(RetInst->DbgMarker->StoredDbgRecords.size(), 2u);
ItCount = 0;
// Check these things store the same information; but that they're not the same
// objects.
@@ -980,25 +980,25 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
}
RetInst->DbgMarker->dropDbgRecords();
- EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 0u);
+ EXPECT_EQ(RetInst->DbgMarker->StoredDbgRecords.size(), 0u);
// Try cloning one single DPValue.
auto DIIt = std::next(FirstInst->DbgMarker->getDbgRecordRange().begin());
RetInst->DbgMarker->cloneDebugInfoFrom(FirstInst->DbgMarker, DIIt, false);
- EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 1u);
+ EXPECT_EQ(RetInst->DbgMarker->StoredDbgRecords.size(), 1u);
// The second DPValue should have been cloned; it should have the same values
// as DPV1.
- EXPECT_EQ(cast<DPValue>(RetInst->DbgMarker->StoredDPValues.begin())
+ EXPECT_EQ(cast<DPValue>(RetInst->DbgMarker->StoredDbgRecords.begin())
->getRawLocation(),
DPV1->getRawLocation());
- // We should be able to drop individual DPValues.
+ // We should be able to drop individual DbgRecords.
RetInst->DbgMarker->dropOneDbgRecord(
- &*RetInst->DbgMarker->StoredDPValues.begin());
+ &*RetInst->DbgMarker->StoredDbgRecords.begin());
// "Aborb" a DPMarker: this means pretend that the instruction it's attached
// to is disappearing so it needs to be transferred into "this" marker.
RetInst->DbgMarker->absorbDebugValues(*FirstInst->DbgMarker, true);
- EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 2u);
+ EXPECT_EQ(RetInst->DbgMarker->StoredDbgRecords.size(), 2u);
// Should be the DPV1 and DPV2 objects.
ItCount = 0;
for (DbgRecord &Item : RetInst->DbgMarker->getDbgRecordRange()) {
@@ -1009,7 +1009,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
}
// Finally -- there are two DPValues left over. If we remove evrything in the
- // basic block, then they should sink down into the "TrailingDPValues"
+ // basic block, then they should sink down into the "TrailingDbgRecords"
// container for dangling debug-info. Future facilities will restore them
// back when a terminator is inserted.
FirstInst->DbgMarker->removeMarker();
@@ -1019,7 +1019,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
DPMarker *EndMarker = ExitBlock->getTrailingDbgRecords();
ASSERT_NE(EndMarker, nullptr);
- EXPECT_EQ(EndMarker->StoredDPValues.size(), 2u);
+ EXPECT_EQ(EndMarker->StoredDbgRecords.size(), 2u);
// Test again that it's those two DPValues, DPV1 and DPV2.
ItCount = 0;
for (DbgRecord &Item : EndMarker->getDbgRecordRange()) {
@@ -1115,14 +1115,14 @@ TEST(MetadataTest, DPValueConversionRoutines) {
EXPECT_EQ(FirstInst, FirstInst->DbgMarker->MarkedInstr);
EXPECT_EQ(SecondInst, SecondInst->DbgMarker->MarkedInstr);
- EXPECT_EQ(FirstInst->DbgMarker->StoredDPValues.size(), 1u);
+ EXPECT_EQ(FirstInst->DbgMarker->StoredDbgRecords.size(), 1u);
DPValue *DPV1 =
cast<DPValue>(&*FirstInst->DbgMarker->getDbgRecordRange().begin());
EXPECT_EQ(DPV1->getMarker(), FirstInst->DbgMarker);
// Should point at %a, an argument.
EXPECT_TRUE(isa<Argument>(DPV1->getVariableLocationOp(0)));
- EXPECT_EQ(SecondInst->DbgMarker->StoredDPValues.size(), 1u);
+ EXPECT_EQ(SecondInst->DbgMarker->StoredDbgRecords.size(), 1u);
DPValue *DPV2 =
cast<DPValue>(&*SecondInst->DbgMarker->getDbgRecordRange().begin());
EXPECT_EQ(DPV2->getMarker(), SecondInst->DbgMarker);
@@ -1135,7 +1135,7 @@ TEST(MetadataTest, DPValueConversionRoutines) {
EXPECT_TRUE(BB2->IsNewDbgInfoFormat);
for (auto &Inst : *BB2)
// Either there should be no marker, or it should be empty.
- EXPECT_TRUE(!Inst.DbgMarker || Inst.DbgMarker->StoredDPValues.empty());
+ EXPECT_TRUE(!Inst.DbgMarker || Inst.DbgMarker->StoredDbgRecords.empty());
// Validating the first block should continue to not be a problem,
Error = verifyModule(*M, &errs(), &BrokenDebugInfo);