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