[IRGen] Make it possible to get address of accessible func record

Runtime metadata attributes need a pointer to a generator that
could be used to instantiate an attribute value.
This commit is contained in:
Pavel Yaskevich
2022-11-29 08:37:55 -08:00
parent b8819373d9
commit 59d6509d55
3 changed files with 11 additions and 1 deletions

View File

@@ -1196,6 +1196,12 @@ Address IRGenModule::getAddrOfObjCISAMask() {
return Address(ObjCISAMaskPtr, IntPtrTy, getPointerAlignment());
}
llvm::Constant *
IRGenModule::getAddrOfAccessibleFunctionRecord(SILFunction *accessibleFn) {
auto entity = LinkEntity::forAccessibleFunctionRecord(accessibleFn);
return getAddrOfLLVMVariable(entity, ConstantInit(), DebugTypeInfo());
}
ModuleDecl *IRGenModule::getSwiftModule() const {
return IRGen.SIL.getSwiftModule();
}