llvm/clang-tools-extra/clang-tidy/readability/MagicNumbersCheck.cpp

//===--- MagicNumbersCheck.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
//
//===----------------------------------------------------------------------===//
//
// A checker for magic numbers: integer or floating point literals embedded
// in the code, outside the definition of a constant or an enumeration.
//
//===----------------------------------------------------------------------===//

#include "MagicNumbersCheck.h"
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/ASTTypeTraits.h"
#include "clang/AST/Type.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>

usingnamespaceclang::ast_matchers;

namespace clang {

static bool isUsedToInitializeAConstant(const MatchFinder::MatchResult &Result,
                                        const DynTypedNode &Node) {}

static bool isUsedToDefineATypeAlias(const MatchFinder::MatchResult &Result,
                                     const DynTypedNode &Node) {}

static bool isUsedToDefineABitField(const MatchFinder::MatchResult &Result,
                                    const DynTypedNode &Node) {}

namespace tidy::readability {

const char DefaultIgnoredIntegerValues[] =;
const char DefaultIgnoredFloatingPointValues[] =;

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

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

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

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

bool MagicNumbersCheck::isConstant(const MatchFinder::MatchResult &Result,
                                   const Expr &ExprResult) const {}

bool MagicNumbersCheck::isIgnoredValue(const IntegerLiteral *Literal) const {}

bool MagicNumbersCheck::isIgnoredValue(const FloatingLiteral *Literal) const {}

bool MagicNumbersCheck::isSyntheticValue(const SourceManager *SourceManager,
                                         const IntegerLiteral *Literal) const {}

bool MagicNumbersCheck::isBitFieldWidth(
    const clang::ast_matchers::MatchFinder::MatchResult &Result,
    const IntegerLiteral &Literal) const {}

bool MagicNumbersCheck::isUserDefinedLiteral(
    const clang::ast_matchers::MatchFinder::MatchResult &Result,
    const clang::Expr &Literal) const {}

} // namespace tidy::readability
} // namespace clang