[clang] [llvm] [clang CodeGen] Declare command line options in TableGen (PR #246727)

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 27 14:07:24 PST 2026


MaskRay wrote:

> clang has its own existing options system, we do not want to switch to the LLVM option system. The few that have slipped through should be fixed to use the real options system.

I agree that non-user-facing options should stay as -cc1 options. That said, PGO, sanitizers, and code coverage already had a few cl::opt options prior to this change, which we couldn't prevent. I plan to add -Werror=global-constructors (#246753) so new cl::opt options can't be introduced unnoticed.

We can add a large DEPRECATION notice to clang/lib/CodeGen/CodeGenCLOptions.td to prevent new options.

> Please revert.

Reverting this would require adding clangCodeGen as another opt-out there #246753 ...
(Not to defend my misaction, but I would like to avoid unneeded churn if this central list ends up being preferred over scattered cl::opt.)

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


More information about the cfe-commits mailing list