[PATCH] Introduce -fsanitize-trap= flag.

Alexey Samsonov vonosmas at gmail.com
Wed Jun 17 13:04:29 PDT 2015


================
Comment at: include/clang/Driver/Options.td:565
@@ +564,3 @@
+def fsanitize_trap_EQ : CommaJoined<["-"], "fsanitize-trap=">, Group<f_clang_Group>,
+                        Flags<[CC1Option, CoreOption]>;
+def fno_sanitize_trap_EQ : CommaJoined<["-"], "fno-sanitize-trap=">, Group<f_clang_Group>;
----------------
Add some HelpText

================
Comment at: lib/Driver/SanitizerArgs.cpp:37
@@ -36,1 +36,3 @@
   NeedsLTO = CFI,
+  TrappingSupported = (Undefined & ~Vptr) | UndefinedGroup |
+                      UnsignedIntegerOverflow | LocalBounds,
----------------
If you're happy with http://reviews.llvm.org/D10467, we can submit that one first, and add `setGroupBits` to this patch. Or steal `setGroupBits` part from there if you want this patch to go in first.

================
Comment at: lib/Driver/SanitizerArgs.cpp:211
@@ +210,3 @@
+  SanitizerMask TrappingKinds = parseSanitizeTrapArgs(D, Args);
+  if (TrappingKinds & Vptr)
+    NotSupported |= Vptr;
----------------
We already have `NotAllowedWithTrap` mask. I think we should use it, and probably split diagnosing the sanitizers unsupported because they cannot trap, and those that are not supported by the toolchain. You already do some of the former in  `parseSanitizeTrapArgs` above, I think we should handle `vptr` in that function as well somehow.

http://reviews.llvm.org/D10464

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






More information about the cfe-commits mailing list