[cfe-dev] [RFC] Creating base class for 'Test after X' checkers
Daniel Marjamäki
Daniel.Marjamaki at evidente.se
Sun Aug 24 02:25:04 PDT 2014
Hello!
Recently a TestAfterDivZero checker was added to the static analyser (r212731).
We could add many related checkers, for example:
* test after null pointer dereference
* test after array index out of bounds
* test after dangerous/invalid function argument
* ...
I wonder what you think about creating generic base classes for TestAfterX checkers. Would you prefer copy/paste?
I attach a proof of concept patch. It adds a include file llvm/tools/clang/include/StaticAnalyzer/Core/TestAfterChecker.h. Is that the proper path where it should be or would it be better somewhere else? There is no implementation but I should add it in llvm/tools/clang/lib/StaticAnalyzer/Core/TestAfterChecker.cpp, shouldn't I? Do you have an opinion about the namespace usage?
It might still be possible to move some more code from the checker to the base classes. The current code is work-in-progress.
Best regards,
Daniel Marjamäki
..................................................................................................................
Daniel Marjamäki Senior Engineer
Evidente ES East AB Warfvinges väg 34 SE-112 51 Stockholm Sweden
Mobile: +46 (0)709 12 42 62
E-mail: Daniel.Marjamaki<mailto:Daniel.Marjamaki at evidente.se>@evidente.se<mailto:Daniel.Marjamaki at evidente.se>
www.evidente.se
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140824/fa7cf5d4/attachment.html>
More information about the cfe-dev
mailing list