llvm/clang-tools-extra/clang-tidy/bugprone/UnsafeFunctionsCheck.cpp

//===--- UnsafeFunctionsCheck.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 "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) {}

/// \returns The rationale for replacing the function \p FunctionName with the
/// safer alternative.
static StringRef getRationaleFor(StringRef FunctionName) {}

/// Calculates whether Annex K is available for the current translation unit
/// based on the macro definitions and the language options.
///
/// The result is cached and saved in \p CacheVar.
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 * /*ModuleExpanderPP*/) {}

void UnsafeFunctionsCheck::onEndOfTranslationUnit() {}

} // namespace clang::tidy::bugprone