summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorMartell Malone <martellmalone@gmail.com>2017-11-29 06:51:27 +0000
committerMartell Malone <martellmalone@gmail.com>2017-11-29 06:51:27 +0000
commit2fa25706ed4bfd4184e15f38657636ff94e35745 (patch)
treee1fb3f2f2e4f3e17cee504da8d9c73ade56bdf5a /clang/lib/CodeGen/CGException.cpp
parent390cfcb0b1df73b7b2a13e02f63dff46e8fe09cd (diff)
downloadbcm5719-llvm-2fa25706ed4bfd4184e15f38657636ff94e35745.tar.gz
bcm5719-llvm-2fa25706ed4bfd4184e15f38657636ff94e35745.zip
Revert "Toolchain: Normalize dwarf, sjlj and seh eh"
This reverts rL319294. The windows sanitizer does not like seh on x86. Will re apply with None type for x86 llvm-svn: 319295
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index d6a9538bc1f..6a421e81dff 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -112,11 +112,17 @@ EHPersonality::MSVC_C_specific_handler = { "__C_specific_handler", nullptr };
const EHPersonality
EHPersonality::MSVC_CxxFrameHandler3 = { "__CxxFrameHandler3", nullptr };
+/// On Win64, use libgcc's SEH personality function. We fall back to dwarf on
+/// other platforms, unless the user asked for SjLj exceptions.
+static bool useLibGCCSEHPersonality(const llvm::Triple &T) {
+ return T.isOSWindows() && T.getArch() == llvm::Triple::x86_64;
+}
+
static const EHPersonality &getCPersonality(const llvm::Triple &T,
const LangOptions &L) {
if (L.SjLjExceptions)
return EHPersonality::GNU_C_SJLJ;
- if (L.SEHExceptions)
+ else if (useLibGCCSEHPersonality(T))
return EHPersonality::GNU_C_SEH;
return EHPersonality::GNU_C;
}
@@ -138,7 +144,7 @@ static const EHPersonality &getObjCPersonality(const llvm::Triple &T,
case ObjCRuntime::ObjFW:
if (L.SjLjExceptions)
return EHPersonality::GNU_ObjC_SJLJ;
- if (L.SEHExceptions)
+ else if (useLibGCCSEHPersonality(T))
return EHPersonality::GNU_ObjC_SEH;
return EHPersonality::GNU_ObjC;
}
@@ -149,7 +155,7 @@ static const EHPersonality &getCXXPersonality(const llvm::Triple &T,
const LangOptions &L) {
if (L.SjLjExceptions)
return EHPersonality::GNU_CPlusPlus_SJLJ;
- if (L.SEHExceptions)
+ else if (useLibGCCSEHPersonality(T))
return EHPersonality::GNU_CPlusPlus_SEH;
return EHPersonality::GNU_CPlusPlus;
}
@@ -205,10 +211,6 @@ const EHPersonality &EHPersonality::get(CodeGenModule &CGM,
if (T.isWindowsMSVCEnvironment() && !L.ObjC1) {
if (L.SjLjExceptions)
return EHPersonality::GNU_CPlusPlus_SJLJ;
- if (L.SEHExceptions)
- return EHPersonality::GNU_CPlusPlus_SEH;
- if (L.DWARFExceptions)
- return EHPersonality::GNU_CPlusPlus;
else
return EHPersonality::MSVC_CxxFrameHandler3;
}
OpenPOWER on IntegriCloud