Skip to content

Commit 21fd52f

Browse files
authored
[libc++] Remove unmaintained support for generating code coverage (#100630)
This patch removes support for generating code coverage information of libc++, which is unmaintained and I've never been able to utilize. It would be great to have support for generating code coverage in the test suite, however this incarnation of it doesn't seem to be properly hooked up into the test suite. Since it gets in the way of making the test suite more standalone, remove it.
1 parent e603df0 commit 21fd52f

File tree

4 files changed

+0
-83
lines changed

4 files changed

+0
-83
lines changed

libcxx/CMakeLists.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,6 @@ endif()
310310
option(LIBCXX_ENABLE_PEDANTIC "Compile with pedantic enabled." OFF)
311311
option(LIBCXX_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
312312

313-
option(LIBCXX_GENERATE_COVERAGE "Enable generating code coverage." OFF)
314-
set(LIBCXX_COVERAGE_LIBRARY "" CACHE STRING
315-
"The Profile-rt library used to build with code coverage")
316-
317313
set(LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT OFF)
318314
if (WIN32)
319315
set(LIBCXX_HERMETIC_STATIC_LIBRARY_DEFAULT ON)
@@ -376,12 +372,6 @@ if (NOT LIBCXX_ENABLE_RTTI AND LIBCXX_ENABLE_EXCEPTIONS)
376372
" for details.")
377373
endif()
378374

379-
# Ensure LLVM_USE_SANITIZER is not specified when LIBCXX_GENERATE_COVERAGE
380-
# is ON.
381-
if (LLVM_USE_SANITIZER AND LIBCXX_GENERATE_COVERAGE)
382-
message(FATAL_ERROR "LLVM_USE_SANITIZER cannot be used with LIBCXX_GENERATE_COVERAGE")
383-
endif()
384-
385375
if (LIBCXX_ENABLE_ABI_LINKER_SCRIPT)
386376
if (APPLE)
387377
message(FATAL_ERROR "LIBCXX_ENABLE_ABI_LINKER_SCRIPT cannot be used on APPLE targets")
@@ -490,12 +480,6 @@ endif()
490480
# Configure compiler.
491481
include(config-ix)
492482

493-
# Configure coverage options.
494-
if (LIBCXX_GENERATE_COVERAGE)
495-
include(CodeCoverage)
496-
set(CMAKE_BUILD_TYPE "COVERAGE" CACHE STRING "" FORCE)
497-
endif()
498-
499483
#===============================================================================
500484
# Setup Compiler Flags
501485
#===============================================================================

libcxx/cmake/Modules/CodeCoverage.cmake

Lines changed: 0 additions & 50 deletions
This file was deleted.

libcxx/src/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,6 @@ if(NOT LIBCXX_INSTALL_LIBRARY)
147147
set(exclude_from_all EXCLUDE_FROM_ALL)
148148
endif()
149149

150-
if (LIBCXX_GENERATE_COVERAGE AND NOT LIBCXX_COVERAGE_LIBRARY)
151-
find_compiler_rt_library(profile LIBCXX_COVERAGE_LIBRARY)
152-
endif()
153-
add_library_flags_if(LIBCXX_COVERAGE_LIBRARY "${LIBCXX_COVERAGE_LIBRARY}")
154-
155150
if (APPLE AND LLVM_USE_SANITIZER)
156151
if (("${LLVM_USE_SANITIZER}" STREQUAL "Address") OR
157152
("${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined") OR

libcxx/test/CMakeLists.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,3 @@ add_lit_testsuite(check-cxx
4949
"Running libcxx tests"
5050
${CMAKE_CURRENT_BINARY_DIR}
5151
DEPENDS cxx-test-depends)
52-
53-
if (LIBCXX_GENERATE_COVERAGE)
54-
include(CodeCoverage)
55-
set(output_dir "${CMAKE_CURRENT_BINARY_DIR}/coverage")
56-
set(capture_dirs
57-
"${LIBCXX_LIB_CMAKEFILES_DIR}/cxx_objects.dir/"
58-
"${LIBCXX_LIB_CMAKEFILES_DIR}/cxx.dir/"
59-
"${LIBCXX_LIB_CMAKEFILES_DIR}/cxx_experimental.dir/"
60-
"${CMAKE_CURRENT_BINARY_DIR}")
61-
set(extract_dirs "${LIBCXX_SOURCE_DIR}/include;${LIBCXX_SOURCE_DIR}/src")
62-
setup_lcov_test_target_coverage("cxx" "${output_dir}" "${capture_dirs}" "${extract_dirs}")
63-
endif()

0 commit comments

Comments
 (0)