[clang] [NFC][analyzer] Rewrite comment header of MallocChecker (PR #165443)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 02:48:45 PDT 2025


https://github.com/steakhal approved this pull request.

I had a quick look at the comment and it looks nice. I haven't checked the content wrt to the checker implementation though.

To me the most interesting point it this comment of the PR summary:
> I see that this block is a bit verbose (especially compared to the analogous comments in other checkers), but as this is one of the most complex checker families, I think it's useful to give this overview at the beginning of the source file.

I'm all for comments like this. This is the right place to document the design and the overall architecture. Potentially also including some ascii-art if applicable.
You probably know that IMO a comment inline in code should be brief, preferably a single line or two, and under very exceptional cases more. It is because it taxes every time someone wants to just read the code. The comment there would take up precious lines and make you scroll through. In contrast to this a comment at the top of the file has plenty of space, and a newcomer could (and should) opt in reading these. And as always, comments should be kept up to date to the extent possible.

https://github.com/llvm/llvm-project/pull/165443


More information about the cfe-commits mailing list