diff options
author | John McCall <rjmccall@apple.com> | 2011-01-26 19:15:39 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-01-26 19:15:39 +0000 |
commit | 4bbcbda302cba8b1b0d88c20d735d09b483bd005 (patch) | |
tree | c34aff62be9783d6c1ab505f5aa1972132207593 /lib/CodeGen/CodeGenFunction.h | |
parent | 192e7f7e7f0493f7cdfda1d752e6de340d4e3ffe (diff) |
Fix some obvious bugs in the conditional-cleanup code and then make the
dtor cleanup use it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124309 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenFunction.h')
-rw-r--r-- | lib/CodeGen/CodeGenFunction.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index ea362d3bf1..dcd6173763 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -214,6 +214,7 @@ public: template <class T, class A0, class A1> class UnconditionalCleanup2 : public Cleanup { A0 a0; A1 a1; + public: UnconditionalCleanup2(A0 a0, A1 a1) : a0(a0), a1(a1) {} void Emit(CodeGenFunction &CGF, bool IsForEHCleanup) { T::Emit(CGF, IsForEHCleanup, a0, a1); @@ -226,17 +227,18 @@ public: class ConditionalCleanup2 : public ConditionalCleanup { typedef typename SavedValueInCond<A0>::saved_type A0_saved; typedef typename SavedValueInCond<A1>::saved_type A1_saved; - A0_saved a0; A1_saved a1; + A0_saved a0_saved; + A1_saved a1_saved; void EmitImpl(CodeGenFunction &CGF, bool IsForEHCleanup) { - A0 a0 = SavedValueInCond<A0>::restore(CGF, a0); - A1 a1 = SavedValueInCond<A1>::restore(CGF, a1); + A0 a0 = SavedValueInCond<A0>::restore(CGF, a0_saved); + A1 a1 = SavedValueInCond<A1>::restore(CGF, a1_saved); T::Emit(CGF, IsForEHCleanup, a0, a1); } public: ConditionalCleanup2(llvm::Value *cond, A0_saved a0, A1_saved a1) - : ConditionalCleanup(cond), a0(a0), a1(a1) {} + : ConditionalCleanup(cond), a0_saved(a0), a1_saved(a1) {} }; private: |