summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-12-08 23:21:26 +0000
committerBill Wendling <isanbard@gmail.com>2011-12-08 23:21:26 +0000
commit90118a3c9bf41365b702784938eb6016a62acd6c (patch)
tree11c34189b5f5404470983b099e67aa2f8dd20b99 /clang/lib/CodeGen/CGException.cpp
parent8cc83fa1b75bc3f520e30478e165a51f1f30cf51 (diff)
downloadbcm5719-llvm-90118a3c9bf41365b702784938eb6016a62acd6c.tar.gz
bcm5719-llvm-90118a3c9bf41365b702784938eb6016a62acd6c.zip
Don't get the exception obj from the slot more than once.
llvm-svn: 146202
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 5b5d8b4f023..15d8d42fa2c 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud