#include "UseStdNumbersCheck.h"
#include "../ClangTidyDiagnosticConsumer.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
#include "clang/AST/Stmt.h"
#include "clang/AST/Type.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/ASTMatchers/ASTMatchersInternal.h"
#include "clang/ASTMatchers/ASTMatchersMacros.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/LLVM.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/MathExtras.h"
#include <array>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <initializer_list>
#include <string>
#include <tuple>
#include <utility>
namespace {
usingnamespaceclang::ast_matchers;
Matcher;
StringRef;
AST_MATCHER_P2(clang::FloatingLiteral, near, double, Value, double,
DiffThreshold) { … }
AST_MATCHER_P(clang::QualType, hasCanonicalTypeUnqualified,
Matcher<clang::QualType>, InnerMatcher) { … }
AST_MATCHER(clang::QualType, isArithmetic) { … }
AST_MATCHER(clang::QualType, isFloating) { … }
AST_MATCHER_P(clang::Expr, anyOfExhaustive, std::vector<Matcher<clang::Stmt>>,
Exprs) { … }
struct MatchBuilder { … };
std::string getCode(const StringRef Constant, const bool IsFloat,
const bool IsLongDouble) { … }
bool isRangeOfCompleteMacro(const clang::SourceRange &Range,
const clang::SourceManager &SM,
const clang::LangOptions &LO) { … }
}
namespace clang::tidy::modernize {
UseStdNumbersCheck::UseStdNumbersCheck(const StringRef Name,
ClangTidyContext *const Context)
: … { … }
void UseStdNumbersCheck::registerMatchers(MatchFinder *const Finder) { … }
void UseStdNumbersCheck::check(const MatchFinder::MatchResult &Result) { … }
void UseStdNumbersCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *const PP,
Preprocessor *const ModuleExpanderPP) { … }
void UseStdNumbersCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
}