#include "UseInternalLinkageCheck.h"
#include "../utils/FileExtensionsUtils.h"
#include "clang/AST/Decl.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/ASTMatchers/ASTMatchersMacros.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/Specifiers.h"
#include "llvm/ADT/STLExtras.h"
usingnamespaceclang::ast_matchers;
namespace clang::tidy {
template <>
struct OptionEnumMapping<misc::UseInternalLinkageCheck::FixModeKind> { … };
}
namespace clang::tidy::misc {
namespace {
AST_MATCHER(Decl, isFirstDecl) { … }
static bool isInMainFile(SourceLocation L, SourceManager &SM,
const FileExtensionsSet &HeaderFileExtensions) { … }
AST_MATCHER_P(Decl, isAllRedeclsInMainFile, FileExtensionsSet,
HeaderFileExtensions) { … }
AST_POLYMORPHIC_MATCHER(isExternStorageClass,
AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl,
VarDecl)) { … }
}
UseInternalLinkageCheck::UseInternalLinkageCheck(StringRef Name,
ClangTidyContext *Context)
: … { … }
void UseInternalLinkageCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void UseInternalLinkageCheck::registerMatchers(MatchFinder *Finder) { … }
static constexpr StringRef Message = …;
void UseInternalLinkageCheck::check(const MatchFinder::MatchResult &Result) { … }
}