Skip to content

Revert "[llvm-cov] Export decision coverage to output json" #144783

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025
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
12 changes: 0 additions & 12 deletions llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "llvm/Support/Endian.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
Expand Down Expand Up @@ -495,17 +494,6 @@ struct MCDCRecord {
return TV[TestVectorIndex].first[PosToID[Condition]];
}

/// Return the number of True and False decisions for all executed test
/// vectors.
std::pair<unsigned, unsigned> getDecisions() const {
const unsigned TrueDecisions =
std::count_if(TV.begin(), TV.end(), [](const auto &TestVec) {
return TestVec.second == CondState::MCDC_True;
});

return {TrueDecisions, TV.size() - TrueDecisions};
}

/// Return the Result evaluation for an executed test vector.
/// See MCDCRecordProcessor::RecordTestVector().
CondState getTVResult(unsigned TestVectorIndex) {
Expand Down
6 changes: 2 additions & 4 deletions llvm/tools/llvm-cov/CoverageExporterJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#include <utility>

/// The semantic version combined as a string.
#define LLVM_COVERAGE_EXPORT_JSON_STR "3.0.0"
#define LLVM_COVERAGE_EXPORT_JSON_STR "2.0.1"

/// Unique type identifier for JSON coverage export.
#define LLVM_COVERAGE_EXPORT_JSON_TYPE_STR "llvm.coverage.json.export"
Expand Down Expand Up @@ -110,10 +110,8 @@ json::Array gatherConditions(const coverage::MCDCRecord &Record) {

json::Array renderMCDCRecord(const coverage::MCDCRecord &Record) {
const llvm::coverage::CounterMappingRegion &CMR = Record.getDecisionRegion();
const auto [TrueDecisions, FalseDecisions] = Record.getDecisions();
return json::Array({CMR.LineStart, CMR.ColumnStart, CMR.LineEnd,
CMR.ColumnEnd, TrueDecisions, FalseDecisions,
CMR.ExpandedFileID, int64_t(CMR.Kind),
CMR.ColumnEnd, CMR.ExpandedFileID, int64_t(CMR.Kind),
gatherConditions(Record)});
}

Expand Down
Loading