Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion include/swift/Frontend/PrintingDiagnosticConsumer.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class PrintingDiagnosticConsumer : public DiagnosticConsumer {
/// The queued diagnostics structure.
void *queuedDiagnostics = nullptr;
llvm::DenseMap<unsigned, QueuedBuffer> queuedBuffers;
unsigned queuedDiagnosticsOutermostBufferID;

public:
PrintingDiagnosticConsumer(llvm::raw_ostream &stream = llvm::errs());
Expand Down
12 changes: 3 additions & 9 deletions lib/Frontend/PrintingDiagnosticConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,16 +458,10 @@ void PrintingDiagnosticConsumer::handleDiagnostic(SourceManager &SM,
// Use the swift-syntax formatter.
auto bufferStack = getSourceBufferStack(SM, Info.Loc);
if (!bufferStack.empty()) {
// If there are no enqueued diagnostics, they are from a different
// outermost buffer, or we have hit a non-note diagnostic, flush any
// enqueued diagnostics and start fresh.
unsigned outermostBufferID = bufferStack.back();
if (!queuedDiagnostics ||
outermostBufferID != queuedDiagnosticsOutermostBufferID ||
Info.Kind != DiagnosticKind::Note) {
// If there are no enqueued diagnostics, or we have hit a non-note
// diagnostic, flush any enqueued diagnostics and start fresh.
if (!queuedDiagnostics || Info.Kind != DiagnosticKind::Note) {
flush(/*includeTrailingBreak*/ true);

queuedDiagnosticsOutermostBufferID = outermostBufferID;
queuedDiagnostics = swift_ASTGen_createQueuedDiagnostics();
}

Expand Down