|
@@ -91,10 +91,11 @@ CheckerRegistry::getMutableCheckersForCmdLineArg(StringRef CmdLineArg) {
|
|
return { it, it + size };
|
|
return { it, it + size };
|
|
}
|
|
}
|
|
|
|
|
|
-CheckerRegistry::CheckerRegistry(ArrayRef<std::string> plugins,
|
|
|
|
- DiagnosticsEngine &diags,
|
|
|
|
- AnalyzerOptions &AnOpts,
|
|
|
|
- const LangOptions &LangOpts)
|
|
|
|
|
|
+CheckerRegistry::CheckerRegistry(
|
|
|
|
+ ArrayRef<std::string> plugins, DiagnosticsEngine &diags,
|
|
|
|
+ AnalyzerOptions &AnOpts, const LangOptions &LangOpts,
|
|
|
|
+ ArrayRef<std::function<void(CheckerRegistry &)>>
|
|
|
|
+ checkerRegistrationFns)
|
|
: Diags(diags), AnOpts(AnOpts), LangOpts(LangOpts) {
|
|
: Diags(diags), AnOpts(AnOpts), LangOpts(LangOpts) {
|
|
|
|
|
|
// Register builtin checkers.
|
|
// Register builtin checkers.
|
|
@@ -137,6 +138,13 @@ CheckerRegistry::CheckerRegistry(ArrayRef<std::string> plugins,
|
|
registerPluginCheckers(*this);
|
|
registerPluginCheckers(*this);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Register statically linked checkers, that aren't generated from the tblgen
|
|
|
|
+ // file, but rather passed their registry function as a parameter in
|
|
|
|
+ // checkerRegistrationFns.
|
|
|
|
+
|
|
|
|
+ for (const auto &Fn : checkerRegistrationFns)
|
|
|
|
+ Fn(*this);
|
|
|
|
+
|
|
// Sort checkers for efficient collection.
|
|
// Sort checkers for efficient collection.
|
|
// FIXME: Alphabetical sort puts 'experimental' in the middle.
|
|
// FIXME: Alphabetical sort puts 'experimental' in the middle.
|
|
// Would it be better to name it '~experimental' or something else
|
|
// Would it be better to name it '~experimental' or something else
|