[PATCH] D143612: [CMake] Use `LLVM_ENABLE_ASSERTIONS` to enable assertions in `libc++`

Argyrios Kyrtzidis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 8 15:38:35 PST 2023


akyrtzi created this revision.
Herald added a project: All.
akyrtzi requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Follow-up to https://reviews.llvm.org/D142279 for also enabling `libc++` assertions.
This is particularly useful to recover the assertion checks we had with `llvm::Optional`, before moving to `std::optional`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D143612

Files:
  llvm/cmake/modules/HandleLLVMOptions.cmake


Index: llvm/cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- llvm/cmake/modules/HandleLLVMOptions.cmake
+++ llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -83,6 +83,8 @@
   endif()
   # Enable assertions in libstdc++.
   add_compile_definitions(_GLIBCXX_ASSERTIONS)
+  # Enable assertions in libc++.
+  add_compile_definitions(_LIBCPP_ENABLE_ASSERTIONS)
 endif()
 
 if(LLVM_ENABLE_EXPENSIVE_CHECKS)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143612.495974.patch
Type: text/x-patch
Size: 459 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230208/08dad97b/attachment.bin>


More information about the llvm-commits mailing list