18
18
#ifndef SWIFT_FRONTEND_DIAGNOSTIC_VERIFIER_H
19
19
#define SWIFT_FRONTEND_DIAGNOSTIC_VERIFIER_H
20
20
21
+ #include " llvm/ADT/DenseMap.h"
21
22
#include " llvm/ADT/SmallString.h"
22
23
#include " swift/AST/DiagnosticConsumer.h"
23
24
#include " swift/Basic/LLVM.h"
24
25
26
+ namespace {
27
+ struct ExpectedDiagnosticInfo ;
28
+ }
29
+
25
30
namespace swift {
26
31
class DependencyTracker ;
27
32
class FileUnit ;
@@ -129,10 +134,25 @@ class DiagnosticVerifier : public DiagnosticConsumer {
129
134
bool
130
135
verifyUnknown (std::vector<CapturedDiagnosticInfo> &CapturedDiagnostics) const ;
131
136
137
+ std::vector<llvm::SMDiagnostic> Errors;
138
+
132
139
// / verifyFile - After the file has been processed, check to see if we
133
140
// / got all of the expected diagnostics and check to see if there were any
134
141
// / unexpected ones.
135
142
Result verifyFile (unsigned BufferID);
143
+ unsigned parseExpectedDiagInfo (unsigned BufferID, StringRef MatchStart,
144
+ unsigned &PrevExpectedContinuationLine,
145
+ ExpectedDiagnosticInfo &Expected);
146
+ void
147
+ verifyDiagnostics (std::vector<ExpectedDiagnosticInfo> &ExpectedDiagnostics,
148
+ unsigned BufferID);
149
+ void verifyRemaining (std::vector<ExpectedDiagnosticInfo> &ExpectedDiagnostics,
150
+ const char *FileStart);
151
+ void addError (const char *Loc, const Twine &message,
152
+ ArrayRef<llvm::SMFixIt> FixIts = {});
153
+
154
+ std::optional<LineColumnRange>
155
+ parseExpectedFixItRange (StringRef &Str, unsigned DiagnosticLineNo);
136
156
137
157
bool checkForFixIt (const std::vector<ExpectedFixIt> &ExpectedAlts,
138
158
const CapturedDiagnosticInfo &D, unsigned BufferID) const ;
@@ -141,6 +161,8 @@ class DiagnosticVerifier : public DiagnosticConsumer {
141
161
std::string renderFixits (ArrayRef<CapturedFixItInfo> ActualFixIts,
142
162
unsigned BufferID, unsigned DiagnosticLineNo) const ;
143
163
164
+ llvm::DenseMap<SourceLoc, unsigned > Expansions;
165
+
144
166
void printRemainingDiagnostics () const ;
145
167
};
146
168
0 commit comments