diff options
author | John McCall <rjmccall@apple.com> | 2016-01-27 18:32:30 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2016-01-27 18:32:30 +0000 |
commit | e399e5bd3d4498280239fae73695bbde414fb652 (patch) | |
tree | 433d1d93b5317f6e95d7ee723b35a2c90829705d /clang/lib/CodeGen/CodeGenModule.h | |
parent | 14bf877e6bce2e079642966769d533c42c273af4 (diff) | |
download | llvm-e399e5bd3d4498280239fae73695bbde414fb652.zip llvm-e399e5bd3d4498280239fae73695bbde414fb652.tar.gz llvm-e399e5bd3d4498280239fae73695bbde414fb652.tar.bz2 |
Emit calls to objc_unsafeClaimAutoreleasedReturnValue when
reclaiming a call result in order to ignore it or assign it
to an __unsafe_unretained variable. This avoids adding
an unwanted retain/release pair when the return value is
not actually returned autoreleased (e.g. when it is returned
from a nonatomic getter or a typical collection accessor).
This runtime function is only available on the latest Apple
OS releases; the backwards-compatibility story is that you
don't get the optimization unless your deployment target is
recent enough. Sorry.
rdar://20530049
llvm-svn: 258962
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 74087be3..00119c3 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -166,6 +166,9 @@ struct ObjCEntrypoints { /// id objc_storeWeak(id*, id); llvm::Constant *objc_storeWeak; + /// id objc_unsafeClaimAutoreleasedReturnValue(id); + llvm::Constant *objc_unsafeClaimAutoreleasedReturnValue; + /// A void(void) inline asm to use to mark that the return value of /// a call will be immediately retain. llvm::InlineAsm *retainAutoreleasedReturnValueMarker; |