9#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_BRACESAROUNDSTATEMENTSCHECK_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_BRACESAROUNDSTATEMENTSCHECK_H
12#include "../ClangTidyCheck.h"
46 void check(
const ast_matchers::MatchFinder::MatchResult &Result)
override;
50 bool checkStmt(
const ast_matchers::MatchFinder::MatchResult &Result,
51 const Stmt *S, SourceLocation StartLoc,
52 SourceLocation EndLocHint = SourceLocation());
53 template <
typename IfOrWhileStmt>
54 SourceLocation findRParenLoc(
const IfOrWhileStmt *S,
const SourceManager &SM,
55 const LangOptions &LangOpts);
56 std::optional<TraversalKind> getCheckTraversalKind()
const override {
57 return TK_IgnoreUnlessSpelledInSource;
60 std::set<const Stmt *> ForceBracesStmts;
61 const unsigned ShortStatementLines;
llvm::SmallString< 256U > Name
Base class for all clang-tidy checks.
Every ClangTidyCheck reports errors through a DiagnosticsEngine provided by this context.
Checks that bodies of if statements and loops (for, range-for, do-while, and while) are inside braces...
void onEndOfTranslationUnit() override
void check(const ast_matchers::MatchFinder::MatchResult &Result) override
ClangTidyChecks that register ASTMatchers should do the actual work in here.
void storeOptions(ClangTidyOptions::OptionMap &Opts) override
Should store all options supported by this check with their current values or default values for opti...
void registerMatchers(ast_matchers::MatchFinder *Finder) override
Override this to register AST matchers with Finder.
llvm::StringMap< ClangTidyValue > OptionMap