Skip to content

Commit b7c2cb8

Browse files
authored
Merge pull request swiftlang#68379 from DougGregor/swift-syntax-multiple-files
2 parents 242c336 + 7287ad0 commit b7c2cb8

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

include/swift/Frontend/PrintingDiagnosticConsumer.h

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class PrintingDiagnosticConsumer : public DiagnosticConsumer {
5050
/// The queued diagnostics structure.
5151
void *queuedDiagnostics = nullptr;
5252
llvm::DenseMap<unsigned, QueuedBuffer> queuedBuffers;
53-
unsigned queuedDiagnosticsOutermostBufferID;
5453

5554
public:
5655
PrintingDiagnosticConsumer(llvm::raw_ostream &stream = llvm::errs());

lib/Frontend/PrintingDiagnosticConsumer.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -458,16 +458,10 @@ void PrintingDiagnosticConsumer::handleDiagnostic(SourceManager &SM,
458458
// Use the swift-syntax formatter.
459459
auto bufferStack = getSourceBufferStack(SM, Info.Loc);
460460
if (!bufferStack.empty()) {
461-
// If there are no enqueued diagnostics, they are from a different
462-
// outermost buffer, or we have hit a non-note diagnostic, flush any
463-
// enqueued diagnostics and start fresh.
464-
unsigned outermostBufferID = bufferStack.back();
465-
if (!queuedDiagnostics ||
466-
outermostBufferID != queuedDiagnosticsOutermostBufferID ||
467-
Info.Kind != DiagnosticKind::Note) {
461+
// If there are no enqueued diagnostics, or we have hit a non-note
462+
// diagnostic, flush any enqueued diagnostics and start fresh.
463+
if (!queuedDiagnostics || Info.Kind != DiagnosticKind::Note) {
468464
flush(/*includeTrailingBreak*/ true);
469-
470-
queuedDiagnosticsOutermostBufferID = outermostBufferID;
471465
queuedDiagnostics = swift_ASTGen_createQueuedDiagnostics();
472466
}
473467

0 commit comments

Comments
 (0)