16
16
//
17
17
// and all information is stored in the Value / Metadata hierachy defined
18
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
19
+ // connection with a DbgMarker , which identifies a position immediately before
20
+ // the instruction, and each DbgMarker /may/ then have connections to DbgRecords
21
21
// which record the variable assignment information. To illustrate:
22
22
//
23
23
// %foo = add i32 1, %0
24
- // ; foo->DbgMarker == nullptr
24
+ // ; foo->DebugMarker == nullptr
25
25
// ;; There are no variable assignments / debug records "in front" of
26
- // ;; the instruction for %foo, therefore it has no DbgMarker .
26
+ // ;; the instruction for %foo, therefore it has no DebugMarker .
27
27
// %bar = void call @ext(%foo)
28
- // ; bar->DbgMarker = {
28
+ // ; bar->DebugMarker = {
29
29
// ; StoredDbgRecords = {
30
30
// ; DbgVariableRecord(metadata i32 %foo, ...)
31
31
// ; }
32
32
// ; }
33
33
// ;; There is a debug-info record in front of the %bar instruction,
34
- // ;; thus it points at a DPMarker object. That DPMarker contains a
34
+ // ;; thus it points at a DbgMarker object. That DbgMarker contains a
35
35
// ;; DbgVariableRecord in it's ilist, storing the equivalent information
36
36
// to the
37
37
// ;; dbg.value above: the Value, DILocalVariable, etc.
@@ -66,7 +66,7 @@ class DbgVariableIntrinsic;
66
66
class DbgInfoIntrinsic ;
67
67
class DbgLabelInst ;
68
68
class DIAssignID ;
69
- class DPMarker ;
69
+ class DbgMarker ;
70
70
class DbgVariableRecord ;
71
71
class raw_ostream ;
72
72
@@ -120,7 +120,7 @@ template <typename T> class DbgRecordParamRef {
120
120
// / Base class for non-instruction debug metadata records that have positions
121
121
// / within IR. Features various methods copied across from the Instruction
122
122
// / class to aid ease-of-use. DbgRecords should always be linked into a
123
- // / DPMarker 's StoredDbgRecords list. The marker connects a DbgRecord back to
123
+ // / DbgMarker 's StoredDbgRecords list. The marker connects a DbgRecord back to
124
124
// / it's position in the BasicBlock.
125
125
// /
126
126
// / We need a discriminator for dyn/isa casts. In order to avoid paying for a
@@ -134,7 +134,7 @@ template <typename T> class DbgRecordParamRef {
134
134
class DbgRecord : public ilist_node <DbgRecord> {
135
135
public:
136
136
// / Marker that this DbgRecord is linked into.
137
- DPMarker *Marker = nullptr ;
137
+ DbgMarker *Marker = nullptr ;
138
138
// / Subclass discriminator.
139
139
enum Kind : uint8_t { ValueKind, LabelKind };
140
140
@@ -166,10 +166,10 @@ class DbgRecord : public ilist_node<DbgRecord> {
166
166
167
167
Kind getRecordKind () const { return RecordKind; }
168
168
169
- void setMarker (DPMarker *M) { Marker = M; }
169
+ void setMarker (DbgMarker *M) { Marker = M; }
170
170
171
- DPMarker *getMarker () { return Marker; }
172
- const DPMarker *getMarker () const { return Marker; }
171
+ DbgMarker *getMarker () { return Marker; }
172
+ const DbgMarker *getMarker () const { return Marker; }
173
173
174
174
BasicBlock *getBlock ();
175
175
const BasicBlock *getBlock () const ;
@@ -539,7 +539,7 @@ filterDbgVars(iterator_range<simple_ilist<DbgRecord>::iterator> R) {
539
539
}
540
540
541
541
// / Per-instruction record of debug-info. If an Instruction is the position of
542
- // / some debugging information, it points at a DPMarker storing that info. Each
542
+ // / some debugging information, it points at a DbgMarker storing that info. Each
543
543
// / marker points back at the instruction that owns it. Various utilities are
544
544
// / provided for manipulating the DbgRecords contained within this marker.
545
545
// /
@@ -559,9 +559,9 @@ filterDbgVars(iterator_range<simple_ilist<DbgRecord>::iterator> R) {
559
559
// / which we can improve in the future. Additionally, many improvements in the
560
560
// / way that debug-info is stored can be achieved in this class, at a future
561
561
// / date.
562
- class DPMarker {
562
+ class DbgMarker {
563
563
public:
564
- DPMarker () {}
564
+ DbgMarker () {}
565
565
// / Link back to the Instruction that owns this marker. Can be null during
566
566
// / operations that move a marker from one instruction to another.
567
567
Instruction *MarkedInstr = nullptr ;
@@ -585,30 +585,31 @@ class DPMarker {
585
585
void removeFromParent ();
586
586
void eraseFromParent ();
587
587
588
- // / Implement operator<< on DPMarker .
588
+ // / Implement operator<< on DbgMarker .
589
589
void print (raw_ostream &O, bool IsForDebug = false ) const ;
590
590
void print (raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug) const ;
591
591
592
592
// / Produce a range over all the DbgRecords in this Marker.
593
593
iterator_range<simple_ilist<DbgRecord>::iterator> getDbgRecordRange ();
594
594
iterator_range<simple_ilist<DbgRecord>::const_iterator>
595
595
getDbgRecordRange () const ;
596
- // / Transfer any DbgRecords from \p Src into this DPMarker. If \p InsertAtHead
597
- // / is true, place them before existing DbgRecords, otherwise afterwards.
598
- void absorbDebugValues (DPMarker &Src, bool InsertAtHead);
599
- // / Transfer the DbgRecords in \p Range from \p Src into this DPMarker. If
596
+ // / Transfer any DbgRecords from \p Src into this DbgMarker. If \p
597
+ // / InsertAtHead is true, place them before existing DbgRecords, otherwise
598
+ // / afterwards.
599
+ void absorbDebugValues (DbgMarker &Src, bool InsertAtHead);
600
+ // / Transfer the DbgRecords in \p Range from \p Src into this DbgMarker. If
600
601
// / \p InsertAtHead is true, place them before existing DbgRecords, otherwise
601
602
// afterwards.
602
603
void absorbDebugValues (iterator_range<DbgRecord::self_iterator> Range,
603
- DPMarker &Src, bool InsertAtHead);
604
- // / Insert a DbgRecord into this DPMarker , at the end of the list. If
604
+ DbgMarker &Src, bool InsertAtHead);
605
+ // / Insert a DbgRecord into this DbgMarker , at the end of the list. If
605
606
// / \p InsertAtHead is true, at the start.
606
607
void insertDbgRecord (DbgRecord *New, bool InsertAtHead);
607
608
// / Insert a DbgRecord prior to a DbgRecord contained within this marker.
608
609
void insertDbgRecord (DbgRecord *New, DbgRecord *InsertBefore);
609
610
// / Insert a DbgRecord after a DbgRecord contained within this marker.
610
611
void insertDbgRecordAfter (DbgRecord *New, DbgRecord *InsertAfter);
611
- // / Clone all DPMarkers from \p From into this marker. There are numerous
612
+ // / Clone all DbgMarkers from \p From into this marker. There are numerous
612
613
// / options to customise the source/destination, due to gnarliness, see class
613
614
// / comment.
614
615
// / \p FromHere If non-null, copy from FromHere to the end of From's
@@ -617,45 +618,45 @@ class DPMarker {
617
618
// / StoredDbgRecords
618
619
// / \returns Range over all the newly cloned DbgRecords
619
620
iterator_range<simple_ilist<DbgRecord>::iterator>
620
- cloneDebugInfoFrom (DPMarker *From,
621
+ cloneDebugInfoFrom (DbgMarker *From,
621
622
std::optional<simple_ilist<DbgRecord>::iterator> FromHere,
622
623
bool InsertAtHead = false );
623
- // / Erase all DbgRecords in this DPMarker .
624
+ // / Erase all DbgRecords in this DbgMarker .
624
625
void dropDbgRecords ();
625
626
// / Erase a single DbgRecord from this marker. In an ideal future, we would
626
627
// / never erase an assignment in this way, but it's the equivalent to
627
628
// / erasing a debug intrinsic from a block.
628
629
void dropOneDbgRecord (DbgRecord *DR);
629
630
630
631
// / We generally act like all llvm Instructions have a range of DbgRecords
631
- // / attached to them, but in reality sometimes we don't allocate the DPMarker
632
+ // / attached to them, but in reality sometimes we don't allocate the DbgMarker
632
633
// / to save time and memory, but still have to return ranges of DbgRecords.
633
634
// / When we need to describe such an unallocated DbgRecord range, use this
634
635
// / static markers range instead. This will bite us if someone tries to insert
635
636
// / a DbgRecord in that range, but they should be using the Official (TM) API
636
637
// / for that.
637
- static DPMarker EmptyDPMarker ;
638
+ static DbgMarker EmptyDbgMarker ;
638
639
static iterator_range<simple_ilist<DbgRecord>::iterator>
639
640
getEmptyDbgRecordRange () {
640
- return make_range (EmptyDPMarker .StoredDbgRecords .end (),
641
- EmptyDPMarker .StoredDbgRecords .end ());
641
+ return make_range (EmptyDbgMarker .StoredDbgRecords .end (),
642
+ EmptyDbgMarker .StoredDbgRecords .end ());
642
643
}
643
644
};
644
645
645
- inline raw_ostream &operator <<(raw_ostream &OS, const DPMarker &Marker) {
646
+ inline raw_ostream &operator <<(raw_ostream &OS, const DbgMarker &Marker) {
646
647
Marker.print (OS);
647
648
return OS;
648
649
}
649
650
650
651
// / Inline helper to return a range of DbgRecords attached to a marker. It needs
651
652
// / to be inlined as it's frequently called, but also come after the declaration
652
- // / of DPMarker . Thus: it's pre-declared by users like Instruction, then an
653
+ // / of DbgMarker . Thus: it's pre-declared by users like Instruction, then an
653
654
// / inlineable body defined here.
654
655
inline iterator_range<simple_ilist<DbgRecord>::iterator>
655
- getDbgRecordRange (DPMarker *DbgMarker ) {
656
- if (!DbgMarker )
657
- return DPMarker ::getEmptyDbgRecordRange ();
658
- return DbgMarker ->getDbgRecordRange ();
656
+ getDbgRecordRange (DbgMarker *DebugMarker ) {
657
+ if (!DebugMarker )
658
+ return DbgMarker ::getEmptyDbgRecordRange ();
659
+ return DebugMarker ->getDbgRecordRange ();
659
660
}
660
661
661
662
DEFINE_ISA_CONVERSION_FUNCTIONS (DbgRecord, LLVMDbgRecordRef)
0 commit comments