This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Fix an assertion failure if plugins added dependencies
ClosedPublic

Authored by Szelethus on Mar 16 2019, 10:41 AM.

Details

Summary

Ideally, there is no reason behind not being able to depend on checkers that come from a different plugin (or on builtin checkers) -- however, this is only possible if all checkers are added to the registry before resolving checker dependencies. Since I used a binary search in my addDependency method, this also resulted in an assertion failure (due to CheckerRegistry::Checkers not being sorted), since the function used by plugins to register their checkers (clang_registerCheckers) calls addDependency.

This patch resolves this issue by only noting which dependencies have to established when addDependency is called, and resolves them at a later stage when no more checkers are added to the registry.

Diff Detail

Event Timeline

Szelethus created this revision.Mar 16 2019, 10:41 AM

Don't let the testcase fool you, it's merely added because there wasn't any for that particular case, I still need to add the plugin, but that moves quite a few files around, so I might separate that to another patch.

edit: Added it in D59464.

This one seems straightforward.

This revision is now accepted and ready to land.Mar 19 2019, 7:55 AM
This revision was automatically updated to reflect the committed changes.