1
- // ===-- llvm/DebugProgramInstruction.h - Stream of debug info ------- *- C++ -*-===//
1
+ // ===-- llvm/DebugProgramInstruction.h - Stream of debug info ---*- C++ -*-===//
2
2
//
3
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
4
// See https://llvm.org/LICENSE.txt for license information.
15
15
// %bar = void call @ext(%foo);
16
16
//
17
17
// and all information is stored in the Value / Metadata hierachy defined
18
- // elsewhere in LLVM. In the "DPValue " design, each instruction /may/ have a
19
- // connection with a DPMarker, which identifies a position immediately before the
20
- // instruction, and each DPMarker /may/ then have connections to DPValues which
21
- // record the variable assignment information. To illustrate:
18
+ // elsewhere in LLVM. In the "DbgRecord " design, each instruction /may/ have a
19
+ // connection with a DPMarker, which identifies a position immediately before
20
+ // the instruction, and each DPMarker /may/ then have connections to DbgRecords
21
+ // which record the variable assignment information. To illustrate:
22
22
//
23
23
// %foo = add i32 1, %0
24
24
// ; foo->DbgMarker == nullptr
25
25
// ;; There are no variable assignments / debug records "in front" of
26
26
// ;; the instruction for %foo, therefore it has no DbgMarker.
27
27
// %bar = void call @ext(%foo)
28
28
// ; bar->DbgMarker = {
29
- // ; StoredDPValues = {
29
+ // ; StoredDbgRecords = {
30
30
// ; DPValue(metadata i32 %foo, ...)
31
31
// ; }
32
32
// ; }
@@ -119,7 +119,7 @@ template <typename T> class DbgRecordParamRef {
119
119
// / Base class for non-instruction debug metadata records that have positions
120
120
// / within IR. Features various methods copied across from the Instruction
121
121
// / class to aid ease-of-use. DbgRecords should always be linked into a
122
- // / DPMarker's StoredDPValues list. The marker connects a DbgRecord back to
122
+ // / DPMarker's StoredDbgRecords list. The marker connects a DbgRecord back to
123
123
// / it's position in the BasicBlock.
124
124
// /
125
125
// / We need a discriminator for dyn/isa casts. In order to avoid paying for a
@@ -557,8 +557,8 @@ class DPMarker {
557
557
// / intrinsics. There is a one-to-one relationship between each debug
558
558
// / intrinsic in a block and each DbgRecord once the representation has been
559
559
// / converted, and the ordering is meaningful in the same way.
560
- simple_ilist<DbgRecord> StoredDPValues ;
561
- bool empty () const { return StoredDPValues .empty (); }
560
+ simple_ilist<DbgRecord> StoredDbgRecords ;
561
+ bool empty () const { return StoredDbgRecords .empty (); }
562
562
563
563
const BasicBlock *getParent () const ;
564
564
BasicBlock *getParent ();
@@ -576,54 +576,56 @@ class DPMarker {
576
576
void print (raw_ostream &O, bool IsForDebug = false ) const ;
577
577
void print (raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug) const ;
578
578
579
- // / Produce a range over all the DPValues in this Marker.
579
+ // / Produce a range over all the DbgRecords in this Marker.
580
580
iterator_range<simple_ilist<DbgRecord>::iterator> getDbgRecordRange ();
581
581
iterator_range<simple_ilist<DbgRecord>::const_iterator>
582
582
getDbgRecordRange () const ;
583
- // / Transfer any DPValues from \p Src into this DPMarker. If \p InsertAtHead
584
- // / is true, place them before existing DPValues , otherwise afterwards.
583
+ // / Transfer any DbgRecords from \p Src into this DPMarker. If \p InsertAtHead
584
+ // / is true, place them before existing DbgRecords , otherwise afterwards.
585
585
void absorbDebugValues (DPMarker &Src, bool InsertAtHead);
586
- // / Transfer the DPValues in \p Range from \p Src into this DPMarker. If
587
- // / \p InsertAtHead is true, place them before existing DPValues , otherwise
586
+ // / Transfer the DbgRecords in \p Range from \p Src into this DPMarker. If
587
+ // / \p InsertAtHead is true, place them before existing DbgRecords , otherwise
588
588
// afterwards.
589
589
void absorbDebugValues (iterator_range<DbgRecord::self_iterator> Range,
590
590
DPMarker &Src, bool InsertAtHead);
591
- // / Insert a DPValue into this DPMarker, at the end of the list. If
591
+ // / Insert a DbgRecord into this DPMarker, at the end of the list. If
592
592
// / \p InsertAtHead is true, at the start.
593
593
void insertDbgRecord (DbgRecord *New, bool InsertAtHead);
594
- // / Insert a DPValue prior to a DPValue contained within this marker.
594
+ // / Insert a DbgRecord prior to a DbgRecord contained within this marker.
595
595
void insertDbgRecord (DbgRecord *New, DbgRecord *InsertBefore);
596
- // / Insert a DPValue after a DPValue contained within this marker.
596
+ // / Insert a DbgRecord after a DbgRecord contained within this marker.
597
597
void insertDbgRecordAfter (DbgRecord *New, DbgRecord *InsertAfter);
598
598
// / Clone all DPMarkers from \p From into this marker. There are numerous
599
599
// / options to customise the source/destination, due to gnarliness, see class
600
600
// / comment.
601
- // / \p FromHere If non-null, copy from FromHere to the end of From's DPValues
602
- // / \p InsertAtHead Place the cloned DPValues at the start of StoredDPValues
603
- // / \returns Range over all the newly cloned DPValues
601
+ // / \p FromHere If non-null, copy from FromHere to the end of From's
602
+ // / DbgRecords
603
+ // / \p InsertAtHead Place the cloned DbgRecords at the start of
604
+ // / StoredDbgRecords
605
+ // / \returns Range over all the newly cloned DbgRecords
604
606
iterator_range<simple_ilist<DbgRecord>::iterator>
605
607
cloneDebugInfoFrom (DPMarker *From,
606
608
std::optional<simple_ilist<DbgRecord>::iterator> FromHere,
607
609
bool InsertAtHead = false );
608
- // / Erase all DPValues in this DPMarker.
610
+ // / Erase all DbgRecords in this DPMarker.
609
611
void dropDbgRecords ();
610
612
// / Erase a single DbgRecord from this marker. In an ideal future, we would
611
613
// / never erase an assignment in this way, but it's the equivalent to
612
614
// / erasing a debug intrinsic from a block.
613
615
void dropOneDbgRecord (DbgRecord *DR);
614
616
615
- // / We generally act like all llvm Instructions have a range of DPValues
617
+ // / We generally act like all llvm Instructions have a range of DbgRecords
616
618
// / attached to them, but in reality sometimes we don't allocate the DPMarker
617
- // / to save time and memory, but still have to return ranges of DPValues. When
618
- // / we need to describe such an unallocated DPValue range, use this static
619
- // / markers range instead. This will bite us if someone tries to insert a
620
- // / DPValue in that range, but they should be using the Official (TM) API for
621
- // / that.
619
+ // / to save time and memory, but still have to return ranges of DbgRecords.
620
+ // / When we need to describe such an unallocated DbgRecord range, use this
621
+ // / static markers range instead. This will bite us if someone tries to insert
622
+ // / a DbgRecord in that range, but they should be using the Official (TM) API
623
+ // / for that.
622
624
static DPMarker EmptyDPMarker;
623
625
static iterator_range<simple_ilist<DbgRecord>::iterator>
624
626
getEmptyDbgRecordRange () {
625
- return make_range (EmptyDPMarker.StoredDPValues .end (),
626
- EmptyDPMarker.StoredDPValues .end ());
627
+ return make_range (EmptyDPMarker.StoredDbgRecords .end (),
628
+ EmptyDPMarker.StoredDbgRecords .end ());
627
629
}
628
630
};
629
631
@@ -632,7 +634,7 @@ inline raw_ostream &operator<<(raw_ostream &OS, const DPMarker &Marker) {
632
634
return OS;
633
635
}
634
636
635
- // / Inline helper to return a range of DPValues attached to a marker. It needs
637
+ // / Inline helper to return a range of DbgRecords attached to a marker. It needs
636
638
// / to be inlined as it's frequently called, but also come after the declaration
637
639
// / of DPMarker. Thus: it's pre-declared by users like Instruction, then an
638
640
// / inlineable body defined here.
0 commit comments