15
15
#define LLVM_DEBUGINFO_LOGICALVIEW_CORE_LVOBJECT_H
16
16
17
17
#include " llvm/BinaryFormat/Dwarf.h"
18
- #include " llvm/Config/abi-breaking.h"
19
18
#include " llvm/DebugInfo/CodeView/CodeView.h"
20
19
#include " llvm/DebugInfo/CodeView/TypeIndex.h"
21
20
#include " llvm/DebugInfo/LogicalView/Core/LVSupport.h"
@@ -37,7 +36,7 @@ namespace logicalview {
37
36
using LVSectionIndex = uint64_t ;
38
37
using LVAddress = uint64_t ;
39
38
using LVHalf = uint16_t ;
40
- using LVLevel = uint32_t ;
39
+ using LVLevel = uint16_t ;
41
40
using LVOffset = uint64_t ;
42
41
using LVSigned = int64_t ;
43
42
using LVUnsigned = uint64_t ;
@@ -130,8 +129,6 @@ class LLVM_ABI LVObject {
130
129
HasCodeViewLocation, // CodeView object with debug location.
131
130
LastEntry
132
131
};
133
- // Typed bitvector with properties for this object.
134
- LVProperties<Property> Properties;
135
132
136
133
LVOffset Offset = 0 ;
137
134
uint32_t LineNumber = 0 ;
@@ -141,6 +138,14 @@ class LLVM_ABI LVObject {
141
138
dwarf::Attribute Attr;
142
139
LVSmall Opcode;
143
140
} 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 ;
144
149
145
150
// The parent of this object (nullptr if the root scope). For locations,
146
151
// the parent is a symbol object; otherwise it is a scope object.
@@ -156,9 +161,7 @@ class LLVM_ABI LVObject {
156
161
// copy constructor to create that object; it is used to print a reference
157
162
// to another object and in the case of templates, to print its encoded args.
158
163
LVObject (const LVObject &Object) {
159
- #if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
160
164
incID ();
161
- #endif
162
165
Properties = Object.Properties ;
163
166
Offset = Object.Offset ;
164
167
LineNumber = Object.LineNumber ;
@@ -167,18 +170,10 @@ class LLVM_ABI LVObject {
167
170
Parent = Object.Parent ;
168
171
}
169
172
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
-
177
173
void incID () {
178
174
++GID;
179
175
ID = GID;
180
176
}
181
- #endif
182
177
183
178
protected:
184
179
// Get a string representation for the given number and discriminator.
@@ -194,11 +189,7 @@ class LLVM_ABI LVObject {
194
189
virtual void printFileIndex (raw_ostream &OS, bool Full = true ) const {}
195
190
196
191
public:
197
- LVObject () {
198
- #if !defined(NDEBUG) && LLVM_ENABLE_ABI_BREAKING_CHECKS
199
- incID ();
200
- #endif
201
- };
192
+ LVObject () { incID (); };
202
193
LVObject &operator =(const LVObject &) = delete ;
203
194
virtual ~LVObject () = default ;
204
195
@@ -317,14 +308,7 @@ class LLVM_ABI LVObject {
317
308
void dump () const { print (dbgs ()); }
318
309
#endif
319
310
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; }
328
312
};
329
313
330
314
} // end namespace logicalview
0 commit comments