Skip to content

Commit 88d2507

Browse files
authored
Revert "[llvm-cov] Export decision coverage to output json" (#144783)
Reverts #144335 Need to resolve test failures
1 parent 156a64c commit 88d2507

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

llvm/include/llvm/ProfileData/Coverage/CoverageMapping.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "llvm/Support/Endian.h"
3232
#include "llvm/Support/Error.h"
3333
#include "llvm/Support/raw_ostream.h"
34-
#include <algorithm>
3534
#include <cassert>
3635
#include <cstdint>
3736
#include <iterator>
@@ -495,17 +494,6 @@ struct MCDCRecord {
495494
return TV[TestVectorIndex].first[PosToID[Condition]];
496495
}
497496

498-
/// Return the number of True and False decisions for all executed test
499-
/// vectors.
500-
std::pair<unsigned, unsigned> getDecisions() const {
501-
const unsigned TrueDecisions =
502-
std::count_if(TV.begin(), TV.end(), [](const auto &TestVec) {
503-
return TestVec.second == CondState::MCDC_True;
504-
});
505-
506-
return {TrueDecisions, TV.size() - TrueDecisions};
507-
}
508-
509497
/// Return the Result evaluation for an executed test vector.
510498
/// See MCDCRecordProcessor::RecordTestVector().
511499
CondState getTVResult(unsigned TestVectorIndex) {

llvm/tools/llvm-cov/CoverageExporterJson.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#include <utility>
6363

6464
/// The semantic version combined as a string.
65-
#define LLVM_COVERAGE_EXPORT_JSON_STR "3.0.0"
65+
#define LLVM_COVERAGE_EXPORT_JSON_STR "2.0.1"
6666

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

111111
json::Array renderMCDCRecord(const coverage::MCDCRecord &Record) {
112112
const llvm::coverage::CounterMappingRegion &CMR = Record.getDecisionRegion();
113-
const auto [TrueDecisions, FalseDecisions] = Record.getDecisions();
114113
return json::Array({CMR.LineStart, CMR.ColumnStart, CMR.LineEnd,
115-
CMR.ColumnEnd, TrueDecisions, FalseDecisions,
116-
CMR.ExpandedFileID, int64_t(CMR.Kind),
114+
CMR.ColumnEnd, CMR.ExpandedFileID, int64_t(CMR.Kind),
117115
gatherConditions(Record)});
118116
}
119117

0 commit comments

Comments
 (0)