Skip to content

Commit 653e8fd

Browse files
committed
[DebugInfo] Add labels when constructing DebugTypeInfo (NFC)
1 parent 4ede40e commit 653e8fd

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

lib/IRGen/DebugTypeInfo.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ DebugTypeInfo DebugTypeInfo::getFromTypeInfo(swift::Type Ty, const TypeInfo &TI,
5757
assert(TI.getStorageType() && "StorageType is a nullptr");
5858
return DebugTypeInfo(Ty.getPointer(), StorageType,
5959
TI.getBestKnownAlignment(), ::hasDefaultAlignment(Ty),
60-
false, false, NumExtraInhabitants);
60+
/* IsMetadataType = */ false,
61+
/* IsFixedBuffer = */ false, NumExtraInhabitants);
6162
}
6263

6364
DebugTypeInfo DebugTypeInfo::getLocalVariable(VarDecl *Decl, swift::Type Ty,
@@ -82,7 +83,9 @@ DebugTypeInfo DebugTypeInfo::getLocalVariable(VarDecl *Decl, swift::Type Ty,
8283
DebugTypeInfo DebugTypeInfo::getGlobalMetadata(swift::Type Ty,
8384
llvm::Type *StorageTy, Size size,
8485
Alignment align) {
85-
DebugTypeInfo DbgTy(Ty.getPointer(), StorageTy, align, true, false);
86+
DebugTypeInfo DbgTy(Ty.getPointer(), StorageTy, align,
87+
/* HasDefaultAlignment = */ true,
88+
/* IsMetadataType = */ false);
8689
assert(StorageTy && "StorageType is a nullptr");
8790
assert(!DbgTy.isContextArchetype() &&
8891
"type metadata cannot contain an archetype");
@@ -92,7 +95,9 @@ DebugTypeInfo DebugTypeInfo::getGlobalMetadata(swift::Type Ty,
9295
DebugTypeInfo DebugTypeInfo::getTypeMetadata(swift::Type Ty,
9396
llvm::Type *StorageTy, Size size,
9497
Alignment align) {
95-
DebugTypeInfo DbgTy(Ty.getPointer(), StorageTy, align, true, true);
98+
DebugTypeInfo DbgTy(Ty.getPointer(), StorageTy, align,
99+
/* HasDefaultAlignment = */ true,
100+
/* IsMetadataType = */ true);
96101
assert(StorageTy && "StorageType is a nullptr");
97102
assert(!DbgTy.isContextArchetype() &&
98103
"type metadata cannot contain an archetype");
@@ -138,7 +143,8 @@ DebugTypeInfo::getGlobalFixedBuffer(SILGlobalVariable *GV,
138143
Type = DeclType.getPointer();
139144
}
140145
DebugTypeInfo DbgTy(Type, FragmentStorageType,
141-
Align, ::hasDefaultAlignment(Type), false, true);
146+
Align, ::hasDefaultAlignment(Type),
147+
/* IsMetadataType = */ false, /* IsFixedBuffer = */ true);
142148
assert(FragmentStorageType && "FragmentStorageType is a nullptr");
143149
assert(!DbgTy.isContextArchetype() &&
144150
"type of global variable cannot be an archetype");
@@ -149,7 +155,9 @@ DebugTypeInfo DebugTypeInfo::getObjCClass(ClassDecl *theClass,
149155
llvm::Type *FragmentStorageType,
150156
Size SizeInBytes, Alignment align) {
151157
DebugTypeInfo DbgTy(theClass->getInterfaceType().getPointer(),
152-
FragmentStorageType, align, true, false);
158+
FragmentStorageType, align,
159+
/* HasDefaultAlignment = */ true,
160+
/* IsMetadataType = */ false);
153161
assert(FragmentStorageType && "FragmentStorageType is a nullptr");
154162
assert(!DbgTy.isContextArchetype() &&
155163
"type of objc class cannot be an archetype");

lib/IRGen/DebugTypeInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ template <> struct DenseMapInfo<swift::irgen::DebugTypeInfo> {
152152
static swift::irgen::DebugTypeInfo getTombstoneKey() {
153153
return swift::irgen::DebugTypeInfo(
154154
llvm::DenseMapInfo<swift::TypeBase *>::getTombstoneKey(), nullptr,
155-
swift::irgen::Alignment(), false, false);
155+
swift::irgen::Alignment(), /* HasDefaultAlignment = */ false);
156156
}
157157
static unsigned getHashValue(swift::irgen::DebugTypeInfo Val) {
158158
return DenseMapInfo<swift::CanType>::getHashValue(Val.getType());

lib/IRGen/IRGenDebugInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,8 +2090,9 @@ class IRGenDebugInfoImpl : public IRGenDebugInfo {
20902090
// in the decl of the alias type.
20912091
DebugTypeInfo AliasedDbgTy(
20922092
AliasedTy, DbgTy.getFragmentStorageType(),
2093-
DbgTy.getAlignment(), DbgTy.hasDefaultAlignment(), false,
2094-
DbgTy.isFixedBuffer(), DbgTy.getNumExtraInhabitants());
2093+
DbgTy.getAlignment(), DbgTy.hasDefaultAlignment(),
2094+
/* IsMetadataType = */ false, DbgTy.isFixedBuffer(),
2095+
DbgTy.getNumExtraInhabitants());
20952096
return DBuilder.createTypedef(getOrCreateType(AliasedDbgTy), MangledName,
20962097
L.File, 0, Scope);
20972098
}

0 commit comments

Comments
 (0)