#include "SignalHandlerCheck.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "llvm/ADT/DepthFirstIterator.h"
#include "llvm/ADT/STLExtras.h"
constexpr llvm::StringLiteral MinimalConformingFunctions[] = …;
constexpr llvm::StringLiteral POSIXConformingFunctions[] = …;
usingnamespaceclang::ast_matchers;
namespace clang::tidy {
template <>
struct OptionEnumMapping<
bugprone::SignalHandlerCheck::AsyncSafeFunctionSetKind> { … };
namespace bugprone {
namespace {
bool isStandardFunction(const FunctionDecl *FD) { … }
bool isCXXOnlyStmt(const Stmt *S) { … }
Expr *findCallExpr(const CallGraphNode *Caller, const CallGraphNode *Callee) { … }
SourceRange getSourceRangeOfStmt(const Stmt *S, ASTContext &Ctx) { … }
}
AST_MATCHER(FunctionDecl, isStandardFunction) { … }
SignalHandlerCheck::SignalHandlerCheck(StringRef Name,
ClangTidyContext *Context)
: … { … }
void SignalHandlerCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
bool SignalHandlerCheck::isLanguageVersionSupported(
const LangOptions &LangOpts) const { … }
void SignalHandlerCheck::registerMatchers(MatchFinder *Finder) { … }
void SignalHandlerCheck::check(const MatchFinder::MatchResult &Result) { … }
bool SignalHandlerCheck::checkFunction(
const FunctionDecl *FD, const Expr *CallOrRef,
std::function<void(bool)> ChainReporter) { … }
bool SignalHandlerCheck::checkFunctionCPP14(
const FunctionDecl *FD, const Expr *CallOrRef,
std::function<void(bool)> ChainReporter) { … }
bool SignalHandlerCheck::isStandardFunctionAsyncSafe(
const FunctionDecl *FD) const { … }
void SignalHandlerCheck::reportHandlerChain(
const llvm::df_iterator<clang::CallGraphNode *> &Itr,
const DeclRefExpr *HandlerRef, bool SkipPathEnd) { … }
}
}