<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Mon, 10 Dec 2018, 21:58 Artem Dergachev <<a href="mailto:noqnoqneo@gmail.com">noqnoqneo@gmail.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <br>
    <br>
    <div class="m_-4336266704086387967moz-cite-prefix">On 12/10/18 8:57 AM, Kristóf Umann via
      cfe-dev wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">Hi all!<br>
                          <br>
                          This mail is a heads up for out-of-tree
                          checker developers that I'm planning to land a
                          variety of changes to how checker registration
                          works. Also, I already commited some changes
                          to make the command line interface a little
                          less annoying. While I will properly document
                          most of these in some form or another with a
                          file in the actual repo, I'll leave about a
                          week for everyone to raise objections.
                          <div><br>
                          </div>
                          <div>===--- Checker registration ---===</div>
                          <div><br>
                          </div>
                          <div>Registering more than one checker in a
                            registry function leads to multiple checkers
                            receiving the same name. The solution was to
                            reimplement parts on the checker
                            registration process.</div>
                          <div><br>
                          </div>
                          <div>1. From now, all checkers should have a
                            corresponding <font face="monospace,
                              monospace">shouldRegister##CHECKERNAME</font>
                            function defined, similar to <font face="monospace, monospace">register##CHECKERNAME</font>.
                            The intent here is that once a registry
                            function is called, it should register the
                            checker. If based on some language options
                            you chose not to register your checker
                            within <font face="monospace, monospace">register##CHECKERNAME</font>,
                            please move all such conditions to the new
                            function.</div>
                          <div><a href="https://reviews.llvm.org/D55424" target="_blank" rel="noreferrer">https://reviews.llvm.org/D55424</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>2. A registry function is no longer
                            allowed to register more then one checker.
                            Also, <font face="monospace, monospace">CheckerManager::registerChecker<CHECKER></font>
                            may only be called once per checker. If you
                            intend to acquire a checker object within a
                            registry function (for example, if it merely
                            enables extension to the main checker),
                            please use <font face="monospace,
                              monospace">CheckerManager::getChecker<CHECKER></font>.
                            You can ensure that the checker you'd like
                            to acquire is already registered by adding
                            it as a dependency via <font face="monospace, monospace">CheckerRegistry::addDependency</font>.</div>
                          <div><a href="https://reviews.llvm.org/D54438" target="_blank" rel="noreferrer">https://reviews.llvm.org/D54438</a><br>
                          </div>
                          <div><a href="https://reviews.llvm.org/D55429" target="_blank" rel="noreferrer">https://reviews.llvm.org/D55429</a><br>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Aren't we doing dependencies via Checkers.td?<br></div></blockquote></div></div><div dir="auto">I should've been more clear: in the official repo yes, and I guess using the same method out-of-tree is the easiest solution, but essentially this is what happening under the hood.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><br>
    <blockquote type="cite">
      <div dir="ltr">
        <div dir="ltr">
          <div dir="ltr">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div dir="ltr">
                        <div dir="ltr">
                          <div><br>
                          </div>
                          <div>3. <font face="monospace, monospace">CheckerRegistry</font>
                            was moved from the <font face="monospace,
                              monospace">Core</font> directory to <font face="monospace, monospace">Frontend</font>.<br>
                          </div>
                          <div><a href="https://reviews.llvm.org/D54436" target="_blank" rel="noreferrer">https://reviews.llvm.org/D54436</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>===--- Command line interface ---===</div>
                          <div><br>
                          </div>
                          <div>Mainly focusing on <font face="monospace, monospace">-analyzer-config</font>
                            options, it was an ancient and annoying
                            issue that any invalid input would be
                            ignored and the analyzer simply didn't do
                            what you want -- this is changing. Please
                            note that most of these have already landed.</div>
                          <div><br>
                          </div>
                          <div>1. <font face="monospace, monospace">AnalyzerOptions</font>
                            no longer supports adding non-checker
                            options without modifying the actual
                            implementation, which can be done by writing
                            a new entry in <font face="monospace,
                              monospace">AnalyzerOptions.def</font>.</div>
                          <div><a href="https://reviews.llvm.org/D53483" target="_blank" rel="noreferrer">https://reviews.llvm.org/D53483</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>2. There is a new <font face="monospace,
                              monospace">-analyzer-config-help</font>
                            flag to list all non-checker configurations.</div>
                          <div><a href="https://reviews.llvm.org/D53296" target="_blank" rel="noreferrer">https://reviews.llvm.org/D53296</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>3. A new flag was added that will emit a
                            warning on almost any invalid <font face="monospace, monospace">-analyzer-config</font>
                            input, called <font face="monospace,
                              monospace">-analyzer-config-compatibility-mode</font>.
                            When the analyzer is invoked with <font face="monospace, monospace">-analyze</font>
                            (in driver mode, I'm unsure about the
                            correct terminology), it will be set to
                            false by default, but will be enabled with
                            -cc1 (in frontend mode). You may enable this
                            feature in the driver mode via
                            -Xclang analyzer-config-compatibility-mode=true.</div>
                          <div><a href="https://reviews.llvm.org/D53280" target="_blank" rel="noreferrer">https://reviews.llvm.org/D53280</a><br>
                          </div>
                          <div><br>
                          </div>
                          <div>4. Similar plans are already in motion to
                            make checker options similarly strict.</div>
                          <div><br>
                          </div>
                          <div>Cheers,</div>
                          <div>Kristóf Umann</div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="m_-4336266704086387967mimeAttachmentHeader"></fieldset>
      <pre class="m_-4336266704086387967moz-quote-pre">_______________________________________________
cfe-dev mailing list
<a class="m_-4336266704086387967moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org" target="_blank" rel="noreferrer">cfe-dev@lists.llvm.org</a>
<a class="m_-4336266704086387967moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank" rel="noreferrer">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
    </blockquote>
    <br>
  </div>

</blockquote></div></div></div>