diff options
author | Akira Hatanaka <ahatanaka@apple.com> | 2020-03-13 12:15:17 -0700 |
---|---|---|
committer | Akira Hatanaka <ahatanaka@apple.com> | 2020-03-13 13:52:14 -0700 |
commit | c6f1713c46e61bbb8ece9ac5ac329d02e7f93228 (patch) | |
tree | 77b30b52455c7938bcb5eba64eedd408815f3212 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | c262b69dcc0a280ec4d551244b3571123c36a370 (diff) | |
download | llvm-c6f1713c46e61bbb8ece9ac5ac329d02e7f93228.zip llvm-c6f1713c46e61bbb8ece9ac5ac329d02e7f93228.tar.gz llvm-c6f1713c46e61bbb8ece9ac5ac329d02e7f93228.tar.bz2 |
[ObjC][ARC] Don't remove autoreleaseRV/retainRV pairs if the call isn't
a tail call
This reapplies the patch in https://reviews.llvm.org/rG1f5b471b8bf4,
which was reverted because it was causing crashes.
https://bugs.chromium.org/p/chromium/issues/detail?id=1061289#c2
Check that HasSafePathToCall is true before checking the call is a tail
call.
Original commit message:
Previosly ARC optimizer removed the autoreleaseRV/retainRV pair in the
following code, which caused the object returned by @something to be
placed in the autorelease pool because the call to @something isn't a
tail call:
```
%call = call i8* @something(...)
%2 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call)
%3 = call i8* @objc_autoreleaseReturnValue(i8* %2)
ret i8* %3
```
Fix the bug by checking whether @something is a tail call.
rdar://problem/59275894
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
0 files changed, 0 insertions, 0 deletions