1515#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H
1616
1717#include " llvm/BinaryFormat/Dwarf.h"
18- #include " llvm/Config/abi-breaking.h"
1918#include " llvm/DebugInfo/CodeView/CodeView.h"
2019#include " llvm/DebugInfo/CodeView/TypeIndex.h"
2120#include " llvm/DebugInfo/LogicalView/Core/LVSupport.h"
@@ -37,7 +36,7 @@ namespace logicalview {
3736using LVSectionIndex = uint64_t ;
3837using LVAddress = uint64_t ;
3938using LVHalf = uint16_t ;
40- using LVLevel = uint32_t ;
39+ using LVLevel = uint16_t ;
4140using LVOffset = uint64_t ;
4241using LVSigned = int64_t ;
4342using LVUnsigned = uint64_t ;
@@ -130,8 +129,6 @@ class LLVM_ABI LVObject {
130129 HasCodeViewLocation, // CodeView object with debug location.
131130 LastEntry
132131 };
133- // Typed bitvector with properties for this object.
134- LVProperties<Property> Properties;
135132
136133 LVOffset Offset = 0 ;
137134 uint32_t LineNumber = 0 ;
@@ -141,6 +138,14 @@ class LLVM_ABI LVObject {
141138 dwarf::Attribute Attr;
142139 LVSmall Opcode;
143140 } TagAttrOpcode = {dwarf::DW_TAG_null};
141+ // Typed bitvector with properties for this object.
142+ LVProperties<Property> Properties;
143+
144+ // This is an internal ID used for debugging logical elements. It is used
145+ // for cases where an unique offset within the binary input file is not
146+ // available.
147+ static uint32_t GID;
148+ uint32_t ID = 0 ;
144149
145150 // The parent of this object (nullptr if the root scope). For locations,
146151 // the parent is a symbol object; otherwise it is a scope object.
@@ -156,9 +161,7 @@ class LLVM_ABI LVObject {
156161 // copy constructor to create that object; it is used to print a reference
157162 // to another object and in the case of templates, to print its encoded args.
158163 LVObject (const LVObject &Object) {
159- #if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
160164 incID ();
161- #endif
162165 Properties = Object.Properties ;
163166 Offset = Object.Offset ;
164167 LineNumber = Object.LineNumber ;
@@ -167,18 +170,10 @@ class LLVM_ABI LVObject {
167170 Parent = Object.Parent ;
168171 }
169172
170- #if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
171- // This is an internal ID used for debugging logical elements. It is used
172- // for cases where an unique offset within the binary input file is not
173- // available.
174- static uint64_t GID;
175- uint64_t ID = 0 ;
176-
177173 void incID () {
178174 ++GID;
179175 ID = GID;
180176 }
181- #endif
182177
183178protected:
184179 // Get a string representation for the given number and discriminator.
@@ -194,11 +189,7 @@ class LLVM_ABI LVObject {
194189 virtual void printFileIndex (raw_ostream &OS, bool Full = true ) const {}
195190
196191public:
197- LVObject () {
198- #if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
199- incID ();
200- #endif
201- };
192+ LVObject () { incID (); };
202193 LVObject &operator =(const LVObject &) = delete ;
203194 virtual ~LVObject () = default ;
204195
@@ -317,14 +308,7 @@ class LLVM_ABI LVObject {
317308 void dump () const { print (dbgs ()); }
318309#endif
319310
320- uint64_t getID () const {
321- return
322- #if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
323- ID;
324- #else
325- 0 ;
326- #endif
327- }
311+ uint32_t getID () const { return ID; }
328312};
329313
330314} // end namespace logicalview
0 commit comments