//===- CheckerRegistryData.h ------------------------------------*- C++ -*-===// // // 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 // //===----------------------------------------------------------------------===// // // This file contains the data structures to which the TableGen file Checkers.td // maps to, as well as what was parsed from the the specific invocation (whether // a checker/package is enabled, their options values, etc). // // The parsing of the invocation is done by CheckerRegistry, which is found in // the Frontend library. This allows the Core and Checkers libraries to utilize // this information, such as enforcing rules on checker dependency bug emission, // ensuring all checker options were queried, etc. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_STATICANALYZER_CORE_CHECKERREGISTRYDATA_H #define LLVM_CLANG_STATICANALYZER_CORE_CHECKERREGISTRYDATA_H #include "clang/Basic/LLVM.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringMap.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/raw_ostream.h" namespace clang { class AnalyzerOptions; namespace ento { class CheckerManager; /// Initialization functions perform any necessary setup for a checker. /// They should include a call to CheckerManager::registerChecker. RegisterCheckerFn; ShouldRegisterFunction; /// Specifies a command line option. It may either belong to a checker or a /// package. struct CmdLineOption { … }; CmdLineOptionList; struct CheckerInfo; CheckerInfoList; CheckerInfoListRange; ConstCheckerInfoList; CheckerInfoSet; /// Specifies a checker. Note that this isn't what we call a checker object, /// it merely contains everything required to create one. struct CheckerInfo { … }; StateFromCmdLine; /// Specifies a package. Each package option is implicitly an option for all /// checkers within the package. struct PackageInfo { … }; PackageInfoList; namespace checker_registry { template <class T> struct FullNameLT { … }; PackageNameLT; CheckerNameLT; template <class CheckerOrPackageInfoList> std::conditional_t<std::is_const<CheckerOrPackageInfoList>::value, typename CheckerOrPackageInfoList::const_iterator, typename CheckerOrPackageInfoList::iterator> binaryFind(CheckerOrPackageInfoList &Collection, StringRef FullName) { … } } // namespace checker_registry struct CheckerRegistryData { … }; } // namespace ento } // namespace clang #endif // LLVM_CLANG_STATICANALYZER_CORE_CHECKERREGISTRYDATA_H