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