[clang] Make the `-disable-free` flag more full featured (PR #136213)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 17 17:22:52 PDT 2025


================
@@ -7889,9 +7889,13 @@ def code_completion_with_fixits : Flag<["-"], "code-completion-with-fixits">,
 def skip_function_bodies : Flag<["-"], "skip-function-bodies">,
   HelpText<"Skip function bodies when possible">,
   MarshallingInfoFlag<FrontendOpts<"SkipFunctionBodies">>;
-def disable_free : Flag<["-"], "disable-free">,
-  HelpText<"Disable freeing of memory on exit">,
-  MarshallingInfoFlag<FrontendOpts<"DisableFree">>;
+defm disable_free : BoolOption<"",
+  "disable-free",
+  FrontendOpts<"DisableFree">,
+  DefaultFalse,
+  PosFlag<SetTrue, [], [ClangOption], "Disable">,
+  NegFlag<SetFalse, [], [ClangOption], "Don't disable">,
+  BothFlags<[], [ClangOption], " freeing of memory on exit">>;
----------------
zygoloid wrote:

OK, it looks like the enclosing `let Visibility = ...` is entirely overriding the effect of the `[ClangOption]` here and below. So that's all just dead (and misleading) code. Great. I guess we should at least be consistent with it.

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


More information about the cfe-commits mailing list