diff options
| author | Reid Kleckner <reid@kleckner.net> | 2015-04-07 00:09:59 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2015-04-07 00:09:59 +0000 |
| commit | 67cf035a994bdbe87183751775d4bc7b816f52b1 (patch) | |
| tree | f2e0c3dd3461e13803e3550b9d75af92c435e6c4 /clang/test/CodeGenCXX | |
| parent | cc11b6c1fe006ff63d44718292d347eeb947a55a (diff) | |
| download | bcm5719-llvm-67cf035a994bdbe87183751775d4bc7b816f52b1.tar.gz bcm5719-llvm-67cf035a994bdbe87183751775d4bc7b816f52b1.zip | |
[WinEH] Don't create an alloca for unnamed catch parameters
The catch object parameter to llvm.eh.begincatch is optional, and can be
null. We can save some ourselves the stack space, copy ctor, and dtor
calls if we pass null.
llvm-svn: 234264
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-eh-catch.cpp | 12 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/microsoft-abi-try-throw.cpp | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/CodeGenCXX/microsoft-abi-eh-catch.cpp b/clang/test/CodeGenCXX/microsoft-abi-eh-catch.cpp index 15edef3d131..292fad2e4d6 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-eh-catch.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-eh-catch.cpp @@ -48,6 +48,18 @@ extern "C" void catch_int() { // WIN64: call void @handle_exception(i8* %[[e_i8]]) // WIN64: call void @llvm.eh.endcatch() +extern "C" void catch_int_unnamed() { + try { + might_throw(); + } catch (int) { + } +} + +// WIN64-LABEL: define void @catch_int_unnamed() +// WIN64: landingpad { i8*, i32 } +// WIN64: call void @llvm.eh.begincatch(i8* %{{.*}}, i8* null) +// WIN64: call void @llvm.eh.endcatch() + struct A { A(); A(const A &o); diff --git a/clang/test/CodeGenCXX/microsoft-abi-try-throw.cpp b/clang/test/CodeGenCXX/microsoft-abi-try-throw.cpp index a3a45a54685..fed39761714 100644 --- a/clang/test/CodeGenCXX/microsoft-abi-try-throw.cpp +++ b/clang/test/CodeGenCXX/microsoft-abi-try-throw.cpp @@ -21,7 +21,7 @@ int main() { external(); // TRY: invoke void @"\01?external@@YAXXZ" } catch (int) { rv = 1; - // TRY: call void @llvm.eh.begincatch(i8* %{{.*}}, i8* %{{.*}}) + // TRY: call void @llvm.eh.begincatch(i8* %{{.*}}, i8* null) // TRY: call void @llvm.eh.endcatch() } #endif |

