]> granicus.if.org Git - clang/commit
[SEH] Add 32-bit lowering code for __try
authorReid Kleckner <reid@kleckner.net>
Tue, 28 Apr 2015 22:19:32 +0000 (22:19 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 28 Apr 2015 22:19:32 +0000 (22:19 +0000)
commit24fca8241f48861e817b53f08c8a9455bd160b40
tree58d3646241bda63ff71f314ae2ca2ae14f1eab08
parent2b3918a8e84b0865ae3026a6d52e2dcf1d9277a0
[SEH] Add 32-bit lowering code for __try

This is just the clang-side of 32-bit SEH. LLVM still needs work, and it
will determinstically fail to compile until it's feature complete.

On x86, all outlined handlers have no parameters, but they do implicitly
take the EBP value passed in and use it to address locals of the parent
frame. We model this with llvm.frameaddress(1).

This works (mostly), but __finally block inlining can break it. For now,
we apply the 'noinline' attribute. If we really want to inline __finally
blocks on 32-bit x86, we should teach the inliner how to untangle
frameescape and framerecover.

Promote the error diagnostic from codegen to sema. It now rejects SEH on
non-Windows platforms. LLVM doesn't implement SEH on non-x86 Windows
platforms, but there's nothing preventing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236052 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Basic/TargetInfo.h
lib/CodeGen/CGException.cpp
lib/CodeGen/CodeGenFunction.cpp
lib/CodeGen/CodeGenFunction.h
lib/Sema/SemaStmt.cpp
test/CodeGen/exceptions-seh-finally.c
test/CodeGen/exceptions-seh.c