
These are identified by misc-include-cleaner. I've filtered out those that break builds. Also, I'm staying away from llvm-config.h, config.h, and Compiler.h, which likely cause platform- or compiler-specific build failures.
27 lines
955 B
C++
27 lines
955 B
C++
//===--- CloexecInotifyInit1Check.cpp - clang-tidy-------------------------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "CloexecInotifyInit1Check.h"
|
|
#include "clang/ASTMatchers/ASTMatchFinder.h"
|
|
|
|
using namespace clang::ast_matchers;
|
|
|
|
namespace clang::tidy::android {
|
|
|
|
void CloexecInotifyInit1Check::registerMatchers(MatchFinder *Finder) {
|
|
registerMatchersImpl(
|
|
Finder, functionDecl(returns(isInteger()), hasName("inotify_init1"),
|
|
hasParameter(0, hasType(isInteger()))));
|
|
}
|
|
|
|
void CloexecInotifyInit1Check::check(const MatchFinder::MatchResult &Result) {
|
|
insertMacroFlag(Result, /*MacroFlag=*/"IN_CLOEXEC", /*ArgPos=*/0);
|
|
}
|
|
|
|
} // namespace clang::tidy::android
|