[libc-commits] [PATCH] D129808: [libc] add unsafe mode to strlen

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Fri Jul 15 06:18:31 PDT 2022


lntue added inline comments.


================
Comment at: libc/src/string/CMakeLists.txt:11
     .memory_utils.memset_implementation
+  FLAGS
+    LLVM_LIBC_STRLEN_UNSAFE
----------------
sivachandra wrote:
> I do not think this will do anything at all without a flag applier implemented somewhere. Also, can we consider a design without the FLAGS feature for comparison?
To make `FLAGS` property become a compile flag, you'll need to update `_get_common_compile_options` at https://github.com/llvm/llvm-project/blob/main/libc/cmake/modules/LLVMLibCObjectRules.cmake#L3 similar to `FMA_OPT`.  In your case the compile option to be append should be `-DLLVM_LIBC_STRLEN_UNSAFE` for gcc/clang and `/DLLVM_LIBC_STRLEN_UNSAFE` for MSVC.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129808/new/

https://reviews.llvm.org/D129808



More information about the libc-commits mailing list