[HWASAN][CMake] Allow instrumenting LLVM/clang
authorEugene Leviant <eleviant@accesssoftek.com>
Tue, 4 Jun 2019 09:04:53 +0000 (09:04 +0000)
committerEugene Leviant <eleviant@accesssoftek.com>
Tue, 4 Jun 2019 09:04:53 +0000 (09:04 +0000)
Differential revision: https://reviews.llvm.org/D62813

llvm-svn: 362474

llvm/cmake/modules/HandleLLVMOptions.cmake

index 80ef69f..966a2b9 100644 (file)
@@ -697,6 +697,9 @@ if(LLVM_USE_SANITIZER)
     if (LLVM_USE_SANITIZER STREQUAL "Address")
       append_common_sanitizer_flags()
       append("-fsanitize=address" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    elseif (LLVM_USE_SANITIZER STREQUAL "HWAddress")
+      append_common_sanitizer_flags()
+      append("-fsanitize=hwaddress" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
     elseif (LLVM_USE_SANITIZER MATCHES "Memory(WithOrigins)?")
       append_common_sanitizer_flags()
       append("-fsanitize=memory" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)