#include "TaggedUnionMemberCountCheck.h"
#include "../utils/OptionsUtils.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallSet.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy::bugprone {
static constexpr llvm::StringLiteral StrictModeOptionName = …;
static constexpr llvm::StringLiteral EnableCountingEnumHeuristicOptionName = …;
static constexpr llvm::StringLiteral CountingEnumPrefixesOptionName = …;
static constexpr llvm::StringLiteral CountingEnumSuffixesOptionName = …;
static constexpr bool StrictModeOptionDefaultValue = …;
static constexpr bool EnableCountingEnumHeuristicOptionDefaultValue = …;
static constexpr llvm::StringLiteral CountingEnumPrefixesOptionDefaultValue = …;
static constexpr llvm::StringLiteral CountingEnumSuffixesOptionDefaultValue = …;
static constexpr llvm::StringLiteral RootMatchBindName = …;
static constexpr llvm::StringLiteral UnionMatchBindName = …;
static constexpr llvm::StringLiteral TagMatchBindName = …;
namespace {
AST_MATCHER_P2(RecordDecl, fieldCountOfKindIsOne,
ast_matchers::internal::Matcher<FieldDecl>, InnerMatcher,
StringRef, BindName) { … }
}
TaggedUnionMemberCountCheck::TaggedUnionMemberCountCheck(
StringRef Name, ClangTidyContext *Context)
: … { … }
void TaggedUnionMemberCountCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) { … }
void TaggedUnionMemberCountCheck::registerMatchers(MatchFinder *Finder) { … }
bool TaggedUnionMemberCountCheck::isCountingEnumLikeName(StringRef Name) const { … }
std::pair<const std::size_t, const EnumConstantDecl *>
TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) { … }
void TaggedUnionMemberCountCheck::check(
const MatchFinder::MatchResult &Result) { … }
}