================
@@ -1044,6 +1146,141 @@ static unsigned CheckResults(DiagnosticsEngine &Diags, 
SourceManager &SourceMgr,
   return NumProblems;
 }
 
+// Checks that directives are lexically in the same order as the emitted
+// diagnostics. Assumes that:
+//   - every directive matches exactly one diagnostic,
+//   - there are no wildcards, and
+//   - CheckResults returned 0 problems, i.e. every diagnostic
+//     was matched by every directive without considering the order.
+static unsigned CheckResultsAreInOrder(DiagnosticsEngine &Diags,
+                                       SourceManager &SourceMgr,
+                                       const TextDiagnosticBuffer &Buffer,
+                                       const ExpectedData &ED) {
----------------
AaronBallman wrote:

I think I'm a bit confused -- we do produce notes in isolation, that's kind of 
the problem (we just call `Diag()` and the diagnostics engine has to be smart 
enough to associate the note with another diagnostic, we don't do that hookup 
explicitly currently).

So I think I'm with @Endilll on this being a reasonable suggestion but 
something outside the scope of this PR (there are other questions afoot about 
associating notes with diagnostics explicitly which are related I think). But I 
could be missing something, too.

https://github.com/llvm/llvm-project/pull/179835
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to