[PATCH] clang-cl: Diagnose the usage of ASAN with a debug runtime library

Alexey Samsonov vonosmas at gmail.com
Tue Oct 14 10:52:52 PDT 2014


================
Comment at: include/clang/Basic/DiagnosticDriverKinds.td:88
@@ -87,1 +87,3 @@
   "malformed sanitizer blacklist: '%0'">;
+def note_drv_address_sanitizer_debug_runtime : Note<
+  "AddressSanitizer doesn't support linking with debug runtime libraries yet">;
----------------
Please put this note next to another notes defined in this file.

================
Comment at: lib/Driver/Tools.cpp:3587
@@ -3586,1 +3586,3 @@
   const SanitizerArgs &Sanitize = getToolChain().getSanitizerArgs();
+  if (Sanitize.needsAsanRt()) {
+    Arg *DebugRTArg = nullptr;
----------------
Generally we parse sanitizer arguments and print the error diagnostics in SanitizerArgs constructor (lib/Driver/SanitizerArgs.cpp). For example, that file is the place where we form error messages about incompatible sanitizer runtimes. I think, it makes sense to put these checks there as well to keep it consistent. You can also use "SanitizerArgs::lastArgumentForKind" method there.

http://reviews.llvm.org/D5764






More information about the cfe-commits mailing list