=?utf-8?q?Donát?= Nagy <donat.n...@ericsson.com>, =?utf-8?q?Donát?= Nagy <donat.n...@ericsson.com> Message-ID: In-Reply-To: <llvm.org/llvm/llvm-project/pull/147...@github.com>
================ @@ -112,26 +112,35 @@ class CheckerRegistry { return true; } -public: - /// Adds a checker to the registry. Use this non-templated overload when your - /// checker requires custom initialization. - void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction sfn, + /// Adds a checker to the registry. This private, most general variant is + /// intended for loading the checker definitions from `Checkers.td`. + /// FIXME: The checker registry should not bother with loading `DocsUri` + /// because it is (as of now) never queried from the checker registry. + void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction Sfn, StringRef FullName, StringRef Desc, StringRef DocsUri, bool IsHidden); - /// Adds a checker to the registry. Use this templated overload when your - /// checker does not require any custom initialization. - /// This function isn't really needed and probably causes more headaches than - /// the tiny convenience that it provides, but external plugins might use it, - /// and there isn't a strong incentive to remove it. +public: + /// Adds a checker to the registry. Use this for a checker defined in a + /// plugin if it requires custom registration functions. + void addChecker(RegisterCheckerFn Fn, ShouldRegisterFunction Sfn, + StringRef FullName, StringRef Desc, bool IsHidden = false) { + addChecker(Fn, Sfn, FullName, Desc, "NoDocsUri", IsHidden); + } + + /// Adds a checker to the registry. Use this for a checker defined in a + /// plugin if it doesn't require custom registration functions. template <class T> - void addChecker(StringRef FullName, StringRef Desc, StringRef DocsUri, - bool IsHidden = false) { - // Avoid MSVC's Compiler Error C2276: - // http://msdn.microsoft.com/en-us/library/850cstw1(v=VS.80).aspx + void addChecker(StringRef FullName, StringRef Desc, bool IsHidden = false) { addChecker(&CheckerRegistry::initializeManager<CheckerManager, T>, - &CheckerRegistry::returnTrue<T>, FullName, Desc, DocsUri, - IsHidden); + &CheckerRegistry::returnTrue<T>, FullName, Desc, ---------------- steakhal wrote: just a random comment: I never understood why does `returnTrue` depend on type `T` if it just returns true xD https://github.com/llvm/llvm-project/pull/147797 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits