@@ -1306,15 +1306,15 @@ class DICompositeType : public DIType {
1306
1306
DIType *VTableHolder, DITemplateParameterArray TemplateParams,
1307
1307
StringRef Identifier, DIDerivedType *Discriminator,
1308
1308
Metadata *DataLocation, Metadata *Associated, Metadata *Allocated,
1309
- Metadata *Rank, DINodeArray Annotations, StorageType Storage ,
1310
- bool ShouldCreate = true ) {
1311
- return getImpl (Context, Tag, getCanonicalMDString (Context, Name), File,
1312
- Line, Scope, BaseType, SizeInBits, AlignInBits, OffsetInBits ,
1313
- Flags, Elements.get (), RuntimeLang, EnumKind, VTableHolder ,
1314
- TemplateParams.get (),
1315
- getCanonicalMDString (Context, Identifier), Discriminator,
1316
- DataLocation, Associated, Allocated, Rank, Annotations.get (),
1317
- Specification, NumExtraInhabitants , Storage, ShouldCreate);
1309
+ Metadata *Rank, DINodeArray Annotations, Metadata *BitStride ,
1310
+ StorageType Storage, bool ShouldCreate = true ) {
1311
+ return getImpl (
1312
+ Context, Tag, getCanonicalMDString (Context, Name), File, Line, Scope ,
1313
+ BaseType, SizeInBits, AlignInBits, OffsetInBits, Flags, Elements.get (),
1314
+ RuntimeLang, EnumKind, VTableHolder, TemplateParams.get (),
1315
+ getCanonicalMDString (Context, Identifier), Discriminator, DataLocation ,
1316
+ Associated, Allocated, Rank, Annotations.get (), Specification ,
1317
+ NumExtraInhabitants, BitStride , Storage, ShouldCreate);
1318
1318
}
1319
1319
static DICompositeType *
1320
1320
getImpl (LLVMContext &Context, unsigned Tag, MDString *Name, Metadata *File,
@@ -1326,7 +1326,7 @@ class DICompositeType : public DIType {
1326
1326
Metadata *Discriminator, Metadata *DataLocation, Metadata *Associated,
1327
1327
Metadata *Allocated, Metadata *Rank, Metadata *Annotations,
1328
1328
Metadata *Specification, uint32_t NumExtraInhabitants,
1329
- StorageType Storage, bool ShouldCreate = true );
1329
+ Metadata *BitStride, StorageType Storage, bool ShouldCreate = true );
1330
1330
1331
1331
TempDICompositeType cloneImpl () const {
1332
1332
return getTemporary (
@@ -1336,7 +1336,7 @@ class DICompositeType : public DIType {
1336
1336
getVTableHolder (), getTemplateParams (), getIdentifier (),
1337
1337
getDiscriminator (), getRawDataLocation (), getRawAssociated (),
1338
1338
getRawAllocated (), getRawRank (), getAnnotations (), getSpecification (),
1339
- getNumExtraInhabitants ());
1339
+ getNumExtraInhabitants (), getRawBitStride () );
1340
1340
}
1341
1341
1342
1342
public:
@@ -1352,11 +1352,12 @@ class DICompositeType : public DIType {
1352
1352
Metadata *DataLocation = nullptr , Metadata *Associated = nullptr ,
1353
1353
Metadata *Allocated = nullptr , Metadata *Rank = nullptr ,
1354
1354
DINodeArray Annotations = nullptr , DIType *Specification = nullptr ,
1355
- uint32_t NumExtraInhabitants = 0 ),
1355
+ uint32_t NumExtraInhabitants = 0 , Metadata *BitStride = nullptr ),
1356
1356
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
1357
1357
OffsetInBits, Specification, NumExtraInhabitants, Flags, Elements,
1358
1358
RuntimeLang, EnumKind, VTableHolder, TemplateParams, Identifier,
1359
- Discriminator, DataLocation, Associated, Allocated, Rank, Annotations))
1359
+ Discriminator, DataLocation, Associated, Allocated, Rank, Annotations,
1360
+ BitStride))
1360
1361
DEFINE_MDNODE_GET(
1361
1362
DICompositeType,
1362
1363
(unsigned Tag, MDString *Name, Metadata *File, unsigned Line,
@@ -1368,11 +1369,13 @@ class DICompositeType : public DIType {
1368
1369
Metadata *Discriminator = nullptr , Metadata *DataLocation = nullptr ,
1369
1370
Metadata *Associated = nullptr , Metadata *Allocated = nullptr ,
1370
1371
Metadata *Rank = nullptr , Metadata *Annotations = nullptr ,
1371
- Metadata *Specification = nullptr , uint32_t NumExtraInhabitants = 0 ),
1372
+ Metadata *Specification = nullptr , uint32_t NumExtraInhabitants = 0 ,
1373
+ Metadata *BitStride = nullptr ),
1372
1374
(Tag, Name, File, Line, Scope, BaseType, SizeInBits, AlignInBits,
1373
1375
OffsetInBits, Flags, Elements, RuntimeLang, EnumKind, VTableHolder,
1374
1376
TemplateParams, Identifier, Discriminator, DataLocation, Associated,
1375
- Allocated, Rank, Annotations, Specification, NumExtraInhabitants))
1377
+ Allocated, Rank, Annotations, Specification, NumExtraInhabitants,
1378
+ BitStride))
1376
1379
1377
1380
TempDICompositeType clone() const { return cloneImpl (); }
1378
1381
@@ -1393,7 +1396,7 @@ class DICompositeType : public DIType {
1393
1396
Metadata *VTableHolder, Metadata *TemplateParams,
1394
1397
Metadata *Discriminator, Metadata *DataLocation,
1395
1398
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1396
- Metadata *Annotations);
1399
+ Metadata *Annotations, Metadata *BitStride );
1397
1400
static DICompositeType *getODRTypeIfExists (LLVMContext &Context,
1398
1401
MDString &Identifier);
1399
1402
@@ -1416,7 +1419,7 @@ class DICompositeType : public DIType {
1416
1419
Metadata *VTableHolder, Metadata *TemplateParams,
1417
1420
Metadata *Discriminator, Metadata *DataLocation,
1418
1421
Metadata *Associated, Metadata *Allocated, Metadata *Rank,
1419
- Metadata *Annotations);
1422
+ Metadata *Annotations, Metadata *BitStride );
1420
1423
1421
1424
DIType *getBaseType () const { return cast_or_null<DIType>(getRawBaseType ()); }
1422
1425
DINodeArray getElements () const {
@@ -1481,6 +1484,14 @@ class DICompositeType : public DIType {
1481
1484
DIType *getSpecification () const {
1482
1485
return cast_or_null<DIType>(getRawSpecification ());
1483
1486
}
1487
+
1488
+ Metadata *getRawBitStride () const { return getOperand (15 ); }
1489
+ ConstantInt *getBitStrideConst () const {
1490
+ if (auto *MD = dyn_cast_or_null<ConstantAsMetadata>(getRawBitStride ()))
1491
+ return dyn_cast_or_null<ConstantInt>(MD->getValue ());
1492
+ return nullptr ;
1493
+ }
1494
+
1484
1495
// / Replace operands.
1485
1496
// /
1486
1497
// / If this \a isUniqued() and not \a isResolved(), on a uniquing collision
0 commit comments