This is an archive of the discontinued LLVM Phabricator instance.

Remap arguments and non-alloca values used by outlined C++ exception handlers.
ClosedPublic

Authored by andrew.w.kaylor on Feb 23 2015, 5:14 PM.

Details

Summary

This patch updates the native Windows exception handler prepare pass to outline arguments and non-alloca values that are referenced in outlined handler functions, assigning a slot in the frame allocation block for the referenced values and spilling them to that location.

Diff Detail

Repository
rL LLVM

Event Timeline

andrew.w.kaylor retitled this revision from to Remap arguments and non-alloca values used by outlined C++ exception handlers..
andrew.w.kaylor updated this object.
andrew.w.kaylor edited the test plan for this revision. (Show Details)
andrew.w.kaylor added reviewers: rnk, majnemer, ABataev.
andrew.w.kaylor set the repository for this revision to rL LLVM.
andrew.w.kaylor added a subscriber: Unknown Object (MLST).
rnk accepted this revision.Feb 24 2015, 11:07 AM
rnk edited edge metadata.

lgtm

Can you make sure these files aren't committed with DOS line endings? The last few commits have had them.

Ultimately I want to come up with a better solution than Demote*ToStack, but it'll work for now.

lib/CodeGen/WinEHPrepare.cpp
343 ↗(On Diff #20557)

If the cast can never fail, use cast<> over dyn_cast<> so that it's checked with an assertion. Otherwise the ++II will just crash in a less obvious way.

370–372 ↗(On Diff #20557)

While LLVM does elide braces when possible, we usually try to stay consistent with braces or no braces across an else-if chain.

373–374 ↗(On Diff #20557)

This is just cast<Instruction>(ParentVal);

This revision is now accepted and ready to land.Feb 24 2015, 11:07 AM
andrew.w.kaylor edited edge metadata.

Minor updates based on review feedback.

majnemer accepted this revision.Mar 2 2015, 4:00 PM
majnemer edited edge metadata.

LGTM

This revision was automatically updated to reflect the committed changes.