summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-02-10 18:49:11 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-02-10 18:49:11 +0000
commit3241d400c86cf49e243643fdce3a408838754717 (patch)
treeb94a16b52e5a74d7576a8374fc1769387ca15251 /clang/lib/CodeGen
parent535fdaf0201487ce2e7b9a1c12643bdf55173b36 (diff)
downloadbcm5719-llvm-3241d400c86cf49e243643fdce3a408838754717.tar.gz
bcm5719-llvm-3241d400c86cf49e243643fdce3a408838754717.zip
Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling, for Darwin ARM. llvm-svn: 95787
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGException.cpp6
-rw-r--r--clang/lib/CodeGen/CGObjCMac.cpp3
2 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 60a1016cc04..d956c1c3cd8 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -100,10 +100,6 @@ static llvm::Constant *getUnexpectedFn(CodeGenFunction &CGF) {
return CGF.CGM.CreateRuntimeFunction(FTy, "__cxa_call_unexpected");
}
-// FIXME: Eventually this will all go into the backend. Set from the target for
-// now.
-static int using_sjlj_exceptions = 0;
-
static llvm::Constant *getUnwindResumeOrRethrowFn(CodeGenFunction &CGF) {
const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGF.getLLVMContext());
std::vector<const llvm::Type*> Args(1, Int8PtrTy);
@@ -112,7 +108,7 @@ static llvm::Constant *getUnwindResumeOrRethrowFn(CodeGenFunction &CGF) {
llvm::FunctionType::get(llvm::Type::getVoidTy(CGF.getLLVMContext()), Args,
false);
- if (using_sjlj_exceptions)
+ if (CGF.CGM.getLangOptions().SjLjExceptions)
return CGF.CGM.CreateRuntimeFunction(FTy, "_Unwind_SjLj_Resume");
return CGF.CGM.CreateRuntimeFunction(FTy, "_Unwind_Resume_or_Rethrow");
}
diff --git a/clang/lib/CodeGen/CGObjCMac.cpp b/clang/lib/CodeGen/CGObjCMac.cpp
index 2f931bd637a..b0b1a9fe7cf 100644
--- a/clang/lib/CodeGen/CGObjCMac.cpp
+++ b/clang/lib/CodeGen/CGObjCMac.cpp
@@ -738,7 +738,8 @@ public:
return CGM.CreateRuntimeFunction(
llvm::FunctionType::get(llvm::Type::getVoidTy(VMContext),
Params, false),
- "_Unwind_Resume_or_Rethrow");
+ (CGM.getLangOptions().SjLjExceptions ? "_Unwind_SjLj_Resume" :
+ "_Unwind_Resume_or_Rethrow"));
}
llvm::Constant *getObjCEndCatchFn() {
OpenPOWER on IntegriCloud