diff options
author | John McCall <rjmccall@apple.com> | 2011-07-12 00:15:30 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-07-12 00:15:30 +0000 |
commit | c4a1a8450a3613ef256a71b9d8305b41f79eef50 (patch) | |
tree | b3b71e31cbd4e1c9b72d17514c3bb8d21daa000e /lib/CodeGen/CGException.cpp | |
parent | e02d391ffef647ba0d48b85e211a94d9fb83393f (diff) |
Do full-expression cleanups in a much more sensible way that still lets
people write useful cleanup classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134942 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGException.cpp')
-rw-r--r-- | lib/CodeGen/CGException.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 35429e3b84..c25b9a6883 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -323,9 +323,10 @@ static llvm::Constant *getCleanupValue(CodeGenFunction &CGF) { namespace { /// A cleanup to free the exception object if its initialization /// throws. - struct FreeException { - static void Emit(CodeGenFunction &CGF, bool forEH, - llvm::Value *exn) { + struct FreeException : EHScopeStack::Cleanup { + llvm::Value *exn; + FreeException(llvm::Value *exn) : exn(exn) {} + void Emit(CodeGenFunction &CGF, bool forEH) { CGF.Builder.CreateCall(getFreeExceptionFn(CGF), exn) ->setDoesNotThrow(); } |