llvm/clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp

//===- CheckerRegistry.cpp - Maintains all available checkers -------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LLVM.h"
#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Frontend/FrontendDiagnostic.h"
#include "clang/StaticAnalyzer/Checkers/BuiltinCheckerRegistration.h"
#include "clang/StaticAnalyzer/Core/AnalyzerOptions.h"
#include "clang/StaticAnalyzer/Core/CheckerManager.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/DynamicLibrary.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>

usingnamespaceclang;
usingnamespaceento;
usingnamespacechecker_registry;
DynamicLibrary;

//===----------------------------------------------------------------------===//
// Utilities.
//===----------------------------------------------------------------------===//

static bool isCompatibleAPIVersion(const char *VersionString) {}

static constexpr char PackageSeparator =;

//===----------------------------------------------------------------------===//
// Methods of CheckerRegistry.
//===----------------------------------------------------------------------===//

CheckerRegistry::CheckerRegistry(
    CheckerRegistryData &Data, ArrayRef<std::string> Plugins,
    DiagnosticsEngine &Diags, AnalyzerOptions &AnOpts,
    ArrayRef<std::function<void(CheckerRegistry &)>> CheckerRegistrationFns)
    :{}

//===----------------------------------------------------------------------===//
// Dependency resolving.
//===----------------------------------------------------------------------===//

template <typename IsEnabledFn>
static bool collectStrongDependencies(const ConstCheckerInfoList &Deps,
                                      const CheckerManager &Mgr,
                                      CheckerInfoSet &Ret,
                                      IsEnabledFn IsEnabled);

/// Collects weak dependencies in \p enabledData.Checkers.
template <typename IsEnabledFn>
static void collectWeakDependencies(const ConstCheckerInfoList &Deps,
                                    const CheckerManager &Mgr,
                                    CheckerInfoSet &Ret, IsEnabledFn IsEnabled);

void CheckerRegistry::initializeRegistry(const CheckerManager &Mgr) {}

template <typename IsEnabledFn>
static bool collectStrongDependencies(const ConstCheckerInfoList &Deps,
                                      const CheckerManager &Mgr,
                                      CheckerInfoSet &Ret,
                                      IsEnabledFn IsEnabled) {}

template <typename IsEnabledFn>
static void collectWeakDependencies(const ConstCheckerInfoList &WeakDeps,
                                    const CheckerManager &Mgr,
                                    CheckerInfoSet &Ret,
                                    IsEnabledFn IsEnabled) {}

template <bool IsWeak> void CheckerRegistry::resolveDependencies() {}

void CheckerRegistry::addDependency(StringRef FullName, StringRef Dependency) {}

void CheckerRegistry::addWeakDependency(StringRef FullName,
                                        StringRef Dependency) {}

//===----------------------------------------------------------------------===//
// Checker option resolving and validating.
//===----------------------------------------------------------------------===//

/// Insert the checker/package option to AnalyzerOptions' config table, and
/// validate it, if the user supplied it on the command line.
static void insertAndValidate(StringRef FullName, const CmdLineOption &Option,
                              AnalyzerOptions &AnOpts,
                              DiagnosticsEngine &Diags) {}

template <class T>
static void insertOptionToCollection(StringRef FullName, T &Collection,
                                     const CmdLineOption &Option,
                                     AnalyzerOptions &AnOpts,
                                     DiagnosticsEngine &Diags) {}

void CheckerRegistry::resolveCheckerAndPackageOptions() {}

void CheckerRegistry::addPackage(StringRef FullName) {}

void CheckerRegistry::addPackageOption(StringRef OptionType,
                                       StringRef PackageFullName,
                                       StringRef OptionName,
                                       StringRef DefaultValStr,
                                       StringRef Description,
                                       StringRef DevelopmentStatus,
                                       bool IsHidden) {}

void CheckerRegistry::addChecker(RegisterCheckerFn Rfn,
                                 ShouldRegisterFunction Sfn, StringRef Name,
                                 StringRef Desc, StringRef DocsUri,
                                 bool IsHidden) {}

void CheckerRegistry::addCheckerOption(StringRef OptionType,
                                       StringRef CheckerFullName,
                                       StringRef OptionName,
                                       StringRef DefaultValStr,
                                       StringRef Description,
                                       StringRef DevelopmentStatus,
                                       bool IsHidden) {}

void CheckerRegistry::initializeManager(CheckerManager &CheckerMgr) const {}

static void isOptionContainedIn(const CmdLineOptionList &OptionList,
                                StringRef SuppliedChecker,
                                StringRef SuppliedOption,
                                const AnalyzerOptions &AnOpts,
                                DiagnosticsEngine &Diags) {}

void CheckerRegistry::validateCheckerOptions() const {}