From: Saleem Abdulrasool Date: Tue, 24 May 2016 03:21:01 +0000 (+0000) Subject: CodeGen: indicate to the backend the exception model X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=01f47f5d3ea564edfd3cf184aa9a08230f621b61;p=clang CodeGen: indicate to the backend the exception model 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 --- diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 2de897b51d..e2bbedd500 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -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;