<div dir="auto"><div dir="ltr">+ Dániel Krupp</div><div dir="ltr"><br></div><div dir="ltr">Another idea I was thinking is </div><div dir="ltr"><br></div><div dir="ltr">1. To be able to dump all analyzer configs in a JSON (or yaml, whatever) file, and similarly, be able to read such a config file.</div><div dir="ltr"><br></div><div dir="ltr">2. The use of Optional is impactical. We lazily evaluate every option the user supplied only when is asked for. Instead, we could do the evaluation when the cmd line options are parsed, at which point we can also check for wrong input (like whether string options have typos, or flag X won't do a thing when flag Y isn't set) since we have access to a DiagnosticsEngine.</div><div dir="ltr"><br></div><div dir="ltr">3. Remove getBooleanOption, getOptionAsString, etc, and only provide general option getters for checkers, in order to support shared lib checkers. This would force anyone who'd like add a flag to actually register it properly. I'm already trying to come up a neat solution to neatly handle checker options.</div><div dir="auto"><br></div>I've wasted more time on making a typos in config flags than I'd like to admit, so I'm super motivated to make a much stricter version of AnalyzerOptions. While keeping backward compatibility, of course.<div dir="auto"><br></div><div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Argyrios Kyrtzidis <<a href="mailto:akyrtzi@gmail.com" target="_blank">akyrtzi@gmail.com</a>> ezt írta (időpont: 2018. okt. 13., Szo, 0:45):<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><br><div><br><blockquote type="cite"><div>On Oct 7, 2018, at 11:26 AM, Kristóf Umann via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="m_7345783068551837146m_-4343576601425936917Apple-interchange-newline"><div><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">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<"<wbr>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<"<wbr>NonilStringConstantsChecker.<wbr>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"><br></span></div><div><font color="#24292e" face="arial, helvetica, sans-serif"><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.<wbr>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 color="#24292e" face="monospace, monospace"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></div><div><font color="#24292e" face="monospace, monospace"><span style="font-size:12px;white-space:pre-wrap">#define CHECKER(FULLNAME,CLASS,<wbr>DESCFILE,HELPTEXT,GROUPINDEX,<wbr>HIDDEN)    \
  registry.addChecker(register##<wbr>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"><br></font></span></div><div><font color="#24292e" face="arial, helvetica, sans-serif"><span style="font-size:12px;white-space:pre-wrap">So, is there a point in keeping DescFile entries?</span></font></div></div></div></div></div></blockquote><div><br></div><div>Just to give some context for ‘<span style="white-space:pre-wrap;color:rgb(36,41,46);font-family:arial,helvetica,sans-serif">DescFile'</span>, the intention of this was to point to a file that we could use to add detailed documentation for a checker with a specific format, think of something like extensive doxygen documentation, and a tool would be able to extract such detailed documentation from the source files and render them in another format, like html pages for <span style="text-decoration:underline"><font color="#3586ff"><span><a href="http://clang-analyzer.llvm.org" target="_blank">clang-analyzer.llvm.org</a></span></font><font color="#453ccc"><span>.</span></font></span></div><div><br></div><div>However, this never materialized and it’s useless now.</div></div></div></blockquote></div><div dir="auto">Thanks! That actually sounds neat, we had a few conversations in the office about auto-generating the website, like clang-tidy, so I'm not a hurry to remove these just yet.</div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><br><blockquote type="cite"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font color="#24292e" face="arial, helvetica, sans-serif"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></div><div><font color="#24292e" face="arial, helvetica, sans-serif"><span style="font-size:12px;white-space:pre-wrap">2. Use tblgen for AnalyzerOptions:</span></font></div><div><font color="#24292e" face="arial, helvetica, sans-serif"><span style="font-size:12px;white-space:pre-wrap"><br></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 color="#24292e" face="arial, helvetica, sans-serif"><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 color="#24292e" face="arial, helvetica, sans-serif"><span style="font-size:12px;white-space:pre-wrap"><br></span></font></div><div><font color="#24292e" face="arial, helvetica, sans-serif"><span style="font-size:12px;white-space:pre-wrap">Cheers,</span></font></div><div>Kristóf</div></div></div></div>
______________________________<wbr>_________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br></div></blockquote></div><br></div></blockquote></div></div></div>