mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Use isa-masking to read the class object pointer from
instances of Swift subclasses of ObjC classes. We were already doing this in the runtime. This patch unhides the runtime's mask word (swift_isaMask) and makes IR-gen take advantage of it when it can. Swift SVN r21592
This commit is contained in:
@@ -380,6 +380,16 @@ llvm::Constant *IRGenModule::getObjCEmptyVTablePtr() {
|
||||
return ObjCEmptyVTablePtr;
|
||||
}
|
||||
|
||||
Address IRGenModule::getAddrOfObjCISAMask() {
|
||||
// This symbol is only exported by the runtime if the platform uses
|
||||
// isa masking.
|
||||
assert(TargetInfo.hasISAMasking());
|
||||
if (!ObjCISAMaskPtr) {
|
||||
ObjCISAMaskPtr = Module.getOrInsertGlobal("swift_isaMask", IntPtrTy);
|
||||
}
|
||||
return Address(ObjCISAMaskPtr, getPointerAlignment());
|
||||
}
|
||||
|
||||
llvm::Module *IRGenModule::getModule() const {
|
||||
return ClangCodeGen->GetModule();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user