Skip to content

Commit eae7fe4

Browse files
Merge pull request #37624 from adrian-prantl/76973844-review-feedback-next
Address review feedback
2 parents 3b80a76 + 3567b9f commit eae7fe4

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/IRGen/DebugTypeInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class CompletedDebugTypeInfo : public DebugTypeInfo {
128128
DebugTypeInfo::getFromTypeInfo(Ty, Info));
129129
}
130130

131-
Size::int_type getSizeValue() const { return size.getValue().getValue(); }
131+
Size::int_type getSizeValue() const { return size->getValue(); }
132132
};
133133

134134
}

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,12 +1021,11 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
10211021
return getOrCreateType(BlandDbgTy);
10221022
}
10231023

1024-
uint64_t getSizeOfBasicType(DebugTypeInfo DbgTy) {
1024+
uint64_t getSizeOfBasicType(CompletedDebugTypeInfo DbgTy) {
10251025
uint64_t SizeOfByte = CI.getTargetInfo().getCharWidth();
10261026
uint64_t BitWidth = 0;
1027-
assert(DbgTy.getSize() && "non-fixed basic type");
10281027
if (DbgTy.getSize())
1029-
BitWidth = DbgTy.getSize()->getValue() * SizeOfByte;
1028+
BitWidth = DbgTy.getSizeValue() * SizeOfByte;
10301029
llvm::Type *StorageType = DbgTy.getStorageType()
10311030
? DbgTy.getStorageType()
10321031
: IGM.DataLayout.getSmallestLegalIntType(
@@ -1288,13 +1287,15 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
12881287
switch (BaseTy->getKind()) {
12891288
case TypeKind::BuiltinInteger: {
12901289
Encoding = llvm::dwarf::DW_ATE_unsigned;
1291-
SizeInBits = getSizeOfBasicType(DbgTy);
1290+
if (auto CompletedDbgTy = CompletedDebugTypeInfo::get(DbgTy))
1291+
SizeInBits = getSizeOfBasicType(*CompletedDbgTy);
12921292
break;
12931293
}
12941294

12951295
case TypeKind::BuiltinIntegerLiteral: {
12961296
Encoding = llvm::dwarf::DW_ATE_unsigned; // ?
1297-
SizeInBits = getSizeOfBasicType(DbgTy);
1297+
if (auto CompletedDbgTy = CompletedDebugTypeInfo::get(DbgTy))
1298+
SizeInBits = getSizeOfBasicType(*CompletedDbgTy);
12981299
break;
12991300
}
13001301

0 commit comments

Comments
 (0)