14#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_BRACESAROUNDSTATEMENT_H
15#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_BRACESAROUNDSTATEMENT_H
17#include "clang/AST/Stmt.h"
18#include "clang/Basic/Diagnostic.h"
19#include "clang/Basic/SourceLocation.h"
20#include "clang/Basic/SourceManager.h"
42 SourceLocation ClosingBracePos, StringRef ClosingBrace)
43 :
DiagnosticPos(OpeningBracePos), OpeningBracePos(OpeningBracePos),
44 ClosingBracePos(ClosingBracePos), ClosingBrace(ClosingBrace) {
49 operator bool()
const;
65 SourceLocation OpeningBracePos;
66 SourceLocation ClosingBracePos;
67 StringRef ClosingBrace;
75 const SourceManager &SM, SourceLocation StartLoc,
76 SourceLocation EndLocHint = SourceLocation());
BraceInsertionHints getBraceInsertionsHints(const Stmt *const S, const LangOptions &LangOpts, const SourceManager &SM, SourceLocation StartLoc, SourceLocation EndLocHint)
Create fix-it hints for braces that wrap the given statement when applied.
BraceInsertionHints()=default
Constructor for a no-hint.
SourceLocation DiagnosticPos
The position of a potential diagnostic.
FixItHint closingBraceFixIt() const
Fix-it to insert a closing brace.
BraceInsertionHints(SourceLocation DiagnosticPos)
Constructor for a valid hint that cannot insert braces automatically.
bool offersFixIts() const
Indicates whether the hint provides fix-its to insert braces.
unsigned resultingCompoundLineExtent(const SourceManager &SourceMgr) const
The number of lines between the inserted opening brace and its closing counterpart.
FixItHint openingBraceFixIt() const
Fix-it to insert an opening brace.
BraceInsertionHints(SourceLocation OpeningBracePos, SourceLocation ClosingBracePos, StringRef ClosingBrace)
Constructor for a hint offering fix-its for brace insertion.