[CodeGenObjC] Handle exceptions when calling objc_alloc or objc_allocWithZone
authorErik Pilkington <erik.pilkington@gmail.com>
Wed, 30 Jan 2019 23:17:38 +0000 (23:17 +0000)
committerErik Pilkington <erik.pilkington@gmail.com>
Wed, 30 Jan 2019 23:17:38 +0000 (23:17 +0000)
commit1f7eda5aac1dd9abd754044ba9883d4e81cc08c0
tree37768be81e35c7beb77ee208167d63785b6c15e3
parent547a83b4ebd1cbbe90b092634bf1d909ded48555
[CodeGenObjC] Handle exceptions when calling objc_alloc or objc_allocWithZone

objc_alloc and objc_allocWithZone may throw exceptions if the
underlying method does. If we're in a @try block, then make sure we
emit an invoke instead of a call.

rdar://47610407

Differential revision: https://reviews.llvm.org/D57476

llvm-svn: 352687
clang/lib/CodeGen/CGObjC.cpp
clang/test/CodeGenObjC/convert-messages-to-runtime-calls.m