llvm/clang-tools-extra/clang-tidy/modernize/MacroToEnumCheck.cpp

//===--- MacroToEnumCheck.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 "MacroToEnumCheck.h"
#include "IntegralLiteralExpressionMatcher.h"

#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/Preprocessor.h"
#include "llvm/ADT/STLExtras.h"
#include <algorithm>
#include <cassert>
#include <cctype>
#include <string>

namespace clang::tidy::modernize {

static bool hasOnlyComments(SourceLocation Loc, const LangOptions &Options,
                            StringRef Text) {}

static StringRef getTokenName(const Token &Tok) {}

namespace {

struct EnumMacro {};

MacroList;

enum class IncludeGuard {};

struct FileState {};

} // namespace

class MacroToEnumCallbacks : public PPCallbacks {};

bool MacroToEnumCallbacks::isConsecutiveMacro(const MacroDirective *MD) const {}

void MacroToEnumCallbacks::clearCurrentEnum(SourceLocation Loc) {}

void MacroToEnumCallbacks::conditionStart(const SourceLocation &Loc) {}

void MacroToEnumCallbacks::checkCondition(SourceRange Range) {}

void MacroToEnumCallbacks::checkName(const Token &MacroNameTok) {}

void MacroToEnumCallbacks::rememberExpressionName(const Token &Tok) {}

void MacroToEnumCallbacks::rememberExpressionTokens(
    ArrayRef<Token> MacroTokens) {}

void MacroToEnumCallbacks::FileChanged(SourceLocation Loc,
                                       FileChangeReason Reason,
                                       SrcMgr::CharacteristicKind FileType,
                                       FileID PrevFID) {}

bool MacroToEnumCallbacks::isInitializer(ArrayRef<Token> MacroTokens)
{}


// Any defined but rejected macro is scanned for identifiers that
// are to be excluded as enums.
void MacroToEnumCallbacks::MacroDefined(const Token &MacroNameTok,
                                        const MacroDirective *MD) {}

// Any macro that is undefined removes all adjacent macros from consideration as
// an enum and starts a new enum scan.
void MacroToEnumCallbacks::MacroUndefined(const Token &MacroNameTok,
                                          const MacroDefinition &MD,
                                          const MacroDirective *Undef) {}

void MacroToEnumCallbacks::Endif(SourceLocation Loc, SourceLocation IfLoc) {}

namespace {

template <size_t N>
bool textEquals(const char (&Needle)[N], const char *HayStack) {}

template <size_t N> size_t len(const char (&)[N]) {}

} // namespace

void MacroToEnumCallbacks::PragmaDirective(SourceLocation Loc,
                                           PragmaIntroducerKind Introducer) {}

void MacroToEnumCallbacks::invalidateExpressionNames() {}

void MacroToEnumCallbacks::EndOfMainFile() {}

void MacroToEnumCallbacks::invalidateRange(SourceRange Range) {}

void MacroToEnumCallbacks::issueDiagnostics() {}

void MacroToEnumCallbacks::warnMacroEnum(const EnumMacro &Macro) const {}

void MacroToEnumCallbacks::fixEnumMacro(const MacroList &MacroList) const {}

void MacroToEnumCheck::registerPPCallbacks(const SourceManager &SM,
                                           Preprocessor *PP,
                                           Preprocessor *ModuleExpanderPP) {}

void MacroToEnumCheck::registerMatchers(ast_matchers::MatchFinder *Finder) {}

static bool isValid(SourceRange Range) {}

static bool empty(SourceRange Range) {}

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

} // namespace clang::tidy::modernize