diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-12-08 23:21:26 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-12-08 23:21:26 +0000 |
commit | cc1f918ed4ef8f414d306c02e237a9540c67926e (patch) | |
tree | e429fca6a0a21b2513d5c74d6bc8af9e79d82116 /lib/CodeGen | |
parent | 5fc7def35ee858791e591d005b4ae343632ca931 (diff) |
Don't get the exception obj from the slot more than once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146202 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGException.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/CodeGen/CGException.cpp b/lib/CodeGen/CGException.cpp index 5b5d8b4f02..15d8d42fa2 100644 --- a/lib/CodeGen/CGException.cpp +++ b/lib/CodeGen/CGException.cpp @@ -1523,14 +1523,13 @@ llvm::BasicBlock *CodeGenFunction::getEHResumeBlock() { getExceptionFromSlot()) ->setDoesNotReturn(); } else { - llvm::Value *Exn = getExceptionFromSlot(); - switch (CleanupHackLevel) { case CHL_MandatoryCatchall: // In mandatory-catchall mode, we need to use // _Unwind_Resume_or_Rethrow, or whatever the personality's // equivalent is. - Builder.CreateCall(getUnwindResumeOrRethrowFn(), Exn) + Builder.CreateCall(getUnwindResumeOrRethrowFn(), + getExceptionFromSlot()) ->setDoesNotReturn(); break; case CHL_MandatoryCleanup: { @@ -1554,7 +1553,7 @@ llvm::BasicBlock *CodeGenFunction::getEHResumeBlock() { // In an idealized mode where we don't have to worry about the // optimizer combining landing pads, we should just use // _Unwind_Resume (or the personality's equivalent). - Builder.CreateCall(getUnwindResumeFn(), Exn) + Builder.CreateCall(getUnwindResumeFn(), getExceptionFromSlot()) ->setDoesNotReturn(); break; } |