Skip to content

Commit c6ad464

Browse files
authored
[NFC] Run code formatter on Diagnostic.h/cpp ProfileList.cpp SpecialCaseList.cpp
Reviewers: vitalybuka Reviewed By: vitalybuka Pull Request: #140316
1 parent 2e2a792 commit c6ad464

File tree

4 files changed

+113
-112
lines changed

4 files changed

+113
-112
lines changed

clang/include/clang/Basic/Diagnostic.h

Lines changed: 29 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -92,31 +92,29 @@ class FixItHint {
9292
/// modification is known.
9393
FixItHint() = default;
9494

95-
bool isNull() const {
96-
return !RemoveRange.isValid();
97-
}
95+
bool isNull() const { return !RemoveRange.isValid(); }
9896

9997
/// Create a code modification hint that inserts the given
10098
/// code string at a specific location.
101-
static FixItHint CreateInsertion(SourceLocation InsertionLoc,
102-
StringRef Code,
99+
static FixItHint CreateInsertion(SourceLocation InsertionLoc, StringRef Code,
103100
bool BeforePreviousInsertions = false) {
104101
FixItHint Hint;
105102
Hint.RemoveRange =
106-
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
103+
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
107104
Hint.CodeToInsert = std::string(Code);
108105
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
109106
return Hint;
110107
}
111108

112109
/// Create a code modification hint that inserts the given
113110
/// code from \p FromRange at a specific location.
114-
static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc,
115-
CharSourceRange FromRange,
116-
bool BeforePreviousInsertions = false) {
111+
static FixItHint
112+
CreateInsertionFromRange(SourceLocation InsertionLoc,
113+
CharSourceRange FromRange,
114+
bool BeforePreviousInsertions = false) {
117115
FixItHint Hint;
118116
Hint.RemoveRange =
119-
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
117+
CharSourceRange::getCharRange(InsertionLoc, InsertionLoc);
120118
Hint.InsertFromRange = FromRange;
121119
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
122120
return Hint;
@@ -143,8 +141,7 @@ class FixItHint {
143141
return Hint;
144142
}
145143

146-
static FixItHint CreateReplacement(SourceRange RemoveRange,
147-
StringRef Code) {
144+
static FixItHint CreateReplacement(SourceRange RemoveRange, StringRef Code) {
148145
return CreateReplacement(CharSourceRange::getTokenRange(RemoveRange), Code);
149146
}
150147
};
@@ -553,13 +550,11 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
553550
/// avoid redundancy across arguments.
554551
///
555552
/// This is a hack to avoid a layering violation between libbasic and libsema.
556-
using ArgToStringFnTy = void (*)(
557-
ArgumentKind Kind, intptr_t Val,
558-
StringRef Modifier, StringRef Argument,
559-
ArrayRef<ArgumentValue> PrevArgs,
560-
SmallVectorImpl<char> &Output,
561-
void *Cookie,
562-
ArrayRef<intptr_t> QualTypeVals);
553+
using ArgToStringFnTy = void (*)(ArgumentKind Kind, intptr_t Val,
554+
StringRef Modifier, StringRef Argument,
555+
ArrayRef<ArgumentValue> PrevArgs,
556+
SmallVectorImpl<char> &Output, void *Cookie,
557+
ArrayRef<intptr_t> QualTypeVals);
563558

564559
void *ArgToStringCookie = nullptr;
565560
ArgToStringFnTy ArgToStringFn;
@@ -656,9 +651,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
656651

657652
/// Retrieve the maximum number of template instantiation
658653
/// notes to emit along with a given diagnostic.
659-
unsigned getTemplateBacktraceLimit() const {
660-
return TemplateBacktraceLimit;
661-
}
654+
unsigned getTemplateBacktraceLimit() const { return TemplateBacktraceLimit; }
662655

663656
/// Specify the maximum number of constexpr evaluation
664657
/// notes to emit along with a given diagnostic.
@@ -744,9 +737,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
744737
/// fails.
745738
///
746739
/// By default, we show all candidates.
747-
void setShowOverloads(OverloadsShown Val) {
748-
ShowOverloads = Val;
749-
}
740+
void setShowOverloads(OverloadsShown Val) { ShowOverloads = Val; }
750741
OverloadsShown getShowOverloads() const { return ShowOverloads; }
751742

752743
/// When a call or operator fails, print out up to this many candidate
@@ -885,9 +876,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
885876
unsigned getNumErrors() const { return NumErrors; }
886877
unsigned getNumWarnings() const { return NumWarnings; }
887878

888-
void setNumWarnings(unsigned NumWarnings) {
889-
this->NumWarnings = NumWarnings;
890-
}
879+
void setNumWarnings(unsigned NumWarnings) { this->NumWarnings = NumWarnings; }
891880

892881
/// Return an ID for a diagnostic with the specified format string and
893882
/// level.
@@ -907,9 +896,8 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
907896

908897
/// Converts a diagnostic argument (as an intptr_t) into the string
909898
/// that represents it.
910-
void ConvertArgToString(ArgumentKind Kind, intptr_t Val,
911-
StringRef Modifier, StringRef Argument,
912-
ArrayRef<ArgumentValue> PrevArgs,
899+
void ConvertArgToString(ArgumentKind Kind, intptr_t Val, StringRef Modifier,
900+
StringRef Argument, ArrayRef<ArgumentValue> PrevArgs,
913901
SmallVectorImpl<char> &Output,
914902
ArrayRef<intptr_t> QualTypeVals) const {
915903
ArgToStringFn(Kind, Val, Modifier, Argument, PrevArgs, Output,
@@ -1074,8 +1062,9 @@ class DiagnosticErrorTrap {
10741062
unsigned NumUnrecoverableErrors;
10751063

10761064
public:
1077-
explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag)
1078-
: Diag(Diag) { reset(); }
1065+
explicit DiagnosticErrorTrap(DiagnosticsEngine &Diag) : Diag(Diag) {
1066+
reset();
1067+
}
10791068

10801069
/// Determine whether any errors have occurred since this
10811070
/// object instance was created.
@@ -1278,7 +1267,8 @@ class DiagnosticBuilder : public StreamingDiagnostic {
12781267
bool Emit() {
12791268
// If this diagnostic is inactive, then its soul was stolen by the copy ctor
12801269
// (or by a subclass, as in SemaDiagnosticBuilder).
1281-
if (!isActive()) return false;
1270+
if (!isActive())
1271+
return false;
12821272

12831273
// Process the diagnostic.
12841274
bool Result = DiagObj->EmitDiagnostic(*this, IsForceEmit);
@@ -1553,7 +1543,9 @@ class Diagnostic {
15531543
unsigned getID() const { return DiagID; }
15541544
const SourceLocation &getLocation() const { return DiagLoc; }
15551545
bool hasSourceManager() const { return DiagObj->hasSourceManager(); }
1556-
SourceManager &getSourceManager() const { return DiagObj->getSourceManager();}
1546+
SourceManager &getSourceManager() const {
1547+
return DiagObj->getSourceManager();
1548+
}
15571549

15581550
unsigned getNumArgs() const { return DiagStorage.NumDiagArgs; }
15591551

@@ -1709,8 +1701,8 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const StoredDiagnostic &);
17091701
/// formats and prints fully processed diagnostics.
17101702
class DiagnosticConsumer {
17111703
protected:
1712-
unsigned NumWarnings = 0; ///< Number of warnings reported
1713-
unsigned NumErrors = 0; ///< Number of errors reported
1704+
unsigned NumWarnings = 0; ///< Number of warnings reported
1705+
unsigned NumErrors = 0; ///< Number of errors reported
17141706

17151707
public:
17161708
DiagnosticConsumer() = default;

0 commit comments

Comments
 (0)