[libc-commits] [libc] [libc] Clean up copt naming (PR #136274)

via libc-commits libc-commits at lists.llvm.org
Fri Apr 18 00:14:55 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libc

Author: Mohamed Emad (hulxv)

<details>
<summary>Changes</summary>

Closes #<!-- -->133505


CC @<!-- -->michaelrj-google 

---
Full diff: https://github.com/llvm/llvm-project/pull/136274.diff


1 Files Affected:

- (modified) libc/config/config.json (+27-27) 


``````````diff
diff --git a/libc/config/config.json b/libc/config/config.json
index d738aade74427..7cfc7a107f5a3 100644
--- a/libc/config/config.json
+++ b/libc/config/config.json
@@ -1,128 +1,128 @@
 {
   "errno": {
-    "LIBC_CONF_ERRNO_MODE": {
+    "LIBC_COPT_ERRNO_MODE": {
       "value": "LIBC_ERRNO_MODE_DEFAULT",
       "doc": "The implementation used for errno, acceptable values are LIBC_ERRNO_MODE_DEFAULT, LIBC_ERRNO_MODE_UNDEFINED, LIBC_ERRNO_MODE_THREAD_LOCAL, LIBC_ERRNO_MODE_SHARED, LIBC_ERRNO_MODE_EXTERNAL, and LIBC_ERRNO_MODE_SYSTEM."
     }
   },
   "printf": {
-    "LIBC_CONF_PRINTF_DISABLE_FLOAT": {
+    "LIBC_COPT_PRINTF_DISABLE_FLOAT": {
       "value": false,
       "doc": "Disable printing floating point values in printf and friends."
     },
-    "LIBC_CONF_PRINTF_DISABLE_INDEX_MODE": {
+    "LIBC_COPT_PRINTF_DISABLE_INDEX_MODE": {
       "value": false,
       "doc": "Disable index mode in the printf format string."
     },
-    "LIBC_CONF_PRINTF_DISABLE_WRITE_INT": {
+    "LIBC_COPT_PRINTF_DISABLE_WRITE_INT": {
       "value": false,
       "doc": "Disable handling of %n in printf format string."
     },
-    "LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
+    "LIBC_COPT_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
       "value": false,
       "doc": "Use large table for better printf long double performance."
     },
-    "LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_DYADIC_FLOAT": {
+    "LIBC_COPT_PRINTF_FLOAT_TO_STR_USE_DYADIC_FLOAT": {
       "value": false,
       "doc": "Use dyadic float for faster and smaller but less accurate printf doubles."
     },
-    "LIBC_CONF_PRINTF_FLOAT_TO_STR_NO_SPECIALIZE_LD": {
+    "LIBC_COPT_PRINTF_FLOAT_TO_STR_NO_SPECIALIZE_LD": {
       "value": false,
       "doc": "Use the same mode for double and long double in printf."
     },
-    "LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_FLOAT320": {
+    "LIBC_COPT_PRINTF_FLOAT_TO_STR_USE_FLOAT320": {
       "value": false,
       "doc": "Use an alternative printf float implementation based on 320-bit floats"
     },
-    "LIBC_CONF_PRINTF_DISABLE_FIXED_POINT": {
+    "LIBC_COPT_PRINTF_DISABLE_FIXED_POINT": {
       "value": false,
       "doc": "Disable printing fixed point values in printf and friends."
     },
-    "LIBC_CONF_PRINTF_DISABLE_STRERROR": {
+    "LIBC_COPT_PRINTF_DISABLE_STRERROR": {
       "value": false,
       "doc": "Disable handling of %m to print strerror in printf and friends."
     },
-    "LIBC_CONF_PRINTF_RUNTIME_DISPATCH": {
+    "LIBC_COPT_PRINTF_RUNTIME_DISPATCH": {
       "value": true,
       "doc": "Use dynamic dispatch for the output mechanism to reduce code size."
     }
   },
   "scanf": {
-    "LIBC_CONF_SCANF_DISABLE_FLOAT": {
+    "LIBC_COPT_SCANF_DISABLE_FLOAT": {
       "value": false,
       "doc": "Disable parsing floating point values in scanf and friends."
     },
-    "LIBC_CONF_SCANF_DISABLE_INDEX_MODE": {
+    "LIBC_COPT_SCANF_DISABLE_INDEX_MODE": {
       "value": false,
       "doc": "Disable index mode in the scanf format string."
     }
   },
   "string": {
-    "LIBC_CONF_STRING_UNSAFE_WIDE_READ": {
+    "LIBC_COPT_STRING_UNSAFE_WIDE_READ": {
       "value": false,
       "doc": "Read more than a byte at a time to perform byte-string operations like strlen."
     },
-    "LIBC_CONF_MEMSET_X86_USE_SOFTWARE_PREFETCHING": {
+    "LIBC_COPT_MEMSET_X86_USE_SOFTWARE_PREFETCHING": {
       "value": false,
       "doc": "Inserts prefetch for write instructions (PREFETCHW) for memset on x86 to recover performance when hardware prefetcher is disabled."
     }
   },
   "codegen": {
-    "LIBC_CONF_KEEP_FRAME_POINTER": {
+    "LIBC_COPT_KEEP_FRAME_POINTER": {
       "value": true,
       "doc": "Keep frame pointer in functions for better debugging experience."
     },
-    "LIBC_CONF_ENABLE_STRONG_STACK_PROTECTOR": {
+    "LIBC_COPT_ENABLE_STRONG_STACK_PROTECTOR": {
       "value": true,
       "doc": "Enable -fstack-protector-strong to defend against stack smashing attack."
     }
   },
   "pthread": {
-    "LIBC_CONF_TIMEOUT_ENSURE_MONOTONICITY": {
+    "LIBC_COPT_TIMEOUT_ENSURE_MONOTONICITY": {
       "value": true,
       "doc": "Automatically adjust timeout to CLOCK_MONOTONIC (default to true). POSIX API may require CLOCK_REALTIME, which can be unstable and leading to unexpected behavior. This option will convert the real-time timestamp to monotonic timestamp relative to the time of call."
     },
-    "LIBC_CONF_RAW_MUTEX_DEFAULT_SPIN_COUNT": {
+    "LIBC_COPT_RAW_MUTEX_DEFAULT_SPIN_COUNT": {
       "value": 100,
       "doc": "Default number of spins before blocking if a mutex is in contention (default to 100)."
     },
-    "LIBC_CONF_RWLOCK_DEFAULT_SPIN_COUNT": {
+    "LIBC_COPT_RWLOCK_DEFAULT_SPIN_COUNT": {
       "value": 100,
       "doc": "Default number of spins before blocking if a rwlock is in contention (default to 100)."
     }
   },
   "math": {
-    "LIBC_CONF_MATH_OPTIMIZATIONS": {
+    "LIBC_COPT_MATH_OPTIMIZATIONS": {
       "value": 0,
       "doc": "Configures optimizations for math functions. Values accepted are LIBC_MATH_SKIP_ACCURATE_PASS, LIBC_MATH_SMALL_TABLES, LIBC_MATH_NO_ERRNO, LIBC_MATH_NO_EXCEPT, and LIBC_MATH_FAST."
     },
-    "LIBC_CONF_FREXP_INF_NAN_EXPONENT": {
+    "LIBC_COPT_FREXP_INF_NAN_EXPONENT": {
       "value": "",
       "doc": "The value written back to the second parameter when calling frexp/frexpf/frexpl` with `+/-Inf`/`NaN` is unspecified.  Configue an explicit exp value for Inf/NaN inputs."
     }
   },
   "qsort": {
-    "LIBC_CONF_QSORT_IMPL": {
+    "LIBC_COPT_QSORT_IMPL": {
       "value": "LIBC_QSORT_QUICK_SORT",
       "doc": "Configures sorting algorithm for qsort and qsort_r. Values accepted are LIBC_QSORT_QUICK_SORT, LIBC_QSORT_HEAP_SORT."
     }
   },
   "setjmp": {
-    "LIBC_CONF_SETJMP_AARCH64_RESTORE_PLATFORM_REGISTER": {
+    "LIBC_COPT_SETJMP_AARCH64_RESTORE_PLATFORM_REGISTER": {
       "value": true,
       "doc": "Make setjmp save the value of x18, and longjmp restore it. The AArch64 ABI delegates this register to platform ABIs, which can choose whether to make it caller-saved."
     }
   },
   "time": {
-    "LIBC_CONF_TIME_64BIT": {
+    "LIBC_COPT_TIME_64BIT": {
       "value": false,
       "doc": "Force the size of time_t to 64 bits, even on platforms where compatibility considerations would otherwise make it 32-bit."
     }
   },
   "general": {
-    "LIBC_ADD_NULL_CHECKS": {
+    "LIBC_COPT_ADD_NULL_CHECKS": {
       "value": true,
       "doc": "Add nullptr checks in the library's implementations to some functions for which passing nullptr is undefined behavior."
     }
   }
-}
+}
\ No newline at end of file

``````````

</details>


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


More information about the libc-commits mailing list