[cfe-dev] [analyzer] Reimplementing checker options -- looking for reviews!

Gábor Horváth via cfe-dev cfe-dev at lists.llvm.org
Mon Mar 18 03:07:52 PDT 2019


Hi Devin!

On Mon, 18 Mar 2019 at 05:04, Devin Coughlin <dcoughlin at apple.com> wrote:

> Hi Kristóf,
>
> It’s great to see this area getting cleaned up!
>
> On Mar 16, 2019, at 1:32 PM, Kristóf Umann <dkszelethus at gmail.com> wrote:
>
> Hi!
>
> TL;DR: The API for registering checker options changes once several
> changes that are up for review now land. This affects out-of-tree and
> checker plugin developers. Now's the time to participate in the discussion!
>
>
> As a reminder, LLVM encourages an incremental development process where
> for significant changes it is important to discuss the change and gather
> consensus. This can avoiding wasted effort implement an approach that
> doesn’t have consensus. See <
> https://www.llvm.org/docs/DeveloperPolicy.html#incremental-changes>. It
> also makes the patches easier to review.
>
> In (not overwhelmingly) more detail:
>
> After many-many months of hard work, I'm very confident in the current
> state of the project. Allow me to elaborate.
>
> In the recent months, the frontend of the analyzer, specifically how
> command line options are handled, have changed a lot. Right now, compared
> to how things used to be,
>
> * We can list non-checker analyzer configurations
> * We can verify user input for non-checker analyzer configurations
> * The interface of AnalyzerOptions changed dramatically in order not to
> allow this problem to arise again
> * debug.ConfigDumper contains all non-checker analyzer configurations,
> making it an actually usable debug tool
>  * An almost decade-old issue, the checker naming bug was resolved by
> reimplementing checker dependencies, and the related interface was also
> changed to guard against this happening again
>
> You probably noticed that I put a very strong emphasis on *non-checker
> analyzer configurations* -- since checkers can be loaded run-time via
> plugins, doing the same for them is a far more difficult task.
>
>
> I’m not sure how much emphasis we should put on checkers loaded via
> plugins. The analyzer really doesn’t support a plugin model and probably
> never will, given the difficulty of maintaining a stable C++ ABI when the
> components we depend on (such as the AST) don’t expose one in C++.
>

I am kind of surprised that C++ ABI is a concern. While I do admint that it
is kind of a fragile solution LLVM does support loading passes dynamically
that are using the C++ API. What is the difference between LLVM and CSA in
this regard?


>
> I've uploaded several patches that finally fixes this for good. Although
> these have up for more than a month now, the code changed quite a bit, and
> after several in-office discussions, vigorous testing and refactoring, I'm
> very confident that everything is in it's final place. Please take a look
> if these changes affect you!
>
> The most important of these patches is https://reviews.llvm.org/D57855.
> Please visit the "Stack" as well, the list of patches that depend on this
> and those this depends on. While 11 patches might seem a little scary at
> first, I've put a lot of effort into making as small as possible, in order
> to easy on reviewing. Note that the one patch I highlighted here is quite
> large however.
>
>
> I commented on a bunch of these.
>
> It is really, really great to see the improvements in testability and
> specification here. As I noted in some of the patches, I do have some
> serious concerns about the changes to the user model and command-line flags
> — but I don’t want those to get in the way of the general goodness of many
> of the improvements here. It would probably be a good idea to tease apart
> the patches that change the user model from those that improve analyzer
> infrastructure. Let's get the infrastructure ones landed!
>

Clang does have a history of having flags that are exclusively for
developers -Weverything is being one example. I think if those flags make
developing clang more convenient it might be worth to have them while
making it clear in the documentation and the output that this is not
intended to be used by end user. What do you think, would such notices help?

Regards,
Gábor


>
> Devin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20190318/39c54bc6/attachment.html>


More information about the cfe-dev mailing list