[libc-commits] [libc] [libc][wctype] Add perfect hash map for conversion functions (PR #187670)

Muhammad Bassiouni via libc-commits libc-commits at lists.llvm.org
Thu Apr 16 12:11:32 PDT 2026


================
@@ -8,6 +8,14 @@
 #
 # ==------------------------------------------------------------------------==#
 
+from os import environ
+from sys import argv
+
+if len(argv) > 1:
+    environ[
+        "EXTRA_CLING_ARGS"
+    ] = f"-DLIBC_NAMESPACE=LIBC_NAMESPACE -D_DEBUG -I{argv[1]}/libc -fvisibility-inlines-hidden -fdiagnostics-color -Xclang -fno-pch-timestamp -std=c++17 -DLIBC_QSORT_IMPL=LIBC_QSORT_QUICK_SORT -DLIBC_COPT_STRING_LENGTH_IMPL=clang_vector -DLIBC_COPT_FIND_FIRST_CHARACTER_IMPL=word -DLIBC_ADD_NULL_CHECKS -DLIBC_ERRNO_MODE=LIBC_ERRNO_MODE_DEFAULT -DLIBC_THREAD_MODE=LIBC_THREAD_MODE_PLATFORM -DLIBC_CONF_WCTYPE_MODE=LIBC_WCTYPE_MODE_ASCII -DLIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT=100 -fpie -ffreestanding -idirafter/usr/include -ffixed-point -fno-builtin -fno-lax-vector-conversions -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-rtti -ftrivial-auto-var-init=pattern -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fstack-protector-strong -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -Wconversion -Wno-sign-conversion -Wno-c99-extensions -Wno-gnu-imaginary-constant -Wno-pedantic -Wimplicit-fallthrough -Wwrite-strings -Wextra-semi -Wnewline-eof -Wnonportable-system-include-path -Wstrict-prototypes -Wthread-safety -Wglobal-constructors"
----------------
bassiounix wrote:

I'm not trying mimic cmake compile command 1-to-1, I deleted some flags and changed some macro values like `-DLIBC_NAMESPACE=LIBC_NAMESPACE`, not `__llvm_libc_23` or as it was to suit `Cling` configs.

So no need to get anything from CMake in the first place.

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


More information about the libc-commits mailing list