From 573255b47eb9b210e74a1c620fee363dfaa52794 Mon Sep 17 00:00:00 2001 From: Jan Svoboda Date: Tue, 15 Dec 2020 09:41:11 +0100 Subject: [clang][cli] Squash exception model in LangOptions into one member This squashes multiple members in LangOptions into one. This is leveraged in a follow-up patch that implements marshalling of related command-line options. Depends on D93214. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D93215 --- clang/lib/Frontend/CompilerInvocation.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c1d5364..e4058cf 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2981,10 +2981,14 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, 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); - Opts.WasmExceptions = Opt.matches(options::OPT_fwasm_exceptions); + if (Opt.matches(options::OPT_fsjlj_exceptions)) + Opts.setExceptionHandling(llvm::ExceptionHandling::SjLj); + else if (Opt.matches(options::OPT_fseh_exceptions)) + Opts.setExceptionHandling(llvm::ExceptionHandling::WinEH); + else if (Opt.matches(options::OPT_fdwarf_exceptions)) + Opts.setExceptionHandling(llvm::ExceptionHandling::DwarfCFI); + else if (Opt.matches(options::OPT_fwasm_exceptions)) + Opts.setExceptionHandling(llvm::ExceptionHandling::Wasm); } Opts.ExternCNoUnwind = Args.hasArg(OPT_fexternc_nounwind); -- cgit v1.1