summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-07-12 00:15:30 +0000
committerJohn McCall <rjmccall@apple.com>2011-07-12 00:15:30 +0000
commit5fcf8da33dfb9a54f047718223ddba16a263f6c1 (patch)
tree75ba783c9f84f57aaa7c8e5e0c1f667c1fe83d89 /clang/lib/CodeGen/CGException.cpp
parentcdc2297ee1475125b2b55edb61df14b722c2cc10 (diff)
downloadbcm5719-llvm-5fcf8da33dfb9a54f047718223ddba16a263f6c1.tar.gz
bcm5719-llvm-5fcf8da33dfb9a54f047718223ddba16a263f6c1.zip
Do full-expression cleanups in a much more sensible way that still lets
people write useful cleanup classes. llvm-svn: 134942
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 35429e3b841..c25b9a68831 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/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();
}
OpenPOWER on IntegriCloud