Timm =?utf-8?q?Bäder?= <[email protected]> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/199396 >From 81a7d78920fed538750b1a17818d96ace94e4653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Sun, 24 May 2026 07:33:35 +0200 Subject: [PATCH 1/2] [clang] Add CLANG_ENABLE_NEW_CONST_INTERP_BY_DEFAULT cmake option To enable the new constant interpreter by default at configure time. I don't expect any distributions to set this for now but it's useful for testing and I think we need it eventually. --- clang/CMakeLists.txt | 3 +++ clang/include/clang/Basic/LangOptions.def | 2 +- clang/include/clang/Config/config.h.cmake | 4 ++++ clang/lib/Basic/LangOptions.cpp | 1 + 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index 40506fc8a1546..f632c96fb69fc 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -489,6 +489,9 @@ option(CLANG_ENABLE_STATIC_ANALYZER option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF) +option(CLANG_USE_EXPERIMENTAL_CONST_INTERP + "Enable the experimental new constant interpreter by default." OFF) + if (DEFINED CLANG_ENABLE_ARCMT) set(CLANG_ENABLE_OBJC_REWRITER ${CLANG_ENABLE_ARCMT}) message(DEPRECATION "'CLANG_ENABLE_ARCMT' is deprecated as ARCMigrate has been removed from Clang. Please use 'CLANG_ENABLE_OBJC_REWRITER' instead to enable or disable the Objective-C rewriter.") diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 3bbb40ba09f05..4a3e3b7c04822 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -385,7 +385,7 @@ LANGOPT(ConstexprCallDepth, 32, 512, Benign, "maximum constexpr call depth") LANGOPT(ConstexprStepLimit, 32, 1048576, Benign, "maximum constexpr evaluation steps") -LANGOPT(EnableNewConstInterp, 1, 0, Benign, +LANGOPT(EnableNewConstInterp, 1, CLANG_USE_EXPERIMENTAL_CONST_INTERP, Benign, "enable the experimental new constant interpreter") LANGOPT(BracketDepth, 32, 256, Benign, "maximum bracket nesting depth") diff --git a/clang/include/clang/Config/config.h.cmake b/clang/include/clang/Config/config.h.cmake index 05e4deb671a7e..11b4096726f67 100644 --- a/clang/include/clang/Config/config.h.cmake +++ b/clang/include/clang/Config/config.h.cmake @@ -91,4 +91,8 @@ /* Policy to use for xcselect */ #cmakedefine CLANG_XCSELECT_HOST_SDK_POLICY ${CLANG_XCSELECT_HOST_SDK_POLICY} + +/* Enable the experimental new constant interpreter by default */ +#cmakedefine01 CLANG_USE_EXPERIMENTAL_CONST_INTERP + #endif diff --git a/clang/lib/Basic/LangOptions.cpp b/clang/lib/Basic/LangOptions.cpp index 40cdc646780e3..7e75bf1221eb7 100644 --- a/clang/lib/Basic/LangOptions.cpp +++ b/clang/lib/Basic/LangOptions.cpp @@ -12,6 +12,7 @@ #include "clang/Basic/LangOptions.h" #include "clang/Basic/LangStandard.h" +#include "clang/Config/config.h" #include "llvm/Support/Path.h" using namespace clang; >From 78948a86167b7ab9949d17d8d02faef3d1a46ea2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= <[email protected]> Date: Thu, 28 May 2026 08:59:25 +0200 Subject: [PATCH 2/2] Clarify option --- clang/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt index f632c96fb69fc..bbd0041fc9e32 100644 --- a/clang/CMakeLists.txt +++ b/clang/CMakeLists.txt @@ -490,7 +490,7 @@ option(CLANG_ENABLE_STATIC_ANALYZER option(CLANG_ENABLE_PROTO_FUZZER "Build Clang protobuf fuzzer." OFF) option(CLANG_USE_EXPERIMENTAL_CONST_INTERP - "Enable the experimental new constant interpreter by default." OFF) + "Use the new experimental constant interpreter for compile-time evaluation." OFF) if (DEFINED CLANG_ENABLE_ARCMT) set(CLANG_ENABLE_OBJC_REWRITER ${CLANG_ENABLE_ARCMT}) _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
