1616//
1717// and all information is stored in the Value / Metadata hierachy defined
1818// 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
2121// which record the variable assignment information. To illustrate:
2222//
2323// %foo = add i32 1, %0
24- // ; foo->DbgMarker == nullptr
24+ // ; foo->DebugMarker == nullptr
2525// ;; 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 .
2727// %bar = void call @ext(%foo)
28- // ; bar->DbgMarker = {
28+ // ; bar->DebugMarker = {
2929// ; StoredDbgRecords = {
3030// ; DbgVariableRecord(metadata i32 %foo, ...)
3131// ; }
3232// ; }
3333// ;; 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
3535// ;; DbgVariableRecord in it's ilist, storing the equivalent information
3636// to the
3737// ;; dbg.value above: the Value, DILocalVariable, etc.
@@ -66,7 +66,7 @@ class DbgVariableIntrinsic;
6666class DbgInfoIntrinsic ;
6767class DbgLabelInst ;
6868class DIAssignID ;
69- class DPMarker ;
69+ class DbgMarker ;
7070class DbgVariableRecord ;
7171class raw_ostream ;
7272
@@ -120,7 +120,7 @@ template <typename T> class DbgRecordParamRef {
120120// / Base class for non-instruction debug metadata records that have positions
121121// / within IR. Features various methods copied across from the Instruction
122122// / 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
124124// / it's position in the BasicBlock.
125125// /
126126// / We need a discriminator for dyn/isa casts. In order to avoid paying for a
@@ -134,7 +134,7 @@ template <typename T> class DbgRecordParamRef {
134134class DbgRecord : public ilist_node <DbgRecord> {
135135public:
136136 // / Marker that this DbgRecord is linked into.
137- DPMarker *Marker = nullptr ;
137+ DbgMarker *Marker = nullptr ;
138138 // / Subclass discriminator.
139139 enum Kind : uint8_t { ValueKind, LabelKind };
140140
@@ -166,10 +166,10 @@ class DbgRecord : public ilist_node<DbgRecord> {
166166
167167 Kind getRecordKind () const { return RecordKind; }
168168
169- void setMarker (DPMarker *M) { Marker = M; }
169+ void setMarker (DbgMarker *M) { Marker = M; }
170170
171- DPMarker *getMarker () { return Marker; }
172- const DPMarker *getMarker () const { return Marker; }
171+ DbgMarker *getMarker () { return Marker; }
172+ const DbgMarker *getMarker () const { return Marker; }
173173
174174 BasicBlock *getBlock ();
175175 const BasicBlock *getBlock () const ;
@@ -539,7 +539,7 @@ filterDbgVars(iterator_range<simple_ilist<DbgRecord>::iterator> R) {
539539}
540540
541541// / 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
543543// / marker points back at the instruction that owns it. Various utilities are
544544// / provided for manipulating the DbgRecords contained within this marker.
545545// /
@@ -559,9 +559,9 @@ filterDbgVars(iterator_range<simple_ilist<DbgRecord>::iterator> R) {
559559// / which we can improve in the future. Additionally, many improvements in the
560560// / way that debug-info is stored can be achieved in this class, at a future
561561// / date.
562- class DPMarker {
562+ class DbgMarker {
563563public:
564- DPMarker () {}
564+ DbgMarker () {}
565565 // / Link back to the Instruction that owns this marker. Can be null during
566566 // / operations that move a marker from one instruction to another.
567567 Instruction *MarkedInstr = nullptr ;
@@ -585,30 +585,31 @@ class DPMarker {
585585 void removeFromParent ();
586586 void eraseFromParent ();
587587
588- // / Implement operator<< on DPMarker .
588+ // / Implement operator<< on DbgMarker .
589589 void print (raw_ostream &O, bool IsForDebug = false ) const ;
590590 void print (raw_ostream &ROS, ModuleSlotTracker &MST, bool IsForDebug) const ;
591591
592592 // / Produce a range over all the DbgRecords in this Marker.
593593 iterator_range<simple_ilist<DbgRecord>::iterator> getDbgRecordRange ();
594594 iterator_range<simple_ilist<DbgRecord>::const_iterator>
595595 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
600601 // / \p InsertAtHead is true, place them before existing DbgRecords, otherwise
601602 // afterwards.
602603 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
605606 // / \p InsertAtHead is true, at the start.
606607 void insertDbgRecord (DbgRecord *New, bool InsertAtHead);
607608 // / Insert a DbgRecord prior to a DbgRecord contained within this marker.
608609 void insertDbgRecord (DbgRecord *New, DbgRecord *InsertBefore);
609610 // / Insert a DbgRecord after a DbgRecord contained within this marker.
610611 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
612613 // / options to customise the source/destination, due to gnarliness, see class
613614 // / comment.
614615 // / \p FromHere If non-null, copy from FromHere to the end of From's
@@ -617,45 +618,45 @@ class DPMarker {
617618 // / StoredDbgRecords
618619 // / \returns Range over all the newly cloned DbgRecords
619620 iterator_range<simple_ilist<DbgRecord>::iterator>
620- cloneDebugInfoFrom (DPMarker *From,
621+ cloneDebugInfoFrom (DbgMarker *From,
621622 std::optional<simple_ilist<DbgRecord>::iterator> FromHere,
622623 bool InsertAtHead = false );
623- // / Erase all DbgRecords in this DPMarker .
624+ // / Erase all DbgRecords in this DbgMarker .
624625 void dropDbgRecords ();
625626 // / Erase a single DbgRecord from this marker. In an ideal future, we would
626627 // / never erase an assignment in this way, but it's the equivalent to
627628 // / erasing a debug intrinsic from a block.
628629 void dropOneDbgRecord (DbgRecord *DR);
629630
630631 // / 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
632633 // / to save time and memory, but still have to return ranges of DbgRecords.
633634 // / When we need to describe such an unallocated DbgRecord range, use this
634635 // / static markers range instead. This will bite us if someone tries to insert
635636 // / a DbgRecord in that range, but they should be using the Official (TM) API
636637 // / for that.
637- static DPMarker EmptyDPMarker ;
638+ static DbgMarker EmptyDbgMarker ;
638639 static iterator_range<simple_ilist<DbgRecord>::iterator>
639640 getEmptyDbgRecordRange () {
640- return make_range (EmptyDPMarker .StoredDbgRecords .end (),
641- EmptyDPMarker .StoredDbgRecords .end ());
641+ return make_range (EmptyDbgMarker .StoredDbgRecords .end (),
642+ EmptyDbgMarker .StoredDbgRecords .end ());
642643 }
643644};
644645
645- inline raw_ostream &operator <<(raw_ostream &OS, const DPMarker &Marker) {
646+ inline raw_ostream &operator <<(raw_ostream &OS, const DbgMarker &Marker) {
646647 Marker.print (OS);
647648 return OS;
648649}
649650
650651// / Inline helper to return a range of DbgRecords attached to a marker. It needs
651652// / 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
653654// / inlineable body defined here.
654655inline 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 ();
659660}
660661
661662DEFINE_ISA_CONVERSION_FUNCTIONS (DbgRecord, LLVMDbgRecordRef)
0 commit comments