beanz added inline comments.

================
Comment at: lib/CMakeLists.txt:51
@@ -50,2 +50,3 @@
 if (APPLE AND LLVM_USE_SANITIZER)
-  if ("${LLVM_USE_SANITIZER}" STREQUAL "Address")
+  if ("${LLVM_USE_SANITIZER}" STREQUAL "Address" OR
+      "${LLVM_USE_SANITIZER}" STREQUAL "Address;Undefined" OR
----------------
Rather than doing this as a STREQUAL where you have to check both possible 
orders, maybe we should iterate over the list?

Something more like:


```
foreach(sanitizer in ${LLVM_USE_SANITIZER})
  if(sanitizer STREQUAL "Address")
    set(enable_address On)
  endif()
  if(sanitizer STREQUAL "Undefined")
    set(enable_ub On)
  endif()
  ... <other sanitizers>
endforeach()

if(enable_address and enable_undefined)
...
elseif(...)
endif()
```

I think doing it this way makes the code more adaptable to future changes.

Alternatively you can get rid of needing to check both orders by using the 
list(FIND ...) CMake command, which might be cleaner too.


Repository:
  rL LLVM

http://reviews.llvm.org/D18014



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to