Skip to content

Commit d7a9a2a

Browse files
committed
IRGen: Remove unused 'isIndirect' parameter to defineTypeMetadata()
1 parent d93ca3f commit d7a9a2a

File tree

3 files changed

+15
-29
lines changed

3 files changed

+15
-29
lines changed

lib/IRGen/GenDecl.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,13 +3275,11 @@ IRGenModule::getAddrOfTypeMetadataInPlaceInitializationCache(
32753275
/// existing external declaration to the address point as an alias into the
32763276
/// full metadata object.
32773277
llvm::GlobalValue *IRGenModule::defineTypeMetadata(CanType concreteType,
3278-
bool isIndirect,
3279-
bool isPattern,
3280-
bool isConstant,
3281-
ConstantInitFuture init,
3282-
llvm::StringRef section) {
3278+
bool isPattern,
3279+
bool isConstant,
3280+
ConstantInitFuture init,
3281+
llvm::StringRef section) {
32833282
assert(init);
3284-
assert(!isIndirect && "indirect type metadata not used yet");
32853283

32863284
if (isPattern) {
32873285
auto addr = getAddrOfTypeMetadataPattern(concreteType->getAnyNominal(),

lib/IRGen/GenMeta.cpp

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2880,24 +2880,19 @@ void irgen::emitClassMetadata(IRGenModule &IGM, ClassDecl *classDecl,
28802880

28812881
CanType declaredType = classDecl->getDeclaredType()->getCanonicalType();
28822882

2883-
// For now, all type metadata is directly stored.
2884-
bool isIndirect = false;
2885-
28862883
StringRef section{};
28872884
if (classDecl->isObjC() &&
28882885
IGM.TargetInfo.OutputObjectFormat == llvm::Triple::MachO)
28892886
section = "__DATA,__objc_data, regular";
28902887

2891-
auto var = IGM.defineTypeMetadata(declaredType, isIndirect, isGeneric,
2892-
canBeConstant,
2893-
init.finishAndCreateFuture(),
2894-
section);
2888+
auto var = IGM.defineTypeMetadata(declaredType, isGeneric, canBeConstant,
2889+
init.finishAndCreateFuture(), section);
28952890

28962891
// Add classes that don't require dynamic initialization to the
28972892
// ObjC class list.
28982893
//
28992894
// FIXME: This is where we check the completely fragile layout.
2900-
if (IGM.ObjCInterop && !isGeneric && !isIndirect &&
2895+
if (IGM.ObjCInterop && !isGeneric &&
29012896
!doesClassMetadataRequireInitialization(IGM, classDecl)) {
29022897
// Emit the ObjC class symbol to make the class visible to ObjC.
29032898
if (classDecl->isObjC()) {
@@ -3289,11 +3284,8 @@ void irgen::emitStructMetadata(IRGenModule &IGM, StructDecl *structDecl) {
32893284

32903285
CanType declaredType = structDecl->getDeclaredType()->getCanonicalType();
32913286

3292-
// For now, all type metadata is directly stored.
3293-
bool isIndirect = false;
3294-
3295-
IGM.defineTypeMetadata(declaredType, isIndirect, isPattern,
3296-
canBeConstant, init.finishAndCreateFuture());
3287+
IGM.defineTypeMetadata(declaredType, isPattern, canBeConstant,
3288+
init.finishAndCreateFuture());
32973289

32983290
IGM.IRGen.noteUseOfAnyParentTypeMetadata(structDecl);
32993291
}
@@ -3487,11 +3479,8 @@ void irgen::emitEnumMetadata(IRGenModule &IGM, EnumDecl *theEnum) {
34873479

34883480
CanType declaredType = theEnum->getDeclaredType()->getCanonicalType();
34893481

3490-
// For now, all type metadata is directly stored.
3491-
bool isIndirect = false;
3492-
3493-
IGM.defineTypeMetadata(declaredType, isIndirect, isPattern,
3494-
canBeConstant, init.finishAndCreateFuture());
3482+
IGM.defineTypeMetadata(declaredType, isPattern, canBeConstant,
3483+
init.finishAndCreateFuture());
34953484

34963485
IGM.IRGen.noteUseOfAnyParentTypeMetadata(theEnum);
34973486
}

lib/IRGen/IRGenModule.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,11 +1156,10 @@ private: \
11561156
bool isForeign,
11571157
ForDefinition_t forDefinition);
11581158
llvm::GlobalValue *defineTypeMetadata(CanType concreteType,
1159-
bool isIndirect,
1160-
bool isPattern,
1161-
bool isConstant,
1162-
ConstantInitFuture init,
1163-
llvm::StringRef section = {});
1159+
bool isPattern,
1160+
bool isConstant,
1161+
ConstantInitFuture init,
1162+
llvm::StringRef section = {});
11641163

11651164
TypeEntityReference getTypeEntityReference(NominalTypeDecl *D);
11661165

0 commit comments

Comments
 (0)