Native: remove cleanup landingpad if it is unused
Useful for ObjCExport, because most of its bridges don't use it.
This commit is contained in:
committed by
Space
parent
47a0bdc1bc
commit
ec3a2c9671
+4
-1
@@ -1510,7 +1510,10 @@ internal abstract class FunctionGenerationContext(
|
|||||||
|
|
||||||
processReturns()
|
processReturns()
|
||||||
|
|
||||||
if (!needCleanupLandingpadAndLeaveFrame) {
|
// If cleanup landingpad is trivial or unused, remove it.
|
||||||
|
// It would be great not to generate it in the first place in this case,
|
||||||
|
// but this would be complicated without a major refactoring.
|
||||||
|
if (!needCleanupLandingpadAndLeaveFrame || invokeInstructions.isEmpty()) {
|
||||||
// Replace invokes with calls and branches.
|
// Replace invokes with calls and branches.
|
||||||
invokeInstructions.forEach { functionInvokeInfo ->
|
invokeInstructions.forEach { functionInvokeInfo ->
|
||||||
positionBefore(functionInvokeInfo.invokeInstruction)
|
positionBefore(functionInvokeInfo.invokeInstruction)
|
||||||
|
|||||||
Reference in New Issue
Block a user