Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion projects/eudsl-llvmpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ add_definitions(${LLVM_DEFINITIONS})
# C++ source coverage (llvm-cov). When ON, the extension is built with
# instrumentation; scripts/cpp_coverage.sh runs the test suite (which imports
# the .so) under LLVM_PROFILE_FILE, merges the profraw, and enforces a
# src/IR + src/MIR line-coverage threshold via scripts/check_coverage.py.
# src/IR + src/MIR line-coverage threshold via the repo-root
# scripts/check_coverage.py.
option(EUDSL_LLVMPY_ENABLE_COVERAGE "Instrument eudslllvm_ext for llvm-cov" OFF)
if(EUDSL_LLVMPY_ENABLE_COVERAGE)
message(STATUS "EUDSL_LLVMPY: C++ coverage instrumentation enabled")
Expand Down
2 changes: 1 addition & 1 deletion projects/eudsl-llvmpy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Python coverage is gated in `pyproject.toml` (`--cov=llvm`, branch coverage,
fail under 99%). C++ coverage runs through `scripts/cpp_coverage.sh`, which
builds the extension instrumented, runs the suite under `LLVM_PROFILE_FILE`,
merges the profile, and enforces a `src/IR` line-coverage threshold with
`scripts/check_coverage.py`:
the repo-root `scripts/check_coverage.py` (shared with other projects):

```bash
COVERAGE_THRESHOLD=100 bash scripts/cpp_coverage.sh
Expand Down
2 changes: 1 addition & 1 deletion projects/eudsl-llvmpy/scripts/cpp_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ if [[ -z "$SO" || ! -f "$SO" ]]; then
fi

echo ">> checking src/IR + src/MIR coverage (threshold=${THRESHOLD}%)"
"$PY" "${PROJ_DIR}/scripts/check_coverage.py" \
"$PY" "${PROJ_DIR}/../../scripts/check_coverage.py" \
--llvm-cov "$LLVM_COV" \
--profdata "${COV_DIR}/eudslllvm.profdata" \
--objects "$SO" \
Expand Down
File renamed without changes.
27 changes: 24 additions & 3 deletions scripts/cmake/llvm_cache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,21 @@ include(CMakePrintHelpers)

set(LLVM_ENABLE_PROJECTS "llvm;mlir;clang" CACHE STRING "")

if (NOT WIN32)
# compiler-rt builtins only (built by the separate `builtins` sub-build);
# every compiler-rt runtime is off.
set(LLVM_ENABLE_RUNTIMES "compiler-rt" CACHE STRING "")
set(COMPILER_RT_BUILD_BUILTINS ON CACHE BOOL "")
foreach(_crt SANITIZERS XRAY LIBFUZZER PROFILE MEMPROF CTX_PROFILE ORC GWP_ASAN)
set(COMPILER_RT_BUILD_${_crt} OFF CACHE BOOL "")
endforeach()
set(COMPILER_RT_INCLUDE_TESTS OFF CACHE BOOL "")
# macOS only; avoids needing iOS/watchOS/tvOS/visionOS SDKs.
foreach(_os IOS WATCHOS TVOS XROS)
set(COMPILER_RT_ENABLE_${_os} OFF CACHE BOOL "")
endforeach()
endif()

# LLVM options

set(LLVM_BUILD_TOOLS ON CACHE BOOL "")
Expand Down Expand Up @@ -63,6 +78,7 @@ set(LLVM_ENABLE_CRASH_OVERRIDES OFF CACHE BOOL "")
set(LLVM_ENABLE_Z3_SOLVER OFF CACHE BOOL "")
set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
set(LLVM_ENABLE_ZSTD OFF CACHE BOOL "")
set(LLVM_ENABLE_LZMA OFF CACHE BOOL "")
set(LLVM_INCLUDE_BENCHMARKS OFF CACHE BOOL "")
set(LLVM_INCLUDE_DOCS OFF CACHE BOOL "")
set(LLVM_INCLUDE_EXAMPLES OFF CACHE BOOL "")
Expand All @@ -81,9 +97,10 @@ set(MLIR_INCLUDE_TESTS ${RUN_TESTS} CACHE BOOL "")
set(LLVM_INSTALL_TOOLCHAIN_ONLY OFF CACHE BOOL "")

set(LLVM_DISTRIBUTIONS MlirDevelopment CACHE STRING "")
set(LLVM_MlirDevelopment_DISTRIBUTION_COMPONENTS
set(_mlir_dev_components
clang-libraries
clang-headers
clang-resource-headers
# triggers ClangConfig.cmake and etc
clang-cmake-exports
# triggers ClangMlirDevelopmentTargets.cmake
Expand Down Expand Up @@ -118,12 +135,16 @@ set(LLVM_MlirDevelopment_DISTRIBUTION_COMPONENTS
mlir-reduce
mlir-tblgen
mlir-translate
CACHE STRING "")
)

if (NOT WIN32)
list(APPEND LLVM_MlirDevelopment_DISTRIBUTION_COMPONENTS LLVM MLIR)
list(APPEND _mlir_dev_components LLVM MLIR builtins)
endif()

# Only cache entries survive a -C script, so the list must be complete before
# it is cached (appending to the variable afterwards has no effect).
set(LLVM_MlirDevelopment_DISTRIBUTION_COMPONENTS ${_mlir_dev_components} CACHE STRING "")

get_cmake_property(_variableNames VARIABLES)
list(SORT _variableNames)
cmake_print_variables(${_variableNames})
Loading