NagyDonat wrote:

> I think the order is deterministic, and due to how checker dependencies are 
> resolved, the backend checker would be always the one that is registered 
> first. I have not checked this.

You're correct wrt the current state of the code but I'm planning to get rid of 
many "backend/modeling" checkers that have no real purpose :sweat_smile:  -- in 
my opinion having a superfluous checker definition in `Checkers.td` is even 
worse than having a boilerplate `getDebugName` override.

There are a few modeling checkers that fulfill a valid role because they act as 
dependencies of checkers defined in other files/classes, but I want to 
eliminate the pattern where a checker class defines a modeling checker which is 
the dependency of the other "real" checkers from the class (to be registered 
first) and does nothing useful.

> I opted for this solution given my very limited time frame and that I 
> shouldn't block the progress of this PR.

Sorry for adding time pressure... 

> I firmly believe that as this is a debugging feature, the best name to print 
> is the class that gets registered.

I agree, but unfortunately there is no way to get the class name automatically 
in a platform-independent way without a third-party dependency like [the 
type_name boost 
library](https://www.boost.org/doc/libs/master/libs/core/doc/html/core/type_name.html).
 (Do I understand it correctly that we cannot just drop in an external 
dependency like this?)

Using the name of one subchecker is probably the least bad available approach 
and your code is an elegant implementation for it, so I'll probably apply it to 
get this PR merged. If you're not opposed, I would like to add a `family-of-` 
prefix to the debug names, which is a bit awkward but eliminates the ambiguity 
and the potential for confusion (somebody who briefly looks at some debug 
output will immediately see that the name identifies the _family_).



https://github.com/llvm/llvm-project/pull/139256
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to