11 #include "../utils/ASTUtils.h" 12 #include "clang/AST/ASTContext.h" 13 #include "clang/ASTMatchers/ASTMatchFinder.h" 21 void CloexecAccept4Check::registerMatchers(MatchFinder *Finder) {
22 auto SockAddrPointerType =
23 hasType(pointsTo(recordDecl(isStruct(), hasName(
"sockaddr"))));
24 auto SockLenPointerType = hasType(pointsTo(namedDecl(hasName(
"socklen_t"))));
26 registerMatchersImpl(Finder,
27 functionDecl(returns(isInteger()), hasName(
"accept4"),
28 hasParameter(0, hasType(isInteger())),
29 hasParameter(1, SockAddrPointerType),
30 hasParameter(2, SockLenPointerType),
31 hasParameter(3, hasType(isInteger()))));
34 void CloexecAccept4Check::check(
const MatchFinder::MatchResult &
Result) {
35 insertMacroFlag(Result,
"SOCK_CLOEXEC", 3);
llvm::Optional< llvm::Expected< tooling::AtomicChanges > > Result
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//