]> granicus.if.org Git - clang/commitdiff
CodeGen: indicate to the backend the exception model
authorSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 24 May 2016 03:21:01 +0000 (03:21 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Tue, 24 May 2016 03:21:01 +0000 (03:21 +0000)
Thread through -fsjlj-exceptions to the backend via the TargetOptions.  This is
in preparation for supporting SjLj exceptions on x86 (e.g. for MinGW).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270528 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index 2de897b51d1b05d2b6cc1f05362a6ca7b83f393a..e2bbedd500d55bb08057c6c01d5832b6b7a86917 100644 (file)
@@ -591,6 +591,9 @@ TargetMachine *EmitAssemblyHelper::CreateTargetMachine(bool MustCreateTM) {
                             .Case("gnu", llvm::EABI::GNU)
                             .Default(llvm::EABI::Default);
 
+  if (LangOpts.SjLjExceptions)
+    Options.ExceptionModel = llvm::ExceptionHandling::SjLj;
+
   Options.LessPreciseFPMADOption = CodeGenOpts.LessPreciseFPMAD;
   Options.NoInfsFPMath = CodeGenOpts.NoInfsFPMath;
   Options.NoNaNsFPMath = CodeGenOpts.NoNaNsFPMath;