Skip to content

Commit f11ba15

Browse files
authored
Merge pull request #62150 from tshortli/move-uses-objc-allocator-to-sil
2 parents f63de71 + efd5c1e commit f11ba15

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/SIL/IR/SILModule.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,3 +953,9 @@ SourceLoc swift::extractNearestSourceLoc(const SILModule *M) {
953953
return SourceLoc();
954954
return extractNearestSourceLoc(M->getSwiftModule());
955955
}
956+
957+
bool Lowering::usesObjCAllocator(ClassDecl *theClass) {
958+
// If the root class was implemented in Objective-C, use Objective-C's
959+
// allocation methods because they may have been overridden.
960+
return theClass->getObjectModel() == ReferenceCounting::ObjC;
961+
}

lib/SILGen/SILGenConstructor.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -611,12 +611,6 @@ void SILGenFunction::emitEnumConstructor(EnumElementDecl *element) {
611611
}
612612
}
613613

614-
bool Lowering::usesObjCAllocator(ClassDecl *theClass) {
615-
// If the root class was implemented in Objective-C, use Objective-C's
616-
// allocation methods because they may have been overridden.
617-
return theClass->getObjectModel() == ReferenceCounting::ObjC;
618-
}
619-
620614
void SILGenFunction::emitClassConstructorAllocator(ConstructorDecl *ctor) {
621615
assert(!ctor->isFactoryInit() && "factories should not be emitted here");
622616

0 commit comments

Comments
 (0)