summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorShoaib Meenai <smeenai@fb.com>2018-06-07 22:54:54 +0000
committerShoaib Meenai <smeenai@fb.com>2018-06-07 22:54:54 +0000
commitd8d154738742244eef1f9f3c4552ef6ff49a297a (patch)
treecfb78b3a50b628e3aab83b33adfb4c3abf34956b /clang/lib/Frontend/CompilerInvocation.cpp
parent77b5be7ec67254fc27e1626989df00f7f7ec44a5 (diff)
downloadbcm5719-llvm-d8d154738742244eef1f9f3c4552ef6ff49a297a.tar.gz
bcm5719-llvm-d8d154738742244eef1f9f3c4552ef6ff49a297a.zip
[Frontend] Disallow non-MSVC exception models for windows-msvc targets
The windows-msvc target is used for MSVC ABI compatibility, including the exceptions model. It doesn't make sense to pair a windows-msvc target with a non-MSVC exception model. This would previously cause an assertion failure; explicitly error out for it in the frontend instead. This also allows us to reduce the matrix of target/exception models a bit (see the modified tests), and we can possibly simplify some of the personality code in a follow-up. Differential Revision: https://reviews.llvm.org/D47853 llvm-svn: 334243
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 46f8c9f235f..b10155da96c 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2344,6 +2344,11 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
options::OPT_fdwarf_exceptions);
if (A) {
const Option &Opt = A->getOption();
+ llvm::Triple T(TargetOpts.Triple);
+ if (T.isWindowsMSVCEnvironment())
+ Diags.Report(diag::err_fe_invalid_exception_model)
+ << Opt.getName() << T.str();
+
Opts.SjLjExceptions = Opt.matches(options::OPT_fsjlj_exceptions);
Opts.SEHExceptions = Opt.matches(options::OPT_fseh_exceptions);
Opts.DWARFExceptions = Opt.matches(options::OPT_fdwarf_exceptions);
OpenPOWER on IntegriCloud