[CodeGen][ObjC] Don't try to retain a __unsafe_unretained ARC pointer
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 6 May 2020 19:28:36 +0000 (12:28 -0700)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 6 May 2020 19:47:17 +0000 (12:47 -0700)
commitdc4e25d4f238afb171aacb3774e1162c69574a0a
tree66b2061874e43b1a270370d77e286d70babcbf38
parentf03b6e785b3469742b9853d855a6e9e81960af0a
[CodeGen][ObjC] Don't try to retain a __unsafe_unretained ARC pointer
passed to __builtin_os_log_format to extend its lifetime to the end of
its enclosing block

Extend only lifetimes of pointers returned by function calls or message
sends instead. In the long term, we should lifetime-extend pointers in
more complex expressions and non-ARC objects (e.g., C++ temporaries)
too.

rdar://problem/61846261
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGenObjC/os_log.m