From 7fc50e92a59c764eb6b1897fcdd506aacb92629c Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 3 Jul 2025 05:21:47 +0900 Subject: clang: Fix parsing of seh exception model (#146643) Fixes regression reported https://github.com/llvm/llvm-project/pull/146342#issuecomment-3026600152 The test could probably be better. I'm not sure what special is happening with the module compile, but I can't seem to reproduce this with just a plain -cc1 run. --- clang/lib/Frontend/CompilerInvocation.cpp | 9 +++++---- 1 file changed, 5 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 d8916a6..0a9e364 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3682,12 +3682,13 @@ static StringRef GetInputKindName(InputKind IK) { static StringRef getExceptionHandlingName(unsigned EHK) { switch (static_cast(EHK)) { case LangOptions::ExceptionHandlingKind::None: - default: return "none"; - case LangOptions::ExceptionHandlingKind::SjLj: - return "sjlj"; case LangOptions::ExceptionHandlingKind::DwarfCFI: return "dwarf"; + case LangOptions::ExceptionHandlingKind::SjLj: + return "sjlj"; + case LangOptions::ExceptionHandlingKind::WinEH: + return "seh"; case LangOptions::ExceptionHandlingKind::Wasm: return "wasm"; } @@ -4028,7 +4029,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, A->getValue()) .Case("dwarf", LangOptions::ExceptionHandlingKind::DwarfCFI) .Case("sjlj", LangOptions::ExceptionHandlingKind::SjLj) - .Case("wineh", LangOptions::ExceptionHandlingKind::WinEH) + .Case("seh", LangOptions::ExceptionHandlingKind::WinEH) .Case("wasm", LangOptions::ExceptionHandlingKind::Wasm) .Case("none", LangOptions::ExceptionHandlingKind::None) .Default(std::nullopt); -- cgit v1.1