[llvm] [llvm-cov] Use JSON streaming instead of in-memory DOM (PR #192457)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 16 07:23:29 PDT 2026


================
@@ -372,27 +446,28 @@ void CoverageExporterJson::renderRoot(ArrayRef<std::string> SourceFiles) {
   FileCoverageSummary Totals = FileCoverageSummary("Totals");
   auto FileReports = CoverageReport::prepareFileReports(Coverage, Totals,
                                                         SourceFiles, Options);
-  auto Files = renderFiles(Coverage, SourceFiles, FileReports, Options);
-  // Sort files in order of their names.
-  llvm::sort(Files, [](const json::Value &A, const json::Value &B) {
-    const json::Object *ObjA = A.getAsObject();
-    const json::Object *ObjB = B.getAsObject();
-    assert(ObjA != nullptr && "Value A was not an Object");
-    assert(ObjB != nullptr && "Value B was not an Object");
----------------
NoLuckNoWin wrote:

I might be missing something but this check seems to never trigger.
Sorting moved to renderFiles, check removed.

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


More information about the llvm-commits mailing list