[PATCH] D41050: Fix over-release of return value of lambda implicitly converted to block/function pointer

Dan Zimmerman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 08:58:33 PST 2017

danzimm added a comment.

Ah, just found test/Transforms/ObjCARC/rv.ll test3:

  ; Delete a redundant retainRV,autoreleaseRV when forwaring a call result
  ; directly to a return value.
  ; CHECK-LABEL: define i8* @test3(
  ; CHECK: call i8* @returner()
  ; CHECK-NEXT: ret i8* %call
  define i8* @test3() {
    %call = call i8* @returner()
    %0 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call) nounwind
    %1 = call i8* @objc_autoreleaseReturnValue(i8* %0) nounwind
    ret i8* %1

  rC Clang


More information about the cfe-commits mailing list