#include "UnsafeFunctionsCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include <cassert>
usingnamespaceclang::ast_matchers;
usingnamespacellvm;
namespace clang::tidy::bugprone {
static constexpr llvm::StringLiteral OptionNameReportMoreUnsafeFunctions = …;
static constexpr llvm::StringLiteral FunctionNamesWithAnnexKReplacementId = …;
static constexpr llvm::StringLiteral FunctionNamesId = …;
static constexpr llvm::StringLiteral AdditionalFunctionNamesId = …;
static constexpr llvm::StringLiteral DeclRefId = …;
static std::optional<std::string>
getAnnexKReplacementFor(StringRef FunctionName) { … }
static StringRef getReplacementFor(StringRef FunctionName,
bool IsAnnexKAvailable) { … }
static StringRef getReplacementForAdditional(StringRef FunctionName,
bool IsAnnexKAvailable) { … }
static StringRef getRationaleFor(StringRef FunctionName) { … }
static bool isAnnexKAvailable(std::optional<bool> &CacheVar, Preprocessor *PP,
const LangOptions &LO) { … }
UnsafeFunctionsCheck::UnsafeFunctionsCheck(StringRef Name,
ClangTidyContext *Context)
: … { … }
void UnsafeFunctionsCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void UnsafeFunctionsCheck::registerMatchers(MatchFinder *Finder) { … }
void UnsafeFunctionsCheck::check(const MatchFinder::MatchResult &Result) { … }
void UnsafeFunctionsCheck::registerPPCallbacks(
const SourceManager &SM, Preprocessor *PP,
Preprocessor * ) { … }
void UnsafeFunctionsCheck::onEndOfTranslationUnit() { … }
}