[libc-commits] [libc] [libc][wctype] Add perfect hash map for conversion functions (PR #187670)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed Apr 29 11:46:55 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"
----------------
michaelrj-google wrote:
I think getting the information from cmake would be a better idea. Replacing the value of `LIBC_NAMESPACE` is fine but there are a lot of flags here. If we expect to use this once every few years the compile command will definitely have changed the next time we need it.
https://github.com/llvm/llvm-project/pull/187670
More information about the libc-commits
mailing list