This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Allow registering custom statically-linked analyzer checkers
ClosedPublic

Authored by alexfh on Apr 17 2018, 3:48 AM.

Details

Summary

Add an extension point to allow registration of statically-linked Clang Static
Analyzer checkers that are not a part of the Clang tree. This extension point
employs the mechanism used when checkers are registered from dynamically loaded
plugins.

Diff Detail

Event Timeline

alexfh created this revision.Apr 17 2018, 3:48 AM

Tests would be nice, but on the other hand AFAIK we don't have unit tests for the analyzer. Maybe it's time we add those.

george.karpenkov retitled this revision from Allow registering custom statically-linked analyzer checkers to [analyzer] Allow registering custom statically-linked analyzer checkers.Apr 22 2018, 5:10 AM
george.karpenkov requested changes to this revision.Apr 22 2018, 5:27 AM

Actually, we do have unittests in tools/clang/unittest/Analysis.
@alexfh would you be able to write a unittest in there? It should be fairly easy following the structure of e.g. tools/clang/Analysis/CloneDetectionTest.cpp.
This would also help to ensure this entry point does not bit rot.

This revision now requires changes to proceed.Apr 22 2018, 5:27 AM

Actually, we do have unittests in tools/clang/unittest/Analysis.
@alexfh would you be able to write a unittest in there? It should be fairly easy following the structure of e.g. tools/clang/Analysis/CloneDetectionTest.cpp.
This would also help to ensure this entry point does not bit rot.

Thanks for the pointer. I'll add a test.

alexfh updated this revision to Diff 152317.Jun 21 2018, 8:57 AM
  • Added a test.

Please take another look.

This revision is now accepted and ready to land.Jun 21 2018, 9:46 AM
This revision was automatically updated to reflect the committed changes.