[llvm] llvm-dwarfdump --verify aggregated output to JSON file (PR #81762)

Kevin Frei via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 15 09:54:42 PST 2024


================
@@ -2026,12 +2028,35 @@ void OutputCategoryAggregator::EnumerateResults(
 }
 
 void DWARFVerifier::summarize() {
-  if (ErrorCategory.GetNumCategories() && DumpOpts.ShowAggregateErrors) {
+  if (!ErrorCategory.GetNumCategories())
+    return;
+  if (DumpOpts.ShowAggregateErrors) {
     error() << "Aggregated error counts:\n";
     ErrorCategory.EnumerateResults([&](StringRef s, unsigned count) {
       error() << s << " occurred " << count << " time(s).\n";
     });
   }
+  if (!DumpOpts.JsonSummaryFile.empty()) {
+    std::error_code EC;
+    raw_fd_ostream JsonStream(DumpOpts.JsonSummaryFile, EC, sys::fs::OF_Text);
+    if (EC) {
+      error() << "error opening aggregate error json file '"
----------------
kevinfrei wrote:

(That's how it's phrased elsewhere)

https://github.com/llvm/llvm-project/pull/81762


More information about the llvm-commits mailing list