Skip to content

Commit da56a52

Browse files
committed
[DiagnosticVerifier] Extract parseExpectedDiagInfo (NFCI)
This refactors the parsing of "expected-*" lines to a separate function, to enable recursive parsing in the next commit.
1 parent 70ec916 commit da56a52

File tree

2 files changed

+300
-268
lines changed

2 files changed

+300
-268
lines changed

include/swift/Frontend/DiagnosticVerifier.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@
2222
#include "swift/AST/DiagnosticConsumer.h"
2323
#include "swift/Basic/LLVM.h"
2424

25+
namespace {
26+
struct ExpectedDiagnosticInfo;
27+
}
28+
2529
namespace swift {
2630
class DependencyTracker;
2731
class FileUnit;
@@ -133,6 +137,10 @@ class DiagnosticVerifier : public DiagnosticConsumer {
133137
/// got all of the expected diagnostics and check to see if there were any
134138
/// unexpected ones.
135139
Result verifyFile(unsigned BufferID);
140+
unsigned parseExpectedDiagInfo(unsigned BufferID, StringRef MatchStart,
141+
std::vector<llvm::SMDiagnostic> &Errors,
142+
unsigned &PrevExpectedContinuationLine,
143+
ExpectedDiagnosticInfo &Expected) const;
136144

137145
bool checkForFixIt(const std::vector<ExpectedFixIt> &ExpectedAlts,
138146
const CapturedDiagnosticInfo &D, unsigned BufferID) const;

0 commit comments

Comments
 (0)