llvm/clang-tools-extra/clang-tidy/bugprone/SuspiciousEnumUsageCheck.cpp

//===--- SuspiciousEnumUsageCheck.cpp - clang-tidy-------------------------===//
//
// 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 "SuspiciousEnumUsageCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include <algorithm>

usingnamespaceclang::ast_matchers;

namespace clang::tidy::bugprone {

static const char DifferentEnumErrorMessage[] =;

static const char BitmaskErrorMessage[] =;

static const char BitmaskVarErrorMessage[] =;

static const char BitmaskNoteMessage[] =;

/// Stores a min and a max value which describe an interval.
struct ValueRange {};

/// Return the number of EnumConstantDecls in an EnumDecl.
static int enumLength(const EnumDecl *EnumDec) {}

static bool hasDisjointValueRange(const EnumDecl *Enum1,
                                  const EnumDecl *Enum2) {}

static bool isNonPowerOf2NorNullLiteral(const EnumConstantDecl *EnumConst) {}

static bool isMaxValAllBitSetLiteral(const EnumDecl *EnumDec) {}

static int countNonPowOfTwoLiteralNum(const EnumDecl *EnumDec) {}

/// Check if there is one or two enumerators that are not a power of 2 and are
/// initialized by a literal in the enum type, and that the enumeration contains
/// enough elements to reasonably act as a bitmask. Exclude the case where the
/// last enumerator is the sum of the lesser values (and initialized by a
/// literal) or when it could contain consecutive values.
static bool isPossiblyBitMask(const EnumDecl *EnumDec) {}

SuspiciousEnumUsageCheck::SuspiciousEnumUsageCheck(StringRef Name,
                                                   ClangTidyContext *Context)
    :{}

void SuspiciousEnumUsageCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {}

void SuspiciousEnumUsageCheck::registerMatchers(MatchFinder *Finder) {}

void SuspiciousEnumUsageCheck::checkSuspiciousBitmaskUsage(
    const Expr *NodeExpr, const EnumDecl *EnumDec) {}

void SuspiciousEnumUsageCheck::check(const MatchFinder::MatchResult &Result) {}

} // namespace clang::tidy::bugprone