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
- Repository
- rL LLVM
Event Timeline
lib/CodeGen/CGException.cpp | ||
---|---|---|
1363–1364 ↗ | (On Diff #23242) | Range-based for? |
1409–1412 ↗ | (On Diff #23242) | Why is this forbidden? Can't we just capture the address of the VLA? |
lib/CodeGen/CGException.cpp | ||
---|---|---|
1363–1364 ↗ | (On Diff #23242) | Hm, yeah, copy-pasta. |
1409–1412 ↗ | (On Diff #23242) | 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 ↗ | (On Diff #23297) | Does this deserve a comment or have we documented this somewhere else? |
lib/CodeGen/CGException.cpp | ||
---|---|---|
95–97 ↗ | (On Diff #23297) | 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.