[ObjC][ARC] Teach the OptimizeSequences step of ObjCARCOpts about WinEH funclet tokens
authorStefan Gränitz <stefan.graenitz@gmail.com>
Tue, 24 Jan 2023 10:37:23 +0000 (11:37 +0100)
committerStefan Gränitz <stefan.graenitz@gmail.com>
Tue, 24 Jan 2023 14:17:18 +0000 (15:17 +0100)
commitd9eece916a8a9b370e1f90e6461c612d12c55729
tree122c82bb0782f967e01354a7abdb5c0c99a5bc29
parent85427941e7e1790aca1aa6c7c3876f9b7571e30d
[ObjC][ARC] Teach the OptimizeSequences step of ObjCARCOpts about WinEH funclet tokens

When optimizing retain-release-sequences we insert (and delete) ObjC runtime calls. These calls need a funclet operand bundle that refers to the enclosing funclet pad whenever they are inserted in a WinEH funclet. WinEH funclets can contain multiple basic blocks. In order to find the enclosing funclet pad, we have to calculate the funclet coloring first.

Reviewed By: ahatanak

Differential Revision: https://reviews.llvm.org/D137944
clang/test/CodeGenObjCXX/arc-exceptions-seh.mm
llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp
llvm/test/Transforms/ObjCARC/funclet-catchpad.ll [new file with mode: 0644]