[PATCH] D14737: Convert some ObjC msgSends to runtime calls

John McCall via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 19 17:13:44 PST 2015


rjmccall added a comment.

The casts done by emitARCValueOperation will handle the input, but they don't quite handle the result properly.  The right test case here is a method named "retain" that's declared to return something completely unrelated to its receiver type, e.g.

  @class A;
  @interface B
  - (A*) retain;
  @end

You should also add a test case for unusual return types that your mechanism just can't support and that need to go through the ordinary message-send emission, like returning a float.


================
Comment at: test/CodeGenObjC/convert-messages-to-runtime-calls.m:62
@@ +61,3 @@
+
+// Make sure we can convert a message to a dynamic receiver to a call
+// CHECK-LABEL: define {{.*}}void @retain_self
----------------
You already test this case.  If you make retain_self a class method, this will be a class message; but it should still be okay to use objc_retain.


http://reviews.llvm.org/D14737





More information about the cfe-commits mailing list