<div dir="ltr"><div dir="ltr">Sorry about the delayed reply, I only saw this thread when it popped up again today.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Aug 14, 2019 at 7:37 PM Artem Dergachev via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div bgcolor="#FFFFFF">
    On 8/14/19 9:20 AM, Reid Kleckner wrote:<br>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">On Wed, Aug 14, 2019 at 12:24 AM Dmitri Gribenko
          via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:</div>
        <div class="gmail_quote">
          <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
            I would like to suggest something different: move Clang
            Static<br>
            Analyzer to clang-tools-extra. Build it either as a separate
            binary or<br>
            compile it into the clang-tidy binary. Then let `clang
            -analyze`<br>
            delegate to that binary for backwards compatibility.<br>
          </blockquote>
          <div><br>
          </div>
          <div>Speaking as an outsider in the peanut gallery who does
            very little static analysis, this is very appealing to me.
            It would save binary size in clang and make building and
            testing clang faster, if the developer isn't working in the
            static analyzer space.</div></div></div></blockquote></div></blockquote><div>A bit +1 to this from me as well. <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF"><blockquote type="cite"><div dir="ltr"><div class="gmail_quote">
        </div>
      </div>
    </blockquote>
    <br>
    Generally we already have a cmake flag for this,
    -DCLANG_ENABLE_STATIC_ANALYZER=OFF (defaults to ON). This flag is
    definitely a must-have for people who try to make their clang binary
    as tiny as possible. But i understand that this flag is not
    exceptionally discoverable and a lot of people probably suffer
    unnecessarily long compile times simply because they didn't discover
    it.<br></div></blockquote><div><br></div><div>I'm aware of this flag, but it doesn't quite do what I want: I want clang-tidy to have the static analyzer, but I don't want my compiler to have it. It'd be nice if there was a setting that allowed putting the analyzer in clang-tidy but not in clang, and to make `clang -analyze` shell out to clang-tidy for backwards compat.</div><div><br></div><div>I agree that the analyzer is in the compiler mainly for historical reasons, and that we wouldn't move it form clang-tidy into the compiler if it was only in clang-tidy. This suggests that that's the future we should work towards.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
    <br>
    That said, i suspect that unless you work exclusively on CodeGen,
    you probably do not want to turn off the Static Analyzer, because
    the Static Analyzer has some interesting tests that you can
    accidentally break when you work on anything else (Preprocessor,
    Lexer, AST, Sema...). In particular, Richard Smith regularly touches
    our code :)<br>
  </div>

_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div></div>