This is an archive of the discontinued LLVM Phabricator instance.

[SEH] Add 32-bit lowering for SEH __try
ClosedPublic

Authored by rnk on Jun 30 2015, 3:48 PM.

Details

Summary

This re-lands r236052 and adds support for __exception_code().

In 32-bit SEH, the exception code is not available in eax. It is only
available in the filter function, and now we arrange to load it and
store it into an escaped variable in the parent frame.

As a consequence, we have to disable the "catch i8* null" optimization
on 32-bit and always generate a filter function. We can re-enable the
optimization if we detect an __except block that doesn't use the
exception code, but this probably isn't worth optimizing.

Diff Detail

Event Timeline

rnk updated this revision to Diff 28821.Jun 30 2015, 3:48 PM
rnk retitled this revision from to [SEH] Add 32-bit lowering for SEH __try.
rnk added a reviewer: majnemer.
rnk updated this object.
rnk added a subscriber: Unknown Object (MLST).
majnemer added inline comments.Jun 30 2015, 4:05 PM
lib/CodeGen/CGException.cpp
1309–1313

I bet ARM is more like x86_64 than x86_32. Perhaps we should have != llvm::Triple::x86

1459–1466

Ditto here for ARM.

This revision was automatically updated to reflect the committed changes.