15#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_H
16#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_ANDROID_CLOEXEC_H
18#include "../ClangTidyCheck.h"
34 ast_matchers::internal::Matcher<FunctionDecl> Function);
51 void insertMacroFlag(
const ast_matchers::MatchFinder::MatchResult &Result,
52 StringRef MacroFlag,
int ArgPos);
67 void replaceFunc(
const ast_matchers::MatchFinder::MatchResult &Result,
68 StringRef WarningMsg, StringRef FixMsg);
85 const char Mode,
const int ArgPos);
88 StringRef
getSpellingArg(
const ast_matchers::MatchFinder::MatchResult &Result,
llvm::SmallString< 256U > Name
Base class for all clang-tidy checks.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
The base class for all close-on-exec checks in Android module.
CloexecCheck(StringRef Name, ClangTidyContext *Context)
void replaceFunc(const ast_matchers::MatchFinder::MatchResult &Result, StringRef WarningMsg, StringRef FixMsg)
Type2 is to replace the API to another function that has required the ability.
void registerMatchersImpl(ast_matchers::MatchFinder *Finder, ast_matchers::internal::Matcher< FunctionDecl > Function)
void insertMacroFlag(const ast_matchers::MatchFinder::MatchResult &Result, StringRef MacroFlag, int ArgPos)
Currently, we have three types of fixes.
StringRef getSpellingArg(const ast_matchers::MatchFinder::MatchResult &Result, int N) const
Helper function to get the spelling of a particular argument.
void insertStringFlag(const ast_matchers::MatchFinder::MatchResult &Result, const char Mode, const int ArgPos)
Type3 is also to add a flag to the corresponding argument, but this time, the flag is some string and...
static const char * FuncDeclBindingStr
Binding name of the FuncDecl of a function call.
static const char * FuncBindingStr
Binding name of the function call expression.