@@ -128,6 +128,8 @@ class DITypeRefArray {
128
128
// / A metadata node with a DWARF tag (i.e., a constant named \c DW_TAG_*,
129
129
// / defined in llvm/BinaryFormat/Dwarf.h). Called \a DINode because it's
130
130
// / potentially used for non-DWARF output.
131
+ // /
132
+ // / Uses the SubclassData16 Metadata slot.
131
133
class DINode : public MDNode {
132
134
friend class LLVMContextImpl ;
133
135
friend class MDNode ;
@@ -227,6 +229,8 @@ class DINode : public MDNode {
227
229
// / (possibly empty) null-separated \a MDString header that contains arbitrary
228
230
// / fields. The remaining operands are \a dwarf_operands(), and are pointers
229
231
// / to other metadata.
232
+ // /
233
+ // / Uses the SubclassData32 Metadata slot.
230
234
class GenericDINode : public DINode {
231
235
friend class LLVMContextImpl ;
232
236
friend class MDNode ;
@@ -695,12 +699,13 @@ std::optional<StringRef> DIScope::getSource() const {
695
699
// / TODO: Remove the hardcoded name and context, since many types don't use
696
700
// / them.
697
701
// / TODO: Split up flags.
702
+ // /
703
+ // / Uses the SubclassData32 Metadata slot.
698
704
class DIType : public DIScope {
699
705
unsigned Line;
700
706
DIFlags Flags;
701
707
uint64_t SizeInBits;
702
708
uint64_t OffsetInBits;
703
- uint32_t AlignInBits;
704
709
705
710
protected:
706
711
DIType (LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
@@ -716,7 +721,7 @@ class DIType : public DIScope {
716
721
this ->Line = Line;
717
722
this ->Flags = Flags;
718
723
this ->SizeInBits = SizeInBits;
719
- this ->AlignInBits = AlignInBits;
724
+ this ->SubclassData32 = AlignInBits;
720
725
this ->OffsetInBits = OffsetInBits;
721
726
}
722
727
@@ -735,7 +740,7 @@ class DIType : public DIScope {
735
740
736
741
unsigned getLine () const { return Line; }
737
742
uint64_t getSizeInBits () const { return SizeInBits; }
738
- uint32_t getAlignInBits () const { return AlignInBits ; }
743
+ uint32_t getAlignInBits () const { return SubclassData32 ; }
739
744
uint32_t getAlignInBytes () const { return getAlignInBits () / CHAR_BIT; }
740
745
uint64_t getOffsetInBits () const { return OffsetInBits; }
741
746
DIFlags getFlags () const { return Flags; }
@@ -1389,13 +1394,13 @@ class DICompileUnit : public DIScope {
1389
1394
1390
1395
private:
1391
1396
unsigned SourceLanguage;
1392
- bool IsOptimized;
1393
1397
unsigned RuntimeVersion;
1394
- unsigned EmissionKind;
1395
1398
uint64_t DWOId;
1399
+ unsigned EmissionKind;
1400
+ unsigned NameTableKind;
1401
+ bool IsOptimized;
1396
1402
bool SplitDebugInlining;
1397
1403
bool DebugInfoForProfiling;
1398
- unsigned NameTableKind;
1399
1404
bool RangesBaseAddress;
1400
1405
1401
1406
DICompileUnit (LLVMContext &C, StorageType Storage, unsigned SourceLanguage,
@@ -1876,6 +1881,10 @@ class DISubprogram : public DILocalScope {
1876
1881
// / Debug location.
1877
1882
// /
1878
1883
// / A debug location in source code, used for debug info and otherwise.
1884
+ // /
1885
+ // / Uses the SubclassData1, SubclassData16 and SubclassData32
1886
+ // / Metadata slots.
1887
+
1879
1888
class DILocation : public MDNode {
1880
1889
friend class LLVMContextImpl ;
1881
1890
friend class MDNode ;
@@ -2161,17 +2170,20 @@ class DILexicalBlockBase : public DILocalScope {
2161
2170
}
2162
2171
};
2163
2172
2173
+ // / Debug lexical block.
2174
+ // /
2175
+ // / Uses the SubclassData32 Metadata slot.
2164
2176
class DILexicalBlock : public DILexicalBlockBase {
2165
2177
friend class LLVMContextImpl ;
2166
2178
friend class MDNode ;
2167
2179
2168
- unsigned Line;
2169
2180
uint16_t Column;
2170
2181
2171
2182
DILexicalBlock (LLVMContext &C, StorageType Storage, unsigned Line,
2172
2183
unsigned Column, ArrayRef<Metadata *> Ops)
2173
- : DILexicalBlockBase(C, DILexicalBlockKind, Storage, Ops), Line(Line),
2184
+ : DILexicalBlockBase(C, DILexicalBlockKind, Storage, Ops),
2174
2185
Column (Column) {
2186
+ SubclassData32 = Line;
2175
2187
assert (Column < (1u << 16 ) && " Expected 16-bit column" );
2176
2188
}
2177
2189
~DILexicalBlock () = default ;
@@ -2206,7 +2218,7 @@ class DILexicalBlock : public DILexicalBlockBase {
2206
2218
2207
2219
TempDILexicalBlock clone() const { return cloneImpl (); }
2208
2220
2209
- unsigned getLine () const { return Line ; }
2221
+ unsigned getLine () const { return SubclassData32 ; }
2210
2222
unsigned getColumn () const { return Column; }
2211
2223
2212
2224
static bool classof (const Metadata *MD) {
@@ -2218,12 +2230,11 @@ class DILexicalBlockFile : public DILexicalBlockBase {
2218
2230
friend class LLVMContextImpl ;
2219
2231
friend class MDNode ;
2220
2232
2221
- unsigned Discriminator;
2222
-
2223
2233
DILexicalBlockFile (LLVMContext &C, StorageType Storage,
2224
2234
unsigned Discriminator, ArrayRef<Metadata *> Ops)
2225
- : DILexicalBlockBase(C, DILexicalBlockFileKind, Storage, Ops),
2226
- Discriminator (Discriminator) {}
2235
+ : DILexicalBlockBase(C, DILexicalBlockFileKind, Storage, Ops) {
2236
+ SubclassData32 = Discriminator;
2237
+ }
2227
2238
~DILexicalBlockFile () = default ;
2228
2239
2229
2240
static DILexicalBlockFile *getImpl (LLVMContext &Context, DILocalScope *Scope,
@@ -2255,7 +2266,7 @@ class DILexicalBlockFile : public DILexicalBlockBase {
2255
2266
(Scope, File, Discriminator))
2256
2267
2257
2268
TempDILexicalBlockFile clone () const { return cloneImpl (); }
2258
- unsigned getDiscriminator () const { return Discriminator ; }
2269
+ unsigned getDiscriminator () const { return SubclassData32 ; }
2259
2270
2260
2271
static bool classof (const Metadata *MD) {
2261
2272
return MD->getMetadataID () == DILexicalBlockFileKind;
@@ -2338,12 +2349,13 @@ DILocation::cloneByMultiplyingDuplicationFactor(unsigned DF) const {
2338
2349
return std::nullopt;
2339
2350
}
2340
2351
2352
+ // / Debug lexical block.
2353
+ // /
2354
+ // / Uses the SubclassData1 Metadata slot.
2341
2355
class DINamespace : public DIScope {
2342
2356
friend class LLVMContextImpl ;
2343
2357
friend class MDNode ;
2344
2358
2345
- unsigned ExportSymbols : 1 ;
2346
-
2347
2359
DINamespace (LLVMContext &Context, StorageType Storage, bool ExportSymbols,
2348
2360
ArrayRef<Metadata *> Ops);
2349
2361
~DINamespace () = default ;
@@ -2373,7 +2385,7 @@ class DINamespace : public DIScope {
2373
2385
2374
2386
TempDINamespace clone () const { return cloneImpl (); }
2375
2387
2376
- bool getExportSymbols () const { return ExportSymbols ; }
2388
+ bool getExportSymbols () const { return SubclassData1 ; }
2377
2389
DIScope *getScope () const { return cast_or_null<DIScope>(getRawScope ()); }
2378
2390
StringRef getName () const { return getStringOperand (2 ); }
2379
2391
@@ -2387,11 +2399,11 @@ class DINamespace : public DIScope {
2387
2399
2388
2400
// / Represents a module in the programming language, for example, a Clang
2389
2401
// / module, or a Fortran module.
2402
+ // /
2403
+ // / Uses the SubclassData1 and SubclassData32 Metadata slots.
2390
2404
class DIModule : public DIScope {
2391
2405
friend class LLVMContextImpl ;
2392
2406
friend class MDNode ;
2393
- unsigned LineNo;
2394
- bool IsDecl;
2395
2407
2396
2408
DIModule (LLVMContext &Context, StorageType Storage, unsigned LineNo,
2397
2409
bool IsDecl, ArrayRef<Metadata *> Ops);
@@ -2443,8 +2455,8 @@ class DIModule : public DIScope {
2443
2455
StringRef getConfigurationMacros () const { return getStringOperand (3 ); }
2444
2456
StringRef getIncludePath () const { return getStringOperand (4 ); }
2445
2457
StringRef getAPINotesFile () const { return getStringOperand (5 ); }
2446
- unsigned getLineNo () const { return LineNo ; }
2447
- bool getIsDecl () const { return IsDecl ; }
2458
+ unsigned getLineNo () const { return SubclassData32 ; }
2459
+ bool getIsDecl () const { return SubclassData1 ; }
2448
2460
2449
2461
Metadata *getRawScope () const { return getOperand (1 ); }
2450
2462
MDString *getRawName () const { return getOperandAs<MDString>(2 ); }
@@ -2460,13 +2472,15 @@ class DIModule : public DIScope {
2460
2472
};
2461
2473
2462
2474
// / Base class for template parameters.
2475
+ // /
2476
+ // / Uses the SubclassData1 Metadata slot.
2463
2477
class DITemplateParameter : public DINode {
2464
2478
protected:
2465
- bool IsDefault;
2466
-
2467
2479
DITemplateParameter (LLVMContext &Context, unsigned ID, StorageType Storage,
2468
2480
unsigned Tag, bool IsDefault, ArrayRef<Metadata *> Ops)
2469
- : DINode(Context, ID, Storage, Tag, Ops), IsDefault(IsDefault) {}
2481
+ : DINode(Context, ID, Storage, Tag, Ops) {
2482
+ SubclassData1 = IsDefault;
2483
+ }
2470
2484
~DITemplateParameter () = default ;
2471
2485
2472
2486
public:
@@ -2475,7 +2489,7 @@ class DITemplateParameter : public DINode {
2475
2489
2476
2490
MDString *getRawName () const { return getOperandAs<MDString>(0 ); }
2477
2491
Metadata *getRawType () const { return getOperand (1 ); }
2478
- bool isDefault () const { return IsDefault ; }
2492
+ bool isDefault () const { return SubclassData1 ; }
2479
2493
2480
2494
static bool classof (const Metadata *MD) {
2481
2495
return MD->getMetadataID () == DITemplateTypeParameterKind ||
@@ -2572,9 +2586,10 @@ class DITemplateValueParameter : public DITemplateParameter {
2572
2586
};
2573
2587
2574
2588
// / Base class for variables.
2589
+ // /
2590
+ // / Uses the SubclassData32 Metadata slot.
2575
2591
class DIVariable : public DINode {
2576
2592
unsigned Line;
2577
- uint32_t AlignInBits;
2578
2593
2579
2594
protected:
2580
2595
DIVariable (LLVMContext &C, unsigned ID, StorageType Storage, signed Line,
@@ -2587,7 +2602,7 @@ class DIVariable : public DINode {
2587
2602
StringRef getName () const { return getStringOperand (1 ); }
2588
2603
DIFile *getFile () const { return cast_or_null<DIFile>(getRawFile ()); }
2589
2604
DIType *getType () const { return cast_or_null<DIType>(getRawType ()); }
2590
- uint32_t getAlignInBits () const { return AlignInBits ; }
2605
+ uint32_t getAlignInBits () const { return SubclassData32 ; }
2591
2606
uint32_t getAlignInBytes () const { return getAlignInBits () / CHAR_BIT; }
2592
2607
// / Determines the size of the variable's type.
2593
2608
std::optional<uint64_t > getSizeInBits () const ;
@@ -3161,9 +3176,10 @@ class DIGlobalVariable : public DIVariable {
3161
3176
}
3162
3177
};
3163
3178
3179
+ // / Debug common block.
3180
+ // /
3181
+ // / Uses the SubclassData32 Metadata slot.
3164
3182
class DICommonBlock : public DIScope {
3165
- unsigned LineNo;
3166
-
3167
3183
friend class LLVMContextImpl ;
3168
3184
friend class MDNode ;
3169
3185
@@ -3205,7 +3221,7 @@ class DICommonBlock : public DIScope {
3205
3221
}
3206
3222
StringRef getName () const { return getStringOperand (2 ); }
3207
3223
DIFile *getFile () const { return cast_or_null<DIFile>(getRawFile ()); }
3208
- unsigned getLineNo () const { return LineNo ; }
3224
+ unsigned getLineNo () const { return SubclassData32 ; }
3209
3225
3210
3226
Metadata *getRawScope () const { return getOperand (0 ); }
3211
3227
Metadata *getRawDecl () const { return getOperand (1 ); }
@@ -3310,12 +3326,11 @@ class DILocalVariable : public DIVariable {
3310
3326
3311
3327
// / Label.
3312
3328
// /
3329
+ // / Uses the SubclassData32 Metadata slot.
3313
3330
class DILabel : public DINode {
3314
3331
friend class LLVMContextImpl ;
3315
3332
friend class MDNode ;
3316
3333
3317
- unsigned Line;
3318
-
3319
3334
DILabel (LLVMContext &C, StorageType Storage, unsigned Line,
3320
3335
ArrayRef<Metadata *> Ops);
3321
3336
~DILabel () = default ;
@@ -3353,7 +3368,7 @@ class DILabel : public DINode {
3353
3368
DILocalScope *getScope () const {
3354
3369
return cast_or_null<DILocalScope>(getRawScope ());
3355
3370
}
3356
- unsigned getLine () const { return Line ; }
3371
+ unsigned getLine () const { return SubclassData32 ; }
3357
3372
StringRef getName () const { return getStringOperand (1 ); }
3358
3373
DIFile *getFile () const { return cast_or_null<DIFile>(getRawFile ()); }
3359
3374
@@ -3455,15 +3470,17 @@ class DIObjCProperty : public DINode {
3455
3470
};
3456
3471
3457
3472
// / An imported module (C++ using directive or similar).
3473
+ // /
3474
+ // / Uses the SubclassData32 Metadata slot.
3458
3475
class DIImportedEntity : public DINode {
3459
3476
friend class LLVMContextImpl ;
3460
3477
friend class MDNode ;
3461
3478
3462
- unsigned Line;
3463
-
3464
3479
DIImportedEntity (LLVMContext &C, StorageType Storage, unsigned Tag,
3465
3480
unsigned Line, ArrayRef<Metadata *> Ops)
3466
- : DINode(C, DIImportedEntityKind, Storage, Tag, Ops), Line(Line) {}
3481
+ : DINode(C, DIImportedEntityKind, Storage, Tag, Ops) {
3482
+ SubclassData32 = Line;
3483
+ }
3467
3484
~DIImportedEntity () = default ;
3468
3485
3469
3486
static DIImportedEntity *getImpl (LLVMContext &Context, unsigned Tag,
@@ -3499,7 +3516,7 @@ class DIImportedEntity : public DINode {
3499
3516
3500
3517
TempDIImportedEntity clone () const { return cloneImpl (); }
3501
3518
3502
- unsigned getLine () const { return Line ; }
3519
+ unsigned getLine () const { return SubclassData32 ; }
3503
3520
DIScope *getScope () const { return cast_or_null<DIScope>(getRawScope ()); }
3504
3521
DINode *getEntity () const { return cast_or_null<DINode>(getRawEntity ()); }
3505
3522
StringRef getName () const { return getStringOperand (2 ); }
@@ -3567,6 +3584,8 @@ class DIGlobalVariableExpression : public MDNode {
3567
3584
// / \c DW_MACINFO_*, defined in llvm/BinaryFormat/Dwarf.h). Called \a
3568
3585
// / DIMacroNode
3569
3586
// / because it's potentially used for non-DWARF output.
3587
+ // /
3588
+ // / Uses the SubclassData16 Metadata slot.
3570
3589
class DIMacroNode : public MDNode {
3571
3590
friend class LLVMContextImpl ;
3572
3591
friend class MDNode ;
@@ -3611,15 +3630,18 @@ class DIMacroNode : public MDNode {
3611
3630
}
3612
3631
};
3613
3632
3633
+ // / Macro
3634
+ // /
3635
+ // / Uses the SubclassData32 Metadata slot.
3614
3636
class DIMacro : public DIMacroNode {
3615
3637
friend class LLVMContextImpl ;
3616
3638
friend class MDNode ;
3617
3639
3618
- unsigned Line;
3619
-
3620
3640
DIMacro (LLVMContext &C, StorageType Storage, unsigned MIType, unsigned Line,
3621
3641
ArrayRef<Metadata *> Ops)
3622
- : DIMacroNode(C, DIMacroKind, Storage, MIType, Ops), Line(Line) {}
3642
+ : DIMacroNode(C, DIMacroKind, Storage, MIType, Ops) {
3643
+ SubclassData32 = Line;
3644
+ }
3623
3645
~DIMacro () = default ;
3624
3646
3625
3647
static DIMacro *getImpl (LLVMContext &Context, unsigned MIType, unsigned Line,
@@ -3649,7 +3671,7 @@ class DIMacro : public DIMacroNode {
3649
3671
3650
3672
TempDIMacro clone () const { return cloneImpl (); }
3651
3673
3652
- unsigned getLine () const { return Line ; }
3674
+ unsigned getLine () const { return SubclassData32 ; }
3653
3675
3654
3676
StringRef getName () const { return getStringOperand (0 ); }
3655
3677
StringRef getValue () const { return getStringOperand (1 ); }
@@ -3662,15 +3684,18 @@ class DIMacro : public DIMacroNode {
3662
3684
}
3663
3685
};
3664
3686
3687
+ // / Macro file
3688
+ // /
3689
+ // / Uses the SubclassData32 Metadata slot.
3665
3690
class DIMacroFile : public DIMacroNode {
3666
3691
friend class LLVMContextImpl ;
3667
3692
friend class MDNode ;
3668
3693
3669
- unsigned Line;
3670
-
3671
3694
DIMacroFile (LLVMContext &C, StorageType Storage, unsigned MIType,
3672
3695
unsigned Line, ArrayRef<Metadata *> Ops)
3673
- : DIMacroNode(C, DIMacroFileKind, Storage, MIType, Ops), Line(Line) {}
3696
+ : DIMacroNode(C, DIMacroFileKind, Storage, MIType, Ops) {
3697
+ SubclassData32 = Line;
3698
+ }
3674
3699
~DIMacroFile () = default ;
3675
3700
3676
3701
static DIMacroFile *getImpl (LLVMContext &Context, unsigned MIType,
@@ -3711,7 +3736,7 @@ class DIMacroFile : public DIMacroNode {
3711
3736
replaceOperandWith (1 , Elements.get ());
3712
3737
}
3713
3738
3714
- unsigned getLine () const { return Line ; }
3739
+ unsigned getLine () const { return SubclassData32 ; }
3715
3740
DIFile *getFile () const { return cast_or_null<DIFile>(getRawFile ()); }
3716
3741
3717
3742
DIMacroNodeArray getElements () const {
0 commit comments