Skip to content

Commit 15383e9

Browse files
committed
[linker] Don't optimize calls to BlockLiteral.SetupBlock in BlockLiteral.CreateBlockForDelegate.
1 parent ea95971 commit 15383e9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tools/linker/CoreOptimizeGeneratedCode.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -938,8 +938,14 @@ int ProcessSetupBlock (MethodDefinition caller, Instruction ins)
938938
if (!mr.DeclaringType.Is (Namespaces.ObjCRuntime, "BlockLiteral"))
939939
return 0;
940940

941-
if (caller.Name == "GetBlockForDelegate" && caller.DeclaringType.Is ("ObjCRuntime", "BlockLiteral"))
942-
return 0; // BlockLiteral.GetBlockForDelegate contains a non-optimizable call to SetupBlock, and this way we don't show any warnings to users about things they can't do anything about.
941+
if (caller.DeclaringType.Is ("ObjCRuntime", "BlockLiteral")) {
942+
switch (caller.Name) {
943+
case "GetBlockForDelegate":
944+
case "CreateBlockForDelegate":
945+
// These methods contain a non-optimizable call to SetupBlock, and this way we don't show any warnings to users about things they can't do anything about.
946+
return 0;
947+
}
948+
}
943949

944950
string signature = null;
945951
try {

0 commit comments

Comments
 (0)