<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 30, 2014 at 8:05 PM, Alp Toker <span dir="ltr"><<a href="mailto:alp@nuanti.com" target="_blank">alp@nuanti.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<div><br>
On 30/01/2014 18:29, Jordan Rose wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
   Alp was trying to move away from getCustomDiagID, so you should probably talk to him about this.<br>
</blockquote>
<br></div>
Thanks for pinging Jordan, that's right.<br>
<br>
Alex, can you provide an example of how you intend to use this facility, say a patch making use of it with a test case to get the full picture?<br></blockquote><div><br></div><div>One example of usage is in this patch: <a href="http://llvm-reviews.chandlerc.com/D2661" target="_blank">http://llvm-reviews.chandlerc.com/D2661</a> (the test is in clang/tools/extra/test/clang-tidy/basic.cpp). Another usage may appear in the static analyzer, if we go forward with the checker name forwarding. The idea is, that both clang-tidy and the static analyzer have a concept of named checks (or checkers), that can be enabled or disabled from the command line. It is similar to built-in diagnostics in clang, except for the difference in the option syntax (for clang-tidy it's -checks=<regex> and -disable-checks=<regex> instead of -W[no-]diagnostic-name). It seems to be reasonable to use something similar to getWarningOptionForDiag to pass check names through the DiagnosticEngine. Currently this is not available for custom diagnostics.</div>

<div><br></div><div>Both clang-tidy and the static analyzer use custom diagnostics, as they are built optionally, and we can't statically generate diagnostics and make clang pick them up in the way built-in diagnostics are handled. Furthermore, we have plans for clang-tidy to support custom out-of-tree check modules, which would make this even more complicated. So we have to use custom diagnostics, and I propose adding making some features of built-in diagnostics available for custom diagnostics (for now, getWarningOptionForDiag).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

There's a place for getCustomDiagID() so we wont phase it away entirely but I've got a feeling there might be a cleaner solution in this instance. </blockquote><div><br></div><div>If you have a better idea, I'd be happy to discuss it.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

<br>
(As for the patch, there are a couple of nits. I'll provide an inline review if we do want to go with it.)<span><font color="#888888"><br>
<br>
Alp.<br>
<br>
<br>
-- <br>
<a href="http://www.nuanti.com" target="_blank">http://www.nuanti.com</a><br>
the browser experts<br></font></span></blockquote></div>
</div></div>