#include "DanglingHandleCheck.h"
#include "../utils/Matchers.h"
#include "../utils/OptionsUtils.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
usingnamespaceclang::ast_matchers;
usingnamespaceclang::tidy::matchers;
namespace clang::tidy::bugprone {
namespace {
ast_matchers::internal::BindableMatcher<Stmt>
handleFrom(const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle,
const ast_matchers::internal::Matcher<Expr> &Arg) { … }
ast_matchers::internal::Matcher<Stmt> handleFromTemporaryValue(
const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) { … }
ast_matchers::internal::Matcher<RecordDecl> isASequence() { … }
ast_matchers::internal::Matcher<RecordDecl> isASet() { … }
ast_matchers::internal::Matcher<RecordDecl> isAMap() { … }
ast_matchers::internal::BindableMatcher<Stmt> makeContainerMatcher(
const ast_matchers::internal::Matcher<RecordDecl> &IsAHandle) { … }
}
DanglingHandleCheck::DanglingHandleCheck(StringRef Name,
ClangTidyContext *Context)
: … { … }
void DanglingHandleCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) { … }
void DanglingHandleCheck::registerMatchersForVariables(MatchFinder *Finder) { … }
void DanglingHandleCheck::registerMatchersForReturn(MatchFinder *Finder) { … }
void DanglingHandleCheck::registerMatchers(MatchFinder *Finder) { … }
void DanglingHandleCheck::check(const MatchFinder::MatchResult &Result) { … }
}