[PATCH] [Sanitizers] Provide better diagnostic for sanitizers unsupported for target triple.

Peter Collingbourne peter at pcc.me.uk
Mon Jun 15 18:12:43 PDT 2015


================
Comment at: lib/Basic/Sanitizers.cpp:69
@@ +68,3 @@
+SanitizerMask clang::getSanitizersWithNoRequiredRuntime() {
+  return SanitizerKind::UndefinedTrap | SanitizerKind::CFI |
+         SanitizerKind::UnsignedIntegerOverflow | SanitizerKind::LocalBounds;
----------------
This should probably include `CFICastStrict`.

================
Comment at: lib/Driver/MSVCToolChain.cpp:527
@@ +526,3 @@
+SanitizerMask MSVCToolChain::getSupportedSanitizers() const {
+  return ToolChain::getSupportedSanitizers() | SanitizerKind::Address;
+}
----------------
CFI is not currently supported with the MSVC toolchain. Since MSVC is somewhat of a special case from CFI's perspective, I would mask it out here.

================
Comment at: lib/Driver/SanitizerArgs.cpp:145
@@ -166,1 +144,3 @@
+  SanitizerMask NotSupported =
+      stripSanitizerGroups(~TC.getSupportedSanitizers());
   ToolChain::RTTIMode RTTIMode = TC.getRTTIMode();
----------------
Can we instead add the relevant groups to `getSupportedSanitizers`? I'd imagine that if a user enabled a group of which no members are supported, we'd want to diagnose it during the first pass.

http://reviews.llvm.org/D10467

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list