417 changes: 417 additions & 0 deletions llvm/include/llvm/ADT/CoalescingBitVector.h

Large diffs are not rendered by default.

385 changes: 262 additions & 123 deletions llvm/lib/CodeGen/LiveDebugValues.cpp

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion llvm/test/DebugInfo/MIR/X86/entry-values-diamond-bbs.mir
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# block structure relevant to the debug entry values propagation.
#
# CHECK: ![[ARG_B:.*]] = !DILocalVariable(name: "b"
# CHECK: ![[ARG_C:.*]] = !DILocalVariable(name: "c"
# CHECK: ![[ARG_Q:.*]] = !DILocalVariable(name: "q"
# CHECK: bb.0.entry
# CHECK: DBG_VALUE $esi, $noreg, ![[ARG_B]], !DIExpression()
# CHECK: bb.1.if.then
Expand All @@ -21,8 +23,9 @@
# CHECK-NEXT: $ebx = MOV32ri 2
# CHECK-NEXT: DBG_VALUE $esi, $noreg, ![[ARG_B]], !DIExpression(DW_OP_LLVM_entry_value, 1)
# CHECK: bb.3.if.end
# CHECK-NEXT: DBG_VALUE $edx, $noreg, ![[ARG_Q]], !DIExpression()
# CHECK-NEXT: DBG_VALUE $ebp, $noreg, ![[ARG_C]], !DIExpression()
# CHECK-NEXT: DBG_VALUE $esi, $noreg, ![[ARG_B]], !DIExpression(DW_OP_LLVM_entry_value, 1)
#
--- |
; ModuleID = 'test.c'
source_filename = "test.c"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# Verify that DW_OP_LLVM_entry_values are generated for parameters with multiple
# DBG_VALUEs at entry block.
# CHECK: DBG_VALUE $edi, $noreg, !{{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}}
# CHECK: DBG_VALUE $edx, $noreg, !{{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}}
# CHECK: DBG_VALUE $esi, $noreg, !{{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}}
# CHECK: DBG_VALUE $edx, $noreg, !{{.*}}, !DIExpression(DW_OP_LLVM_entry_value, 1), debug-location {{.*}}

--- |
; ModuleID = 'multiple-param-dbg-value-entry.ll'
Expand Down
1 change: 1 addition & 0 deletions llvm/unittests/ADT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ add_llvm_unittest(ADTTests
BitVectorTest.cpp
BreadthFirstIteratorTest.cpp
BumpPtrListTest.cpp
CoalescingBitVectorTest.cpp
DAGDeltaAlgorithmTest.cpp
DeltaAlgorithmTest.cpp
DenseMapTest.cpp
Expand Down
484 changes: 484 additions & 0 deletions llvm/unittests/ADT/CoalescingBitVectorTest.cpp

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions llvm/unittests/ADT/IntervalMapTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ TEST(IntervalMapTest, EmptyMap) {
EXPECT_TRUE(I2 == CI);
}

// Test one-element closed ranges.
TEST(IntervalMapTest, OneElementRanges) {
UUMap::Allocator allocator;
UUMap map(allocator);
map.insert(1, 1, 1);
map.insert(2, 2, 2);
EXPECT_EQ(1u, map.lookup(1));
EXPECT_EQ(2u, map.lookup(2));
}

// Single entry map tests
TEST(IntervalMapTest, SingleEntryMap) {
UUMap::Allocator allocator;
Expand Down