10 #include "clang/AST/ASTContext.h" 11 #include "clang/AST/Type.h" 12 #include "clang/ASTMatchers/ASTMatchFinder.h" 13 #include "clang/Lex/Lexer.h" 21 void CloexecFopenCheck::registerMatchers(MatchFinder *Finder) {
22 auto CharPointerType = hasType(pointerType(pointee(isAnyCharacter())));
23 registerMatchersImpl(Finder,
24 functionDecl(isExternC(), returns(asString(
"FILE *")),
26 hasParameter(0, CharPointerType),
27 hasParameter(1, CharPointerType)));
30 void CloexecFopenCheck::check(
const MatchFinder::MatchResult &Result) {
31 insertStringFlag(Result,
'e', 1);