Similarly to other patches of mine, I'm trying to uniformize the checker interface so that dependency checkers don't emit diagnostics. The checker that made me most anxious so far was definitely RetainCount, because it is definitely impacted by backward compatibility concerns, and implements a checker hierarchy that is a lot different to other examples of similar size. Also, I don't have authority, nor expertise regarding ObjC related code, so I welcome any objection/discussion!
I lack the knowledge required to do that myself, unfortunately, and I'm no client of this checker, I'm not even sure what I would want to see it do.
We need unique pointers because BugType has no default constructor, and we receive the checker name after adding the checker object to CheckerManager (this happens in registerRetainCountBase). Other checkers use unique pointers for this type as well.
The lazy init, as opposed to simple initializing happens so that the checker name associated with the bug report doesn't depend on the registration order of RetainCount and OSObjectRetainCount (I guess I could've explained this in the code as well, huh). Right now, it only depends on which checker is enabled, which is bad enough, but addressing this TODO will fix that in an instant.
Found a small mistake that should be corrected, then will be good to me.
Why adding this extra header? Don't blame clangd :D
This is mixed up with line 1, this line should be no-os-object.