aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/IR/DebugInfoTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/unittests/IR/DebugInfoTest.cpp')
-rw-r--r--llvm/unittests/IR/DebugInfoTest.cpp25
1 files changed, 15 insertions, 10 deletions
diff --git a/llvm/unittests/IR/DebugInfoTest.cpp b/llvm/unittests/IR/DebugInfoTest.cpp
index be8f590..65db93e 100644
--- a/llvm/unittests/IR/DebugInfoTest.cpp
+++ b/llvm/unittests/IR/DebugInfoTest.cpp
@@ -955,7 +955,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
FirstInst->DbgMarker->insertDPValue(DPV1, false);
FirstInst->DbgMarker->insertDPValue(DPV2, true);
unsigned int ItCount = 0;
- for (DPValue &Item : FirstInst->DbgMarker->getDbgValueRange()) {
+ for (DbgRecord &Item : FirstInst->DbgMarker->getDbgValueRange()) {
EXPECT_TRUE((&Item == DPV2 && ItCount == 0) ||
(&Item == DPV1 && ItCount == 1));
EXPECT_EQ(Item.getMarker(), FirstInst->DbgMarker);
@@ -968,17 +968,18 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
ItCount = 0;
// Check these things store the same information; but that they're not the same
// objects.
- for (DPValue &Item : RetInst->DbgMarker->getDbgValueRange()) {
+ for (DPValue &Item :
+ DPValue::filter(RetInst->DbgMarker->getDbgValueRange())) {
EXPECT_TRUE((Item.getRawLocation() == DPV2->getRawLocation() && ItCount == 0) ||
(Item.getRawLocation() == DPV1->getRawLocation() && ItCount == 1));
-
+
EXPECT_EQ(Item.getMarker(), RetInst->DbgMarker);
EXPECT_NE(&Item, DPV1);
EXPECT_NE(&Item, DPV2);
++ItCount;
}
- RetInst->DbgMarker->dropDPValues();
+ RetInst->DbgMarker->dropDbgValues();
EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 0u);
// Try cloning one single DPValue.
@@ -987,10 +988,12 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 1u);
// The second DPValue should have been cloned; it should have the same values
// as DPV1.
- EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.begin()->getRawLocation(),
+ EXPECT_EQ(cast<DPValue>(RetInst->DbgMarker->StoredDPValues.begin())
+ ->getRawLocation(),
DPV1->getRawLocation());
// We should be able to drop individual DPValues.
- RetInst->DbgMarker->dropOneDPValue(&*RetInst->DbgMarker->StoredDPValues.begin());
+ RetInst->DbgMarker->dropOneDbgValue(
+ &*RetInst->DbgMarker->StoredDPValues.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.
@@ -998,7 +1001,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
EXPECT_EQ(RetInst->DbgMarker->StoredDPValues.size(), 2u);
// Should be the DPV1 and DPV2 objects.
ItCount = 0;
- for (DPValue &Item : RetInst->DbgMarker->getDbgValueRange()) {
+ for (DbgRecord &Item : RetInst->DbgMarker->getDbgValueRange()) {
EXPECT_TRUE((&Item == DPV2 && ItCount == 0) ||
(&Item == DPV1 && ItCount == 1));
EXPECT_EQ(Item.getMarker(), RetInst->DbgMarker);
@@ -1019,7 +1022,7 @@ TEST(MetadataTest, ConvertDbgToDPValue) {
EXPECT_EQ(EndMarker->StoredDPValues.size(), 2u);
// Test again that it's those two DPValues, DPV1 and DPV2.
ItCount = 0;
- for (DPValue &Item : EndMarker->getDbgValueRange()) {
+ for (DbgRecord &Item : EndMarker->getDbgValueRange()) {
EXPECT_TRUE((&Item == DPV2 && ItCount == 0) ||
(&Item == DPV1 && ItCount == 1));
EXPECT_EQ(Item.getMarker(), EndMarker);
@@ -1110,13 +1113,15 @@ TEST(MetadataTest, DPValueConversionRoutines) {
EXPECT_EQ(SecondInst, SecondInst->DbgMarker->MarkedInstr);
EXPECT_EQ(FirstInst->DbgMarker->StoredDPValues.size(), 1u);
- DPValue *DPV1 = &*FirstInst->DbgMarker->getDbgValueRange().begin();
+ DPValue *DPV1 =
+ cast<DPValue>(&*FirstInst->DbgMarker->getDbgValueRange().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);
- DPValue *DPV2 = &*SecondInst->DbgMarker->getDbgValueRange().begin();
+ DPValue *DPV2 =
+ cast<DPValue>(&*SecondInst->DbgMarker->getDbgValueRange().begin());
EXPECT_EQ(DPV2->getMarker(), SecondInst->DbgMarker);
// Should point at FirstInst.
EXPECT_EQ(DPV2->getVariableLocationOp(0), FirstInst);