aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/InitPreprocessor.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/Frontend/InitPreprocessor.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/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 136bc55..38b2e0c 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -1032,14 +1032,14 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
if (LangOpts.GNUCVersion && LangOpts.RTTI)
Builder.defineMacro("__GXX_RTTI");
- if (LangOpts.hasSjLjExceptions())
+ if (CGOpts.hasSjLjExceptions())
Builder.defineMacro("__USING_SJLJ_EXCEPTIONS__");
- else if (LangOpts.hasSEHExceptions())
+ else if (CGOpts.hasSEHExceptions())
Builder.defineMacro("__SEH__");
- else if (LangOpts.hasDWARFExceptions() &&
+ else if (CGOpts.hasDWARFExceptions() &&
(TI.getTriple().isThumb() || TI.getTriple().isARM()))
Builder.defineMacro("__ARM_DWARF_EH__");
- else if (LangOpts.hasWasmExceptions() && TI.getTriple().isWasm())
+ else if (CGOpts.hasWasmExceptions() && TI.getTriple().isWasm())
Builder.defineMacro("__WASM_EXCEPTIONS__");
if (LangOpts.Deprecated)