[PATCH] D44064: [Driver] Automatically disable incompatible default sanitizers

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 5 16:29:03 PST 2018

phosek added inline comments.

Comment at: clang/lib/Driver/SanitizerArgs.cpp:369
   // Check that LTO is enabled if we need it.
   if ((Kinds & NeedsLTO) && !D.isUsingLTO()) {
vitalybuka wrote:
> Is this change needed to avoid errors at "Kinds & NeedsLTO" and KindsToDiagnose?
> Could you create a test for this change?
It is needed for D44065, if we enable some sanitizers like SafeStack by default, user would get an error when they enable some incompatible sanitizer like ASan and would require them passing `-fno-sanitizer=safe-stack` to avoid that error which is non-intuitive. Instead, with this change the incompatible default sanitizers are disabled automatically.

  rC Clang


More information about the cfe-commits mailing list