While capturing filters aren't very common, we'd like to outline
__finally blocks in the frontend to simplify -O0 EH preparation and
reduce code size. Finally blocks are usually have captures, and this is
the first step towards that.
Details
Diff Detail
Event Timeline
lib/CodeGen/CGException.cpp | ||
---|---|---|
1363–1364 | Hm, yeah, copy-pasta. | |
1409–1412 | Filter outlining uses frameescape / framerecover to get access to the locals of the parent funciton. llvm.frameescape only supports static allocas. We would have to create a static alloca which contains the address of the VLA and then escape that, which is a pretty invasive change. It seemed better to punt on that for now and keep the patch smaller. |
LGTM.
lib/CodeGen/CGException.cpp | ||
---|---|---|
95–97 | Does this deserve a comment or have we documented this somewhere else? |
lib/CodeGen/CGException.cpp | ||
---|---|---|
95–97 | Thanks, that probably deserves a comment. My thinking was that this more closely mirrors the data that's actually available in the catch block, which is just the exception code in EAX/RAX. |
I ended up reverting the use of i32 for the landingpad value for now. It caused LLVM assertions later on in fastisel only and I couldn't debug it quickly.
Does this deserve a comment or have we documented this somewhere else?