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

Ehsan Akhgari ehsan.akhgari at gmail.com
Tue Oct 14 14:20:56 PDT 2014


================
Comment at: lib/Driver/SanitizerArgs.cpp:178
@@ +177,3 @@
+
+    Arg *DebugRTArg = nullptr;
+    if (Args.hasArg(options::OPT__SLASH_MTd))
----------------
samsonov wrote:
> Can you use the following syntax here?
>   if (Arg *WindowsDebugRTArg = Args.getLastArg(options::OPT__SLASH_MTd, options::OPT__SLASH_MDd,
>       options::OPT__SLASH_LDd)) {
>     D.Diag(...) << ....;
>   }
> 
> Also, what is MSVC/clang-cl semantics if I pass "/MTd /MT"? Will it pick up the last flag (/MT), or try to link both runtimes?
> In the first case we don't need to produce the error.
When passing "/MTd /MT", /MTd will be ignored.  clang-cl honors that too.  I should actually add a test case for that too.

http://reviews.llvm.org/D5764






More information about the cfe-commits mailing list