@@ -1363,6 +1363,7 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
13631363 ? 0
13641364 : DbgTy.getAlignment ().getValue () * SizeOfByte;
13651365 unsigned Encoding = 0 ;
1366+ uint32_t NumExtraInhabitants = 0 ;
13661367 llvm::DINode::DIFlags Flags = llvm::DINode::FlagZero;
13671368
13681369 TypeBase *BaseTy = DbgTy.getType ();
@@ -1386,13 +1387,17 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
13861387 Encoding = llvm::dwarf::DW_ATE_unsigned;
13871388 if (auto CompletedDbgTy = CompletedDebugTypeInfo::get (DbgTy))
13881389 SizeInBits = getSizeOfBasicType (*CompletedDbgTy);
1390+ if (auto DbgTyNumExtraInhabitants = DbgTy.getNumExtraInhabitants ())
1391+ NumExtraInhabitants = *DbgTyNumExtraInhabitants;
13891392 break ;
13901393 }
13911394
13921395 case TypeKind::BuiltinIntegerLiteral: {
13931396 Encoding = llvm::dwarf::DW_ATE_unsigned; // ?
13941397 if (auto CompletedDbgTy = CompletedDebugTypeInfo::get (DbgTy))
13951398 SizeInBits = getSizeOfBasicType (*CompletedDbgTy);
1399+ if (auto DbgTyNumExtraInhabitants = DbgTy.getNumExtraInhabitants ())
1400+ NumExtraInhabitants = *DbgTyNumExtraInhabitants;
13961401 break ;
13971402 }
13981403
@@ -1401,6 +1406,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
14011406 // Assuming that the bitwidth and FloatTy->getFPKind() are identical.
14021407 SizeInBits = FloatTy->getBitWidth ();
14031408 Encoding = llvm::dwarf::DW_ATE_float;
1409+ if (auto DbgTyNumExtraInhabitants = DbgTy.getNumExtraInhabitants ())
1410+ NumExtraInhabitants = *DbgTyNumExtraInhabitants;
14041411 break ;
14051412 }
14061413
@@ -1726,7 +1733,8 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
17261733 DebugTypeInfo AliasedDbgTy (
17271734 AliasedTy, DbgTy.getFragmentStorageType (), DbgTy.getRawSizeInBits (),
17281735 DbgTy.getAlignment (), DbgTy.hasDefaultAlignment (), false ,
1729- DbgTy.isSizeFragmentSize (), DbgTy.isFixedBuffer ());
1736+ DbgTy.isSizeFragmentSize (), DbgTy.isFixedBuffer (),
1737+ DbgTy.getNumExtraInhabitants ());
17301738 return DBuilder.createTypedef (getOrCreateType (AliasedDbgTy), MangledName,
17311739 File, 0 , Scope);
17321740 }
@@ -1774,7 +1782,9 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
17741782 DbgTy.getType ()->dump (llvm::dbgs ()); llvm::dbgs () << " \n " );
17751783 MangledName = " <unknown>" ;
17761784 }
1777- return DBuilder.createBasicType (MangledName, SizeInBits, Encoding);
1785+ return DBuilder.createBasicType (MangledName, SizeInBits, Encoding,
1786+ llvm::DINode::FlagZero,
1787+ NumExtraInhabitants);
17781788 }
17791789
17801790 // / Determine if there exists a name mangling for the given type.
0 commit comments