@@ -701,31 +701,36 @@ class DIType : public DIScope {
701
701
uint64_t SizeInBits;
702
702
uint64_t OffsetInBits;
703
703
uint32_t AlignInBits;
704
+ uint32_t NumExtraInhabitants;
704
705
705
706
protected:
706
707
DIType (LLVMContext &C, unsigned ID, StorageType Storage, unsigned Tag,
707
708
unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
708
- uint64_t OffsetInBits, DIFlags Flags, ArrayRef<Metadata *> Ops)
709
+ uint64_t OffsetInBits, uint32_t NumExtraInhabitants, DIFlags Flags,
710
+ ArrayRef<Metadata *> Ops)
709
711
: DIScope(C, ID, Storage, Tag, Ops) {
710
- init (Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
712
+ init (Line, SizeInBits, AlignInBits, OffsetInBits, NumExtraInhabitants,
713
+ Flags);
711
714
}
712
715
~DIType () = default ;
713
716
714
717
void init (unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
715
- uint64_t OffsetInBits, DIFlags Flags) {
718
+ uint64_t OffsetInBits, uint32_t NumExtraInhabitants,
719
+ DIFlags Flags) {
716
720
this ->Line = Line;
717
721
this ->Flags = Flags;
718
722
this ->SizeInBits = SizeInBits;
719
723
this ->AlignInBits = AlignInBits;
720
724
this ->OffsetInBits = OffsetInBits;
725
+ this ->NumExtraInhabitants = NumExtraInhabitants;
721
726
}
722
727
723
728
// / Change fields in place.
724
729
void mutate (unsigned Tag, unsigned Line, uint64_t SizeInBits,
725
- uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags) {
730
+ uint32_t AlignInBits, uint64_t OffsetInBits, uint32_t NumExtraInhabitants, DIFlags Flags) {
726
731
assert (isDistinct () && " Only distinct nodes can mutate" );
727
732
setTag (Tag);
728
- init (Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
733
+ init (Line, SizeInBits, AlignInBits, OffsetInBits, NumExtraInhabitants, Flags);
729
734
}
730
735
731
736
public:
@@ -738,6 +743,7 @@ class DIType : public DIScope {
738
743
uint32_t getAlignInBits () const { return AlignInBits; }
739
744
uint32_t getAlignInBytes () const { return getAlignInBits () / CHAR_BIT; }
740
745
uint64_t getOffsetInBits () const { return OffsetInBits; }
746
+ uint32_t getNumExtraInhabitants () const { return NumExtraInhabitants; }
741
747
DIFlags getFlags () const { return Flags; }
742
748
743
749
DIScope *getScope () const { return cast_or_null<DIScope>(getRawScope ()); }
@@ -809,49 +815,55 @@ class DIBasicType : public DIType {
809
815
810
816
DIBasicType (LLVMContext &C, StorageType Storage, unsigned Tag,
811
817
uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding,
812
- DIFlags Flags, ArrayRef<Metadata *> Ops)
818
+ uint32_t NumExtraInhabitants, DIFlags Flags,
819
+ ArrayRef<Metadata *> Ops)
813
820
: DIType(C, DIBasicTypeKind, Storage, Tag, 0 , SizeInBits, AlignInBits, 0 ,
814
- Flags, Ops),
821
+ NumExtraInhabitants, Flags, Ops),
815
822
Encoding (Encoding) {}
816
823
~DIBasicType () = default ;
817
824
818
825
static DIBasicType *getImpl (LLVMContext &Context, unsigned Tag,
819
826
StringRef Name, uint64_t SizeInBits,
820
827
uint32_t AlignInBits, unsigned Encoding,
821
- DIFlags Flags, StorageType Storage ,
822
- bool ShouldCreate = true ) {
828
+ uint32_t NumExtraInhabitants, DIFlags Flags ,
829
+ StorageType Storage, bool ShouldCreate = true ) {
823
830
return getImpl (Context, Tag, getCanonicalMDString (Context, Name),
824
- SizeInBits, AlignInBits, Encoding, Flags, Storage ,
825
- ShouldCreate);
831
+ SizeInBits, AlignInBits, Encoding, NumExtraInhabitants ,
832
+ Flags, Storage, ShouldCreate);
826
833
}
827
834
static DIBasicType *getImpl (LLVMContext &Context, unsigned Tag,
828
835
MDString *Name, uint64_t SizeInBits,
829
836
uint32_t AlignInBits, unsigned Encoding,
830
- DIFlags Flags, StorageType Storage ,
831
- bool ShouldCreate = true );
837
+ uint32_t NumExtraInhabitants, DIFlags Flags ,
838
+ StorageType Storage, bool ShouldCreate = true );
832
839
833
840
TempDIBasicType cloneImpl () const {
834
841
return getTemporary (getContext (), getTag (), getName (), getSizeInBits (),
835
- getAlignInBits (), getEncoding (), getFlags ());
842
+ getAlignInBits (), getEncoding (),
843
+ getNumExtraInhabitants (), getFlags ());
836
844
}
837
845
838
846
public:
839
847
DEFINE_MDNODE_GET (DIBasicType, (unsigned Tag, StringRef Name),
840
- (Tag, Name, 0 , 0 , 0 , FlagZero))
848
+ (Tag, Name, 0 , 0 , 0 , 0 , FlagZero))
841
849
DEFINE_MDNODE_GET(DIBasicType,
842
850
(unsigned Tag, StringRef Name, uint64_t SizeInBits),
843
- (Tag, Name, SizeInBits, 0 , 0 , FlagZero))
851
+ (Tag, Name, SizeInBits, 0 , 0 , 0 , FlagZero))
844
852
DEFINE_MDNODE_GET(DIBasicType,
845
853
(unsigned Tag, MDString *Name, uint64_t SizeInBits),
846
- (Tag, Name, SizeInBits, 0 , 0 , FlagZero))
854
+ (Tag, Name, SizeInBits, 0 , 0 , 0 , FlagZero))
847
855
DEFINE_MDNODE_GET(DIBasicType,
848
856
(unsigned Tag, StringRef Name, uint64_t SizeInBits,
849
- uint32_t AlignInBits, unsigned Encoding, DIFlags Flags),
850
- (Tag, Name, SizeInBits, AlignInBits, Encoding, Flags))
857
+ uint32_t AlignInBits, unsigned Encoding,
858
+ uint32_t NumExtraInhabitants, DIFlags Flags),
859
+ (Tag, Name, SizeInBits, AlignInBits, Encoding,
860
+ NumExtraInhabitants, Flags))
851
861
DEFINE_MDNODE_GET(DIBasicType,
852
862
(unsigned Tag, MDString *Name, uint64_t SizeInBits,
853
- uint32_t AlignInBits, unsigned Encoding, DIFlags Flags),
854
- (Tag, Name, SizeInBits, AlignInBits, Encoding, Flags))
863
+ uint32_t AlignInBits, unsigned Encoding,
864
+ uint32_t NumExtraInhabitants, DIFlags Flags),
865
+ (Tag, Name, SizeInBits, AlignInBits, Encoding,
866
+ NumExtraInhabitants, Flags))
855
867
856
868
TempDIBasicType clone() const { return cloneImpl (); }
857
869
@@ -879,7 +891,7 @@ class DIStringType : public DIType {
879
891
uint64_t SizeInBits, uint32_t AlignInBits, unsigned Encoding,
880
892
ArrayRef<Metadata *> Ops)
881
893
: DIType(C, DIStringTypeKind, Storage, Tag, 0 , SizeInBits, AlignInBits, 0 ,
882
- FlagZero, Ops),
894
+ 0 , FlagZero, Ops),
883
895
Encoding (Encoding) {}
884
896
~DIStringType () = default ;
885
897
@@ -998,10 +1010,11 @@ class DIDerivedType : public DIType {
998
1010
DIDerivedType (LLVMContext &C, StorageType Storage, unsigned Tag,
999
1011
unsigned Line, uint64_t SizeInBits, uint32_t AlignInBits,
1000
1012
uint64_t OffsetInBits,
1001
- std::optional<unsigned > DWARFAddressSpace, std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
1013
+ std::optional<unsigned > DWARFAddressSpace,
1014
+ std::optional<PtrAuthData> PtrAuthData, DIFlags Flags,
1002
1015
ArrayRef<Metadata *> Ops)
1003
1016
: DIType(C, DIDerivedTypeKind, Storage, Tag, Line, SizeInBits,
1004
- AlignInBits, OffsetInBits, Flags, Ops),
1017
+ AlignInBits, OffsetInBits, 0 , Flags, Ops),
1005
1018
DWARFAddressSpace (DWARFAddressSpace) {
1006
1019
if (PtrAuthData)
1007
1020
SubclassData32 = PtrAuthData->Payload .RawData ;
@@ -1145,39 +1158,43 @@ class DICompositeType : public DIType {
1145
1158
1146
1159
DICompositeType (LLVMContext &C, StorageType Storage, unsigned Tag,
1147
1160
unsigned Line, unsigned RuntimeLang, uint64_t SizeInBits,
1148
- uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
1161
+ uint32_t AlignInBits, uint64_t OffsetInBits,
1162
+ uint32_t NumExtraInhabitants, DIFlags Flags,
1149
1163
ArrayRef<Metadata *> Ops)
1150
1164
: DIType(C, DICompositeTypeKind, Storage, Tag, Line, SizeInBits,
1151
- AlignInBits, OffsetInBits, Flags, Ops),
1165
+ AlignInBits, OffsetInBits, NumExtraInhabitants, Flags, Ops),
1152
1166
RuntimeLang (RuntimeLang) {}
1153
1167
~DICompositeType () = default ;
1154
1168
1155
1169
// / Change fields in place.
1156
1170
void mutate (unsigned Tag, unsigned Line, unsigned RuntimeLang,
1157
1171
uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
1158
- DIFlags Flags) {
1172
+ uint32_t NumExtraInhabitants, DIFlags Flags) {
1159
1173
assert (isDistinct () && " Only distinct nodes can mutate" );
1160
1174
assert (getRawIdentifier () && " Only ODR-uniqued nodes should mutate" );
1161
1175
this ->RuntimeLang = RuntimeLang;
1162
- DIType::mutate (Tag, Line, SizeInBits, AlignInBits, OffsetInBits, Flags);
1176
+ DIType::mutate (Tag, Line, SizeInBits, AlignInBits, OffsetInBits,
1177
+ NumExtraInhabitants, Flags);
1163
1178
}
1164
1179
1165
1180
static DICompositeType *
1166
1181
getImpl (LLVMContext &Context, unsigned Tag, StringRef Name, Metadata *File,
1167
1182
unsigned Line, DIScope *Scope, DIType *BaseType, uint64_t SizeInBits,
1168
- uint32_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
1169
- DINodeArray Elements, unsigned RuntimeLang, DIType *VTableHolder,
1183
+ uint32_t AlignInBits, uint64_t OffsetInBits,
1184
+ uint32_t NumExtraInhabitants, DIFlags Flags, DINodeArray Elements,
1185
+ unsigned RuntimeLang, DIType *VTableHolder,
1170
1186
DITemplateParameterArray TemplateParams, StringRef Identifier,
1171
1187
DIDerivedType *Discriminator, Metadata *DataLocation,
1172
1188
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1173
1189
DINodeArray Annotations, StorageType Storage,
1174
1190
bool ShouldCreate = true ) {
1175
- return getImpl (
1176
- Context, Tag, getCanonicalMDString (Context, Name), File, Line, Scope,
1177
- BaseType, SizeInBits, AlignInBits, OffsetInBits, Flags, Elements.get (),
1178
- RuntimeLang, VTableHolder, TemplateParams.get (),
1179
- getCanonicalMDString (Context, Identifier), Discriminator, DataLocation,
1180
- Associated, Allocated, Rank, Annotations.get (), Storage, ShouldCreate);
1191
+ return getImpl (Context, Tag, getCanonicalMDString (Context, Name), File,
1192
+ Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits,
1193
+ Flags, Elements.get (), RuntimeLang, VTableHolder,
1194
+ TemplateParams.get (),
1195
+ getCanonicalMDString (Context, Identifier), Discriminator,
1196
+ DataLocation, Associated, Allocated, Rank, Annotations.get (),
1197
+ NumExtraInhabitants, Storage, ShouldCreate);
1181
1198
}
1182
1199
static DICompositeType *
1183
1200
getImpl (LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
@@ -1187,7 +1204,8 @@ class DICompositeType : public DIType {
1187
1204
Metadata *VTableHolder, Metadata *TemplateParams,
1188
1205
MDString *Identifier, Metadata *Discriminator, Metadata *DataLocation,
1189
1206
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1190
- Metadata *Annotations, StorageType Storage, bool ShouldCreate = true );
1207
+ Metadata *Annotations, uint32_t NumExtraInhabitants,
1208
+ StorageType Storage, bool ShouldCreate = true );
1191
1209
1192
1210
TempDICompositeType cloneImpl () const {
1193
1211
return getTemporary (
@@ -1196,7 +1214,7 @@ class DICompositeType : public DIType {
1196
1214
getFlags (), getElements (), getRuntimeLang (), getVTableHolder (),
1197
1215
getTemplateParams (), getIdentifier (), getDiscriminator (),
1198
1216
getRawDataLocation (), getRawAssociated (), getRawAllocated (),
1199
- getRawRank (), getAnnotations ());
1217
+ getRawRank (), getAnnotations (), getNumExtraInhabitants () );
1200
1218
}
1201
1219
1202
1220
public:
@@ -1210,11 +1228,11 @@ class DICompositeType : public DIType {
1210
1228
StringRef Identifier = " " , DIDerivedType *Discriminator = nullptr ,
1211
1229
Metadata *DataLocation = nullptr , Metadata *Associated = nullptr ,
1212
1230
Metadata *Allocated = nullptr , Metadata *Rank = nullptr ,
1213
- DINodeArray Annotations = nullptr ),
1231
+ DINodeArray Annotations = nullptr , uint32_t NumExtraInhabitants = 0 ),
1214
1232
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
1215
- OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams ,
1216
- Identifier, Discriminator, DataLocation, Associated, Allocated, Rank ,
1217
- Annotations))
1233
+ OffsetInBits, NumExtraInhabitants, Flags, Elements, RuntimeLang,
1234
+ VTableHolder, TemplateParams, Identifier, Discriminator, DataLocation ,
1235
+ Associated, Allocated, Rank, Annotations))
1218
1236
DEFINE_MDNODE_GET(
1219
1237
DICompositeType,
1220
1238
(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
@@ -1224,11 +1242,12 @@ class DICompositeType : public DIType {
1224
1242
Metadata *TemplateParams = nullptr , MDString *Identifier = nullptr ,
1225
1243
Metadata *Discriminator = nullptr , Metadata *DataLocation = nullptr ,
1226
1244
Metadata *Associated = nullptr , Metadata *Allocated = nullptr ,
1227
- Metadata *Rank = nullptr , Metadata *Annotations = nullptr ),
1245
+ Metadata *Rank = nullptr , Metadata *Annotations = nullptr ,
1246
+ uint32_t NumExtraInhabitants = 0 ),
1228
1247
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
1229
1248
OffsetInBits, Flags, Elements, RuntimeLang, VTableHolder, TemplateParams,
1230
1249
Identifier, Discriminator, DataLocation, Associated, Allocated, Rank,
1231
- Annotations))
1250
+ Annotations, NumExtraInhabitants ))
1232
1251
1233
1252
TempDICompositeType clone() const { return cloneImpl (); }
1234
1253
@@ -1243,8 +1262,8 @@ class DICompositeType : public DIType {
1243
1262
getODRType (LLVMContext &Context, MDString &Identifier, unsigned Tag,
1244
1263
MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
1245
1264
Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
1246
- uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements ,
1247
- unsigned RuntimeLang, Metadata *VTableHolder,
1265
+ uint64_t OffsetInBits, uint32_t NumExtraInhabitants, DIFlags Flags ,
1266
+ Metadata *Elements, unsigned RuntimeLang, Metadata *VTableHolder,
1248
1267
Metadata *TemplateParams, Metadata *Discriminator,
1249
1268
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
1250
1269
Metadata *Rank, Metadata *Annotations);
@@ -1260,15 +1279,14 @@ class DICompositeType : public DIType {
1260
1279
// /
1261
1280
// / If not \a LLVMContext::isODRUniquingDebugTypes(), this function returns
1262
1281
// / nullptr.
1263
- static DICompositeType *
1264
- buildODRType (LLVMContext &Context, MDString &Identifier, unsigned Tag,
1265
- MDString *Name, Metadata *File, unsigned Line, Metadata *Scope,
1266
- Metadata *BaseType, uint64_t SizeInBits, uint32_t AlignInBits,
1267
- uint64_t OffsetInBits, DIFlags Flags, Metadata *Elements,
1268
- unsigned RuntimeLang, Metadata *VTableHolder,
1269
- Metadata *TemplateParams, Metadata *Discriminator,
1270
- Metadata *DataLocation, Metadata *Associated,
1271
- Metadata *Allocated, Metadata *Rank, Metadata *Annotations);
1282
+ static DICompositeType *buildODRType (
1283
+ LLVMContext &Context, MDString &Identifier, unsigned Tag, MDString *Name,
1284
+ Metadata *File, unsigned Line, Metadata *Scope, Metadata *BaseType,
1285
+ uint64_t SizeInBits, uint32_t AlignInBits, uint64_t OffsetInBits,
1286
+ uint32_t NumExtraInhabitants, DIFlags Flags, Metadata *Elements,
1287
+ unsigned RuntimeLang, Metadata *VTableHolder, Metadata *TemplateParams,
1288
+ Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated,
1289
+ Metadata *Allocated, Metadata *Rank, Metadata *Annotations);
1272
1290
1273
1291
DIType *getBaseType () const { return cast_or_null<DIType>(getRawBaseType ()); }
1274
1292
DINodeArray getElements () const {
0 commit comments