@@ -92,31 +92,29 @@ class FixItHint {
92
92
// / modification is known.
93
93
FixItHint () = default ;
94
94
95
- bool isNull () const {
96
- return !RemoveRange.isValid ();
97
- }
95
+ bool isNull () const { return !RemoveRange.isValid (); }
98
96
99
97
// / Create a code modification hint that inserts the given
100
98
// / code string at a specific location.
101
- static FixItHint CreateInsertion (SourceLocation InsertionLoc,
102
- StringRef Code,
99
+ static FixItHint CreateInsertion (SourceLocation InsertionLoc, StringRef Code,
103
100
bool BeforePreviousInsertions = false ) {
104
101
FixItHint Hint;
105
102
Hint.RemoveRange =
106
- CharSourceRange::getCharRange (InsertionLoc, InsertionLoc);
103
+ CharSourceRange::getCharRange (InsertionLoc, InsertionLoc);
107
104
Hint.CodeToInsert = std::string (Code);
108
105
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
109
106
return Hint;
110
107
}
111
108
112
109
// / Create a code modification hint that inserts the given
113
110
// / 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 ) {
117
115
FixItHint Hint;
118
116
Hint.RemoveRange =
119
- CharSourceRange::getCharRange (InsertionLoc, InsertionLoc);
117
+ CharSourceRange::getCharRange (InsertionLoc, InsertionLoc);
120
118
Hint.InsertFromRange = FromRange;
121
119
Hint.BeforePreviousInsertions = BeforePreviousInsertions;
122
120
return Hint;
@@ -143,8 +141,7 @@ class FixItHint {
143
141
return Hint;
144
142
}
145
143
146
- static FixItHint CreateReplacement (SourceRange RemoveRange,
147
- StringRef Code) {
144
+ static FixItHint CreateReplacement (SourceRange RemoveRange, StringRef Code) {
148
145
return CreateReplacement (CharSourceRange::getTokenRange (RemoveRange), Code);
149
146
}
150
147
};
@@ -553,13 +550,11 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
553
550
// / avoid redundancy across arguments.
554
551
// /
555
552
// / 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);
563
558
564
559
void *ArgToStringCookie = nullptr ;
565
560
ArgToStringFnTy ArgToStringFn;
@@ -656,9 +651,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
656
651
657
652
// / Retrieve the maximum number of template instantiation
658
653
// / notes to emit along with a given diagnostic.
659
- unsigned getTemplateBacktraceLimit () const {
660
- return TemplateBacktraceLimit;
661
- }
654
+ unsigned getTemplateBacktraceLimit () const { return TemplateBacktraceLimit; }
662
655
663
656
// / Specify the maximum number of constexpr evaluation
664
657
// / notes to emit along with a given diagnostic.
@@ -744,9 +737,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
744
737
// / fails.
745
738
// /
746
739
// / By default, we show all candidates.
747
- void setShowOverloads (OverloadsShown Val) {
748
- ShowOverloads = Val;
749
- }
740
+ void setShowOverloads (OverloadsShown Val) { ShowOverloads = Val; }
750
741
OverloadsShown getShowOverloads () const { return ShowOverloads; }
751
742
752
743
// / When a call or operator fails, print out up to this many candidate
@@ -885,9 +876,7 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
885
876
unsigned getNumErrors () const { return NumErrors; }
886
877
unsigned getNumWarnings () const { return NumWarnings; }
887
878
888
- void setNumWarnings (unsigned NumWarnings) {
889
- this ->NumWarnings = NumWarnings;
890
- }
879
+ void setNumWarnings (unsigned NumWarnings) { this ->NumWarnings = NumWarnings; }
891
880
892
881
// / Return an ID for a diagnostic with the specified format string and
893
882
// / level.
@@ -907,9 +896,8 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
907
896
908
897
// / Converts a diagnostic argument (as an intptr_t) into the string
909
898
// / 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,
913
901
SmallVectorImpl<char > &Output,
914
902
ArrayRef<intptr_t > QualTypeVals) const {
915
903
ArgToStringFn (Kind, Val, Modifier, Argument, PrevArgs, Output,
@@ -1074,8 +1062,9 @@ class DiagnosticErrorTrap {
1074
1062
unsigned NumUnrecoverableErrors;
1075
1063
1076
1064
public:
1077
- explicit DiagnosticErrorTrap (DiagnosticsEngine &Diag)
1078
- : Diag(Diag) { reset (); }
1065
+ explicit DiagnosticErrorTrap (DiagnosticsEngine &Diag) : Diag(Diag) {
1066
+ reset ();
1067
+ }
1079
1068
1080
1069
// / Determine whether any errors have occurred since this
1081
1070
// / object instance was created.
@@ -1278,7 +1267,8 @@ class DiagnosticBuilder : public StreamingDiagnostic {
1278
1267
bool Emit () {
1279
1268
// If this diagnostic is inactive, then its soul was stolen by the copy ctor
1280
1269
// (or by a subclass, as in SemaDiagnosticBuilder).
1281
- if (!isActive ()) return false ;
1270
+ if (!isActive ())
1271
+ return false ;
1282
1272
1283
1273
// Process the diagnostic.
1284
1274
bool Result = DiagObj->EmitDiagnostic (*this , IsForceEmit);
@@ -1553,7 +1543,9 @@ class Diagnostic {
1553
1543
unsigned getID () const { return DiagID; }
1554
1544
const SourceLocation &getLocation () const { return DiagLoc; }
1555
1545
bool hasSourceManager () const { return DiagObj->hasSourceManager (); }
1556
- SourceManager &getSourceManager () const { return DiagObj->getSourceManager ();}
1546
+ SourceManager &getSourceManager () const {
1547
+ return DiagObj->getSourceManager ();
1548
+ }
1557
1549
1558
1550
unsigned getNumArgs () const { return DiagStorage.NumDiagArgs ; }
1559
1551
@@ -1709,8 +1701,8 @@ llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, const StoredDiagnostic &);
1709
1701
// / formats and prints fully processed diagnostics.
1710
1702
class DiagnosticConsumer {
1711
1703
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
1714
1706
1715
1707
public:
1716
1708
DiagnosticConsumer () = default ;
0 commit comments