aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2020-12-15 09:41:11 +0100
committerJan Svoboda <jan_svoboda@apple.com>2020-12-15 10:15:58 +0100
commit573255b47eb9b210e74a1c620fee363dfaa52794 (patch)
treef8e60d5ae19123b07dc4246f72b6c731959a3342 /clang/lib/Frontend/CompilerInvocation.cpp
parentf24e58df7ddf2dc9f13c8f8fc259f0374f04aca3 (diff)
downloadllvm-573255b47eb9b210e74a1c620fee363dfaa52794.zip
llvm-573255b47eb9b210e74a1c620fee363dfaa52794.tar.gz
llvm-573255b47eb9b210e74a1c620fee363dfaa52794.tar.bz2
[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
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp12
1 files changed, 8 insertions, 4 deletions
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);