[PATCH] D34693: Loop directly over sanitizers to build in cmake
Francis Ricci via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 27 08:26:24 PDT 2017
fjricci created this revision.
Herald added a subscriber: mgorny.
Cleaner than computing the intersection for each possible sanitizer
https://reviews.llvm.org/D34693
Files:
lib/CMakeLists.txt
test/CMakeLists.txt
Index: test/CMakeLists.txt
===================================================================
--- test/CMakeLists.txt
+++ test/CMakeLists.txt
@@ -42,14 +42,6 @@
endif()
endfunction()
-function(compiler_rt_test_sanitizer sanitizer)
- string(TOLOWER ${sanitizer} sanitizer_lowercase)
- list(FIND COMPILER_RT_SANITIZERS_TO_BUILD ${sanitizer_lowercase} result)
- if(NOT ${result} EQUAL -1)
- compiler_rt_test_runtime(${sanitizer})
- endif()
-endfunction()
-
# Run sanitizer tests only if we're sure that clang would produce
# working binaries.
if(COMPILER_RT_CAN_EXECUTE_TESTS)
@@ -63,14 +55,9 @@
compiler_rt_test_runtime(ubsan)
compiler_rt_test_runtime(sanitizer_common)
- compiler_rt_test_sanitizer(asan)
- compiler_rt_test_sanitizer(dfsan)
- compiler_rt_test_sanitizer(msan)
- compiler_rt_test_sanitizer(tsan)
- compiler_rt_test_sanitizer(safestack)
- compiler_rt_test_sanitizer(cfi)
- compiler_rt_test_sanitizer(esan)
- compiler_rt_test_sanitizer(scudo)
+ foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD})
+ compiler_rt_test_runtime(${sanitizer})
+ endforeach()
compiler_rt_test_runtime(profile)
endif()
Index: lib/CMakeLists.txt
===================================================================
--- lib/CMakeLists.txt
+++ lib/CMakeLists.txt
@@ -21,17 +21,6 @@
string(TOUPPER ${runtime} runtime_uppercase)
if(COMPILER_RT_HAS_${runtime_uppercase})
add_subdirectory(${runtime})
- foreach(directory ${ARGN})
- add_subdirectory(${directory})
- endforeach()
- endif()
-endfunction()
-
-function(compiler_rt_build_sanitizer sanitizer)
- string(TOLOWER ${sanitizer} sanitizer_lowercase)
- list(FIND COMPILER_RT_SANITIZERS_TO_BUILD ${sanitizer_lowercase} result)
- if(NOT ${result} EQUAL -1)
- compiler_rt_build_runtime(${sanitizer} ${ARGN})
endif()
endfunction()
@@ -44,14 +33,12 @@
add_subdirectory(ubsan)
endif()
- compiler_rt_build_sanitizer(asan)
- compiler_rt_build_sanitizer(dfsan)
- compiler_rt_build_sanitizer(msan)
- compiler_rt_build_sanitizer(tsan tsan/dd)
- compiler_rt_build_sanitizer(safestack)
- compiler_rt_build_sanitizer(cfi)
- compiler_rt_build_sanitizer(esan)
- compiler_rt_build_sanitizer(scudo)
+ foreach(sanitizer ${COMPILER_RT_SANITIZERS_TO_BUILD})
+ compiler_rt_build_runtime(${sanitizer})
+ if(${sanitizer} STREQUAL tsan)
+ compiler_rt_build_runtime(tsan/dd)
+ endif()
+ endforeach()
compiler_rt_build_runtime(profile)
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34693.104179.patch
Type: text/x-patch
Size: 2501 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170627/9f1bc54a/attachment.bin>
More information about the llvm-commits
mailing list