[clang] [clang] Respect `CLANG_USE_EXPERIMENTAL_CONST_INTERP` (PR #200716)
Yihan Wang via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 11 07:49:23 PDT 2026
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>,
Timm =?utf-8?q?Bäder?= <tbaeder at redhat.com>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/200716 at github.com>
================
@@ -6673,8 +6673,15 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_fexperimental_library);
- if (Args.hasArg(options::OPT_fexperimental_new_constant_interpreter))
- CmdArgs.push_back("-fexperimental-new-constant-interpreter");
+ if (CLANG_USE_EXPERIMENTAL_CONST_INTERP) {
----------------
yronglin wrote:
Does `CLANG_USE_EXPERIMENTAL_CONST_INTERP` a macro that defined in cmake generated headers?
If it's a macro, can we use:
```cpp
#if defined(CLANG_USE_EXPERIMENTAL_CONST_INTERP) && CLANG_USE_EXPERIMENTAL_CONST_INTERP
Args.ClaimAllArgs(options::OPT_fexperimental_new_constant_interpreter);
Args.AddLastArg(CmdArgs,
options::OPT_fno_experimental_new_constant_interpreter);
#else
Args.ClaimAllArgs(options::OPT_fno_experimental_new_constant_interpreter);
Args.AddLastArg(CmdArgs,
options::OPT_fexperimental_new_constant_interpreter);
#endif
```
What do you think?
The `CLANG_USE_EXPERIMENTAL_CONST_INTERP` used as a variable like things, the name looks wired.
https://github.com/llvm/llvm-project/pull/200716
More information about the cfe-commits
mailing list