summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-09-15 17:19:16 +0000
committerReid Kleckner <reid@kleckner.net>2014-09-15 17:19:16 +0000
commit8f45c9cc6232e5b841bc92b7f2ea9a792574c317 (patch)
treeca02cb3bb22061ee5df66fe47f1130b37e010f63 /clang/lib/CodeGen/CGException.cpp
parent49dd4283edb8a86dd7166060802dfaf946f96c6c (diff)
downloadbcm5719-llvm-8f45c9cc6232e5b841bc92b7f2ea9a792574c317.tar.gz
bcm5719-llvm-8f45c9cc6232e5b841bc92b7f2ea9a792574c317.zip
Add -fseh-exceptions for MinGW-w64
This adds a flag called -fseh-exceptions that uses the native Windows .pdata and .xdata unwind mechanism to throw exceptions. The other EH possibilities are DWARF and SJLJ exceptions. Patch by Martell Malone! Reviewed By: asl, rnk Differential Revision: http://reviews.llvm.org/D3419 llvm-svn: 217790
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index 05eb6ebca30..0b7e57a3c5f 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -137,12 +137,14 @@ namespace {
static const EHPersonality &get(const LangOptions &Lang);
static const EHPersonality GNU_C;
static const EHPersonality GNU_C_SJLJ;
+ static const EHPersonality GNU_C_SEH;
static const EHPersonality GNU_ObjC;
static const EHPersonality GNUstep_ObjC;
static const EHPersonality GNU_ObjCXX;
static const EHPersonality NeXT_ObjC;
static const EHPersonality GNU_CPlusPlus;
static const EHPersonality GNU_CPlusPlus_SJLJ;
+ static const EHPersonality GNU_CPlusPlus_SEH;
};
}
@@ -150,12 +152,16 @@ const EHPersonality EHPersonality::GNU_C = { "__gcc_personality_v0", nullptr };
const EHPersonality
EHPersonality::GNU_C_SJLJ = { "__gcc_personality_sj0", nullptr };
const EHPersonality
+EHPersonality::GNU_C_SEH = { "__gcc_personality_seh0", nullptr };
+const EHPersonality
EHPersonality::NeXT_ObjC = { "__objc_personality_v0", nullptr };
const EHPersonality
EHPersonality::GNU_CPlusPlus = { "__gxx_personality_v0", nullptr };
const EHPersonality
EHPersonality::GNU_CPlusPlus_SJLJ = { "__gxx_personality_sj0", nullptr };
const EHPersonality
+EHPersonality::GNU_CPlusPlus_SEH = { "__gxx_personality_seh0", nullptr };
+const EHPersonality
EHPersonality::GNU_ObjC = {"__gnu_objc_personality_v0", "objc_exception_throw"};
const EHPersonality
EHPersonality::GNU_ObjCXX = { "__gnustep_objcxx_personality_v0", nullptr };
@@ -165,6 +171,8 @@ EHPersonality::GNUstep_ObjC = { "__gnustep_objc_personality_v0", nullptr };
static const EHPersonality &getCPersonality(const LangOptions &L) {
if (L.SjLjExceptions)
return EHPersonality::GNU_C_SJLJ;
+ if (L.SEHExceptions)
+ return EHPersonality::GNU_C_SEH;
return EHPersonality::GNU_C;
}
@@ -189,6 +197,8 @@ static const EHPersonality &getObjCPersonality(const LangOptions &L) {
static const EHPersonality &getCXXPersonality(const LangOptions &L) {
if (L.SjLjExceptions)
return EHPersonality::GNU_CPlusPlus_SJLJ;
+ else if (L.SEHExceptions)
+ return EHPersonality::GNU_CPlusPlus_SEH;
else
return EHPersonality::GNU_CPlusPlus;
}
OpenPOWER on IntegriCloud