<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
This is why i say that "i found a bug by looking at this report" is
not a valid definition of a true positive. You can find bug in *any*
code if you stare at it long enough.<br>
<br>
I've no idea how DescFile can be useful. It might be that the old
autotools-based build system was using it somehow. Finding file by
checker name is a rare task that can usually be accomplished with
grep, so no need to keep it for humans. Feel free to squash.<br>
<br>
Our -analyzer-config is indeed pretty chaotic. I heard that it was
designed for just one purpose: to not fail with an error when a flag
is not available, which is good for backward and/or forward
compatibility.<br>
<br>
I guess maintaining a current list of flags will still be good,
especially with longer descriptions, so you can try to do this. I
highly favor .def files (that can be #included directly, eg.
Analyses.def) over TableGen because TableGen code looked very hard
to understand last time i tried to work with it.<br>
<br>
Analyzer config flags are also very different, which suggests a UI
distinction:<br>
- A lot of them define "alpha" branches, so we shouldn't suggest
users to use them unless they're developing the respective feature.<br>
- Some define branches that were turned on by default so long ago
that nobody remembers them, so i guess they can be removed (eg.,
c++-template-inlining).<br>
- Some are thresholds or "temporary" hacks that are good to have as
an option so that it was easy to experiment with them (adjust
thresholds or remove hacks).<br>
- Some are useful for debugging (eg., prune-paths).<br>
- Some are actually important to maintain (eg., elide-constructors,
because lack of copy elision is a valid behavior until C++17, and
it's likely that some code is compiled without copy elision, and
they may want to tell the Analyzer to match their behavior).<br>
<br>
Supporting checker options (that are also passed as weird
-analyzer-config flags) is going to be a separate challenge.<br>
<br>
<br>
<div class="moz-cite-prefix">On 10/7/18 11:26 AM, Kristóf Umann via
cfe-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAGcXOD4HzLFiWbb5oJ3YLiyCsyoXpPsMbKXxDz5W_tWHGN4moA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">Hi!<br>
<br>
I have two questions about this topic.</div>
<div dir="ltr"><br>
</div>
<div dir="ltr">1. Checker registration:<br>
<br>
I am in the process of updating <a
href="http://clang-analyzer.llvm.org" target="_blank"
moz-do-not-send="true">clang-analyzer.llvm.org</a>, and
as I went through the checkers that were missing, I
encountered this:</div>
<div dir="ltr">
<div dir="ltr"><br>
</div>
<div dir="ltr"><font face="monospace, monospace">def
NonnullGlobalConstantsChecker:
Checker<"NonnilStringConstants">,</font></div>
<div dir="ltr"><font face="monospace, monospace">
HelpText<"Assume that const string-like globals are
non-null">,</font></div>
<div dir="ltr"><font face="monospace, monospace">
DescFile<"NonilStringConstantsChecker.cpp">;</font></div>
</div>
<div dir="ltr"><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap">
</span></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">What is particularly interesting here (other than the mismatched names), is that </span></font><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre-wrap">NonilStringConstantsChecker.cpp </span><span style="color:rgb(36,41,46);font-size:12px;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">doesn't exist, in fact it never did. To my greatest surprise, DescFile isn't used anywhere!</font></span></div>
<div><font face="monospace, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">
</span></font></div>
<div><font face="monospace, monospace" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">#define CHECKER(FULLNAME,CLASS,DESCFILE,HELPTEXT,GROUPINDEX,HIDDEN) \
registry.addChecker(register##CLASS, FULLNAME, HELPTEXT);</span></font>
</div>
<div><span style="color:rgb(36,41,46);font-size:12px;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">
</font></span></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">So, is there a point in keeping DescFile entries?</span></font></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">
</span></font></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">2. Use tblgen for AnalyzerOptions:</span></font></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">
</span></font></div>
<div><font color="#24292e"><span style="font-size:12px;white-space:pre-wrap"><font face="arial, helvetica, sans-serif">I dislike that I need to look at source code, or doxygen at best to know what kind </font><font face="monospace, monospace">-analyzer-config </font><font face="arial, helvetica, sans-serif">options are </font></span></font><font
face="arial, helvetica, sans-serif" color="#24292e"><span style="font-size:12px;white-space:pre-wrap">available. Would it be a good idea for me to refactor it with tblgen?</span></font></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">
</span></font></div>
<div><font face="arial, helvetica, sans-serif"
color="#24292e"><span style="font-size:12px;white-space:pre-wrap">Cheers,</span></font></div>
<div>Kristóf</div>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
cfe-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>