summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-16 00:44:00 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-16 00:44:00 +0000
commitc278d1b3b95b420b3e59c593ab02700025906b91 (patch)
tree3e92aa3b3a2d6587273bd79ab07630363f9581d4 /clang/lib/CodeGen/CGException.cpp
parent1b8b8bf25f9347c6786616313a1c091bf496ea98 (diff)
downloadbcm5719-llvm-c278d1b3b95b420b3e59c593ab02700025906b91.tar.gz
bcm5719-llvm-c278d1b3b95b420b3e59c593ab02700025906b91.zip
Revert r103880 (thread-safe static initialization w/ exceptions),
because it's causing strange linker errors. Unfixes PR7144. llvm-svn: 103890
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp27
1 files changed, 11 insertions, 16 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 76a57d6f55a..c1d05bf233b 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -239,23 +239,19 @@ static void CopyObject(CodeGenFunction &CGF, QualType ObjectType,
}
}
-void CodeGenFunction::EmitRethrow() {
- if (getInvokeDest()) {
- llvm::BasicBlock *Cont = createBasicBlock("invoke.cont");
- Builder.CreateInvoke(getReThrowFn(*this), Cont, getInvokeDest())
- ->setDoesNotReturn();
- EmitBlock(Cont);
- } else
- Builder.CreateCall(getReThrowFn(*this))->setDoesNotReturn();
- Builder.CreateUnreachable();
-
- // Clear the insertion point to indicate we are in unreachable code.
- Builder.ClearInsertionPoint();
-}
-
void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) {
if (!E->getSubExpr()) {
- EmitRethrow();
+ if (getInvokeDest()) {
+ llvm::BasicBlock *Cont = createBasicBlock("invoke.cont");
+ Builder.CreateInvoke(getReThrowFn(*this), Cont, getInvokeDest())
+ ->setDoesNotReturn();
+ EmitBlock(Cont);
+ } else
+ Builder.CreateCall(getReThrowFn(*this))->setDoesNotReturn();
+ Builder.CreateUnreachable();
+
+ // Clear the insertion point to indicate we are in unreachable code.
+ Builder.ClearInsertionPoint();
return;
}
@@ -566,7 +562,6 @@ void CodeGenFunction::ExitCXXTryStmt(const CXXTryStmt &S,
// FIXME: we need to do this sooner so that the EH region for the
// cleanup doesn't start until after the ctor completes, use a decl
// init?
- // FIXME: Alternatively, can we just elide this copy entirely?
CopyObject(*this, CatchParam->getType().getNonReferenceType(),
WasPointer, WasPointerReference, ExcObject,
GetAddrOfLocalVar(CatchParam));
OpenPOWER on IntegriCloud