NagyDonat wrote:
The reason why I the support for multiple `RegisteredNames` instead of a single
`Name` is directly introduced within `CheckerBase` is that this significantly
simplifies the implementation. [1]
However if you wish so I could easily introduce a `static_assert` which ensures
that multipart checkers must be declared as
```c++
class FancyChecker: public Checker<check::Something, check::SomethingElse,
MultipleParts> {
...
}
```
or even as
```c++
class FancyChecker: public Checker<check::Something, check::SomethingElse,
MultipleParts<CK_NumCheckKinds>> {
...
}
```
[1]: Code that can handle an arbitrary number of names is trivially capable of
handling a single name; so if every checker has an array of `RegisteredNames`
under the hood (which may be an 1-element array), then the same code can handle
both the simple and the complex checkers. On the other hand, if some checkers
have a single `Name` while others have an array of multiple names, then the two
cases must be handled separately by ugly `if (HasMultipleNames) {...} else
{...}` conditionals.
https://github.com/llvm/llvm-project/pull/130985
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits