@@ -1302,15 +1302,15 @@ class DICompositeType : public DIType {
13021302 DIType *VTableHolder, DITemplateParameterArray TemplateParams,
13031303 StringRef Identifier, DIDerivedType *Discriminator,
13041304 Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
1305- Metadata *Rank, DINodeArray Annotations, StorageType Storage ,
1306- bool ShouldCreate = true ) {
1307- return getImpl (Context, Tag, getCanonicalMDString (Context, Name), File,
1308- Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits ,
1309- Flags, Elements.get (), RuntimeLang, EnumKind, VTableHolder ,
1310- TemplateParams.get (),
1311- getCanonicalMDString (Context, Identifier), Discriminator,
1312- DataLocation, Associated, Allocated, Rank, Annotations.get (),
1313- Specification, NumExtraInhabitants , Storage, ShouldCreate);
1305+ Metadata *Rank, DINodeArray Annotations, Metadata *BitStride ,
1306+ StorageType Storage, bool ShouldCreate = true ) {
1307+ return getImpl (
1308+ Context, Tag, getCanonicalMDString (Context, Name), File, Line, Scope ,
1309+ BaseType, SizeInBits, AlignInBits, OffsetInBits, Flags, Elements.get (),
1310+ RuntimeLang, EnumKind, VTableHolder, TemplateParams.get (),
1311+ getCanonicalMDString (Context, Identifier), Discriminator, DataLocation ,
1312+ Associated, Allocated, Rank, Annotations.get (), Specification ,
1313+ NumExtraInhabitants, BitStride , Storage, ShouldCreate);
13141314 }
13151315 static DICompositeType *
13161316 getImpl (LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
@@ -1322,7 +1322,7 @@ class DICompositeType : public DIType {
13221322 Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated,
13231323 Metadata *Allocated, Metadata *Rank, Metadata *Annotations,
13241324 Metadata *Specification, uint32_t NumExtraInhabitants,
1325- StorageType Storage, bool ShouldCreate = true );
1325+ Metadata *BitStride, StorageType Storage, bool ShouldCreate = true );
13261326
13271327 TempDICompositeType cloneImpl () const {
13281328 return getTemporary (
@@ -1332,7 +1332,7 @@ class DICompositeType : public DIType {
13321332 getVTableHolder (), getTemplateParams (), getIdentifier (),
13331333 getDiscriminator (), getRawDataLocation (), getRawAssociated (),
13341334 getRawAllocated (), getRawRank (), getAnnotations (), getSpecification (),
1335- getNumExtraInhabitants ());
1335+ getNumExtraInhabitants (), getRawBitStride () );
13361336 }
13371337
13381338public:
@@ -1348,11 +1348,12 @@ class DICompositeType : public DIType {
13481348 Metadata *DataLocation = nullptr , Metadata *Associated = nullptr ,
13491349 Metadata *Allocated = nullptr , Metadata *Rank = nullptr ,
13501350 DINodeArray Annotations = nullptr , DIType *Specification = nullptr ,
1351- uint32_t NumExtraInhabitants = 0 ),
1351+ uint32_t NumExtraInhabitants = 0 , Metadata *BitStride = nullptr ),
13521352 (Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
13531353 OffsetInBits, Specification, NumExtraInhabitants, Flags, Elements,
13541354 RuntimeLang, EnumKind, VTableHolder, TemplateParams, Identifier,
1355- Discriminator, DataLocation, Associated, Allocated, Rank, Annotations))
1355+ Discriminator, DataLocation, Associated, Allocated, Rank, Annotations,
1356+ BitStride))
13561357 DEFINE_MDNODE_GET(
13571358 DICompositeType,
13581359 (unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
@@ -1364,11 +1365,13 @@ class DICompositeType : public DIType {
13641365 Metadata *Discriminator = nullptr , Metadata *DataLocation = nullptr ,
13651366 Metadata *Associated = nullptr , Metadata *Allocated = nullptr ,
13661367 Metadata *Rank = nullptr , Metadata *Annotations = nullptr ,
1367- Metadata *Specification = nullptr , uint32_t NumExtraInhabitants = 0 ),
1368+ Metadata *Specification = nullptr , uint32_t NumExtraInhabitants = 0 ,
1369+ Metadata *BitStride = nullptr ),
13681370 (Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
13691371 OffsetInBits, Flags, Elements, RuntimeLang, EnumKind, VTableHolder,
13701372 TemplateParams, Identifier, Discriminator, DataLocation, Associated,
1371- Allocated, Rank, Annotations, Specification, NumExtraInhabitants))
1373+ Allocated, Rank, Annotations, Specification, NumExtraInhabitants,
1374+ BitStride))
13721375
13731376 TempDICompositeType clone() const { return cloneImpl (); }
13741377
@@ -1389,7 +1392,7 @@ class DICompositeType : public DIType {
13891392 Metadata *VTableHolder, Metadata *TemplateParams,
13901393 Metadata *Discriminator, Metadata *DataLocation,
13911394 Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1392- Metadata *Annotations);
1395+ Metadata *Annotations, Metadata *BitStride );
13931396 static DICompositeType *getODRTypeIfExists (LLVMContext &Context,
13941397 MDString &Identifier);
13951398
@@ -1412,7 +1415,7 @@ class DICompositeType : public DIType {
14121415 Metadata *VTableHolder, Metadata *TemplateParams,
14131416 Metadata *Discriminator, Metadata *DataLocation,
14141417 Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1415- Metadata *Annotations);
1418+ Metadata *Annotations, Metadata *BitStride );
14161419
14171420 DIType *getBaseType () const { return cast_or_null<DIType>(getRawBaseType ()); }
14181421 DINodeArray getElements () const {
@@ -1477,6 +1480,14 @@ class DICompositeType : public DIType {
14771480 DIType *getSpecification () const {
14781481 return cast_or_null<DIType>(getRawSpecification ());
14791482 }
1483+
1484+ Metadata *getRawBitStride () const { return getOperand (15 ); }
1485+ ConstantInt *getBitStrideConst () const {
1486+ if (auto *MD = dyn_cast_or_null<ConstantAsMetadata>(getRawBitStride ()))
1487+ return dyn_cast_or_null<ConstantInt>(MD->getValue ());
1488+ return nullptr ;
1489+ }
1490+
14801491 // / Replace operands.
14811492 // /
14821493 // / If this \a isUniqued() and not \a isResolved(), on a uniquing collision
0 commit comments