10 #include "clang/AST/ASTContext.h"
11 #include "clang/ASTMatchers/ASTMatchFinder.h"
19 void CloexecDupCheck::registerMatchers(MatchFinder *Finder) {
20 registerMatchersImpl(Finder,
21 functionDecl(returns(isInteger()), hasName(
"dup"),
22 hasParameter(0, hasType(isInteger()))));
26 std::string ReplacementText =
27 (Twine(
"fcntl(") + getSpellingArg(Result, 0) +
", F_DUPFD_CLOEXEC)")
31 "prefer fcntl() to dup() because fcntl() allows F_DUPFD_CLOEXEC",