[llvm] b4d51ea - [cmake] Use LLVM_ENABLE_ASSERTIONS to enable assertions in libstdc++

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 7 00:15:32 PST 2023


Author: Jay Foad
Date: 2023-02-07T08:15:12Z
New Revision: b4d51eafc4660ed48b42b6be999a647cc1163a16

URL: https://github.com/llvm/llvm-project/commit/b4d51eafc4660ed48b42b6be999a647cc1163a16
DIFF: https://github.com/llvm/llvm-project/commit/b4d51eafc4660ed48b42b6be999a647cc1163a16.diff

LOG: [cmake] Use LLVM_ENABLE_ASSERTIONS to enable assertions in libstdc++

On my machine this showed no new failures in check-llvm and increased
the testing time from 138 to 142 seconds, for a Release build with
assertions enabled.

Differential Revision: https://reviews.llvm.org/D142279

Added: 
    

Modified: 
    llvm/cmake/modules/HandleLLVMOptions.cmake

Removed: 
    


################################################################################
diff  --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake
index 6119ecdce0f4b..7173e2724097a 100644
--- a/llvm/cmake/modules/HandleLLVMOptions.cmake
+++ b/llvm/cmake/modules/HandleLLVMOptions.cmake
@@ -81,6 +81,8 @@ if( LLVM_ENABLE_ASSERTIONS )
       endforeach()
     endif()
   endif()
+  # Enable assertions in libstdc++.
+  add_compile_definitions(_GLIBCXX_ASSERTIONS)
 endif()
 
 if(LLVM_ENABLE_EXPENSIVE_CHECKS)


        


More information about the llvm-commits mailing list