ObjCExport: make objc_release nounwind

Also replace it by an LLVM intrinsic, llvm.objc.release,
which is lowered to objc_release.

This is close to what Clang does.
This commit is contained in:
Svyatoslav Scherbina
2022-01-13 11:45:08 +03:00
committed by Space
parent 0ad440f112
commit cdfcffbd57
@@ -32,9 +32,10 @@ internal open class ObjCCodeGenerator(val codegen: CodeGenerator) {
val objcRelease = run {
val proto = LlvmFunctionProto(
"objc_release",
"llvm.objc.release",
LlvmRetType(voidType),
listOf(LlvmParamType(int8TypePtr)),
listOf(LlvmFunctionAttribute.NoUnwind),
origin = context.stdlibModule.llvmSymbolOrigin
)
context.llvm.externalFunction(proto)