From a593000f0133bccfeabb5f89b8c9d9533d2106bd Mon Sep 17 00:00:00 2001 From: Reid Kleckner Date: Wed, 11 Feb 2015 21:40:48 +0000 Subject: Add the 'noinline' attribute to call sites within __try bodies LLVM doesn't support non-call exceptions, so inlining makes it harder to catch such asynchronous exceptions. llvm-svn: 228876 --- clang/lib/CodeGen/CGException.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CGException.cpp') diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp index 9df4f97..b8ce205 100644 --- a/clang/lib/CodeGen/CGException.cpp +++ b/clang/lib/CodeGen/CGException.cpp @@ -21,6 +21,7 @@ #include "clang/AST/StmtObjC.h" #include "llvm/IR/CallSite.h" #include "llvm/IR/Intrinsics.h" +#include "llvm/Support/SaveAndRestore.h" using namespace clang; using namespace CodeGen; @@ -1703,7 +1704,11 @@ void CodeGenFunction::EmitSEHTryStmt(const SEHTryStmt &S) { SEHFinallyInfo FI; EnterSEHTryStmt(S, FI); - EmitStmt(S.getTryBlock()); + { + // Disable inlining inside SEH __try scopes. + SaveAndRestore Saver(IsSEHTryScope, true); + EmitStmt(S.getTryBlock()); + } ExitSEHTryStmt(S, FI); } -- cgit v1.1