summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGException.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2015-09-17 17:04:13 +0000
committerReid Kleckner <rnk@google.com>2015-09-17 17:04:13 +0000
commit01485654db8031fcc94158a437fdf23c4fdfe97a (patch)
treefb8c7533977058dedbf2f4e62ac878b6516a52b4 /clang/lib/CodeGen/CGException.cpp
parent841cce1ae902a7cf069afca719b1615552e28d8f (diff)
downloadbcm5719-llvm-01485654db8031fcc94158a437fdf23c4fdfe97a.tar.gz
bcm5719-llvm-01485654db8031fcc94158a437fdf23c4fdfe97a.zip
Use the MSVC SEH personalities on Mingw
Mingw generally wraps an old copy of msvcrt.dll which has these personalities, so things should work out, or so I hear. I haven't tested it. llvm-svn: 247902
Diffstat (limited to 'clang/lib/CodeGen/CGException.cpp')
-rw-r--r--clang/lib/CodeGen/CGException.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGException.cpp b/clang/lib/CodeGen/CGException.cpp
index c5b1c102eea..85204f4c9af 100644
--- a/clang/lib/CodeGen/CGException.cpp
+++ b/clang/lib/CodeGen/CGException.cpp
@@ -189,14 +189,16 @@ const EHPersonality &EHPersonality::get(CodeGenModule &CGM,
const llvm::Triple &T = CGM.getTarget().getTriple();
const LangOptions &L = CGM.getLangOpts();
+ // Functions using SEH get an SEH personality.
+ if (FD && FD->usesSEHTry())
+ return getSEHPersonalityMSVC(T);
+
// Try to pick a personality function that is compatible with MSVC if we're
// not compiling Obj-C. Obj-C users better have an Obj-C runtime that supports
// the GCC-style personality function.
if (T.isWindowsMSVCEnvironment() && !L.ObjC1) {
if (L.SjLjExceptions)
return EHPersonality::GNU_CPlusPlus_SJLJ;
- else if (FD && FD->usesSEHTry())
- return getSEHPersonalityMSVC(T);
else
return EHPersonality::MSVC_CxxFrameHandler3;
}
OpenPOWER on IntegriCloud