aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/BackendUtil.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2025-07-16 07:11:13 -0700
committerGitHub <noreply@github.com>2025-07-16 07:11:13 -0700
commit76058c09071491fd097e85a0f5434b564dfad60b (patch)
treeef66ded553cc693136c1bd018f65166bc7e34b55 /clang/lib/CodeGen/BackendUtil.cpp
parent1600450f9098e5c9cb26840bd53f1be8a2559b7d (diff)
downloadllvm-76058c09071491fd097e85a0f5434b564dfad60b.zip
llvm-76058c09071491fd097e85a0f5434b564dfad60b.tar.gz
llvm-76058c09071491fd097e85a0f5434b564dfad60b.tar.bz2
[clang] Move `ExceptionHandling` from `LangOptions` to `CodeGenOptions` (#148982)
This PR removes the command line parsing workaround introduced in https://github.com/llvm/llvm-project/pull/146342 by moving `LangOptions::ExceptionHandling` to `CodeGenOptions` that get parsed even for IR input. Additionally, this improves layering, where the codegen library now checks `CodeGenOptions` instead of `LangOptions` for exception handling. (This got enabled by https://github.com/llvm/llvm-project/pull/146422.)
Diffstat (limited to 'clang/lib/CodeGen/BackendUtil.cpp')
-rw-r--r--clang/lib/CodeGen/BackendUtil.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp
index 2f6d4c4..1b72578 100644
--- a/clang/lib/CodeGen/BackendUtil.cpp
+++ b/clang/lib/CodeGen/BackendUtil.cpp
@@ -407,13 +407,13 @@ static bool initTargetOptions(const CompilerInstance &CI,
// Set EABI version.
Options.EABIVersion = TargetOpts.EABIVersion;
- if (LangOpts.hasSjLjExceptions())
+ if (CodeGenOpts.hasSjLjExceptions())
Options.ExceptionModel = llvm::ExceptionHandling::SjLj;
- if (LangOpts.hasSEHExceptions())
+ if (CodeGenOpts.hasSEHExceptions())
Options.ExceptionModel = llvm::ExceptionHandling::WinEH;
- if (LangOpts.hasDWARFExceptions())
+ if (CodeGenOpts.hasDWARFExceptions())
Options.ExceptionModel = llvm::ExceptionHandling::DwarfCFI;
- if (LangOpts.hasWasmExceptions())
+ if (CodeGenOpts.hasWasmExceptions())
Options.ExceptionModel = llvm::ExceptionHandling::Wasm;
Options.NoInfsFPMath = LangOpts.NoHonorInfs;