Path: blob/main/contrib/llvm-project/clang/lib/StaticAnalyzer/Frontend/CreateCheckerManager.cpp
35266 views
//===- CheckerManager.h - Static Analyzer Checker Manager -------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// Defines the Static Analyzer Checker Manager.9//10//===----------------------------------------------------------------------===//1112#include "clang/StaticAnalyzer/Core/CheckerManager.h"13#include "clang/StaticAnalyzer/Frontend/CheckerRegistry.h"14#include <memory>1516namespace clang {17namespace ento {1819CheckerManager::CheckerManager(20ASTContext &Context, AnalyzerOptions &AOptions, const Preprocessor &PP,21ArrayRef<std::string> plugins,22ArrayRef<std::function<void(CheckerRegistry &)>> checkerRegistrationFns)23: Context(&Context), LangOpts(Context.getLangOpts()), AOptions(AOptions),24PP(&PP), Diags(Context.getDiagnostics()),25RegistryData(std::make_unique<CheckerRegistryData>()) {26CheckerRegistry Registry(*RegistryData, plugins, Context.getDiagnostics(),27AOptions, checkerRegistrationFns);28Registry.initializeRegistry(*this);29Registry.initializeManager(*this);30finishedCheckerRegistration();31}3233CheckerManager::CheckerManager(AnalyzerOptions &AOptions,34const LangOptions &LangOpts,35DiagnosticsEngine &Diags,36ArrayRef<std::string> plugins)37: LangOpts(LangOpts), AOptions(AOptions), Diags(Diags),38RegistryData(std::make_unique<CheckerRegistryData>()) {39CheckerRegistry Registry(*RegistryData, plugins, Diags, AOptions, {});40Registry.initializeRegistry(*this);41}4243CheckerManager::~CheckerManager() {44for (const auto &CheckerDtor : CheckerDtors)45CheckerDtor();46}4748} // namespace ento49} // namespace clang505152