#include "UppercaseLiteralSuffixCheck.h"
#include "../utils/ASTUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/SmallString.h"
#include <cctype>
#include <optional>
usingnamespaceclang::ast_matchers;
namespace clang::tidy::readability {
namespace {
struct IntegerLiteralCheck { … };
constexpr llvm::StringLiteral IntegerLiteralCheck::Name;
constexpr llvm::StringLiteral IntegerLiteralCheck::SkipFirst;
constexpr llvm::StringLiteral IntegerLiteralCheck::Suffixes;
struct FloatingLiteralCheck { … };
constexpr llvm::StringLiteral FloatingLiteralCheck::Name;
constexpr llvm::StringLiteral FloatingLiteralCheck::SkipFirst;
constexpr llvm::StringLiteral FloatingLiteralCheck::Suffixes;
struct NewSuffix { … };
std::optional<SourceLocation> getMacroAwareLocation(SourceLocation Loc,
const SourceManager &SM) { … }
std::optional<SourceRange> getMacroAwareSourceRange(SourceRange Loc,
const SourceManager &SM) { … }
std::optional<std::string>
getNewSuffix(llvm::StringRef OldSuffix,
const std::vector<StringRef> &NewSuffixes) { … }
template <typename LiteralType>
std::optional<NewSuffix>
shouldReplaceLiteralSuffix(const Expr &Literal,
const std::vector<StringRef> &NewSuffixes,
const SourceManager &SM, const LangOptions &LO) { … }
}
UppercaseLiteralSuffixCheck::UppercaseLiteralSuffixCheck(
StringRef Name, ClangTidyContext *Context)
: … { … }
void UppercaseLiteralSuffixCheck::storeOptions(
ClangTidyOptions::OptionMap &Opts) { … }
void UppercaseLiteralSuffixCheck::registerMatchers(MatchFinder *Finder) { … }
template <typename LiteralType>
bool UppercaseLiteralSuffixCheck::checkBoundMatch(
const MatchFinder::MatchResult &Result) { … }
void UppercaseLiteralSuffixCheck::check(
const MatchFinder::MatchResult &Result) { … }
}