[clang] [clang][driver] Expose a frontend option for trap-unreachable (PR #174894)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 13:21:07 PST 2026


================
@@ -4685,6 +4685,16 @@ defm strict_return : BoolFOption<"strict-return",
             " of a non-void function as unreachable">,
   PosFlag<SetTrue>>;
 
+def ftrap_unreachable
+    : Joined<["-"], "ftrap-unreachable=">,
+      Group<f_Group>,
+      Visibility<[ClangOption, CC1Option]>,
+      HelpText<"Treat unreachable instruction as traps.">,
----------------
ilovepi wrote:

I've updated the wording a bit. I also considered `when it is supported and does not increase the dynamic instruction count for well-defined code.` but that seemed a bit verbose. Happy to adjust the text if there is something specific you'd like to see instead.

https://github.com/llvm/llvm-project/pull/174894


More information about the cfe-commits mailing list