Skip to content

Commit

Permalink
ci: remove one LLVM patch as it's already in upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
whentojump committed Jul 3, 2024
1 parent 04c8d84 commit 37f692d
Showing 1 changed file with 0 additions and 72 deletions.
72 changes: 0 additions & 72 deletions ci/3_get_llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,6 @@ cd $MCDC_HOME/llvm-project

# Patches that improve llvm-cov text output

cat > /tmp/llvm_cov_divider.patch << EOF
diff --git a/llvm/tools/llvm-cov/CoverageReport.cpp b/llvm/tools/llvm-cov/CoverageReport.cpp
index 49a35f2a9..00aea4039 100644
--- a/llvm/tools/llvm-cov/CoverageReport.cpp
+++ b/llvm/tools/llvm-cov/CoverageReport.cpp
@@ -102,8 +102,25 @@ void adjustColumnWidths(ArrayRef<StringRef> Files,
/// Prints a horizontal divider long enough to cover the given column
/// widths.
-void renderDivider(ArrayRef<size_t> ColumnWidths, raw_ostream &OS) {
- size_t Length = std::accumulate(ColumnWidths.begin(), ColumnWidths.end(), 0);
+void renderDivider(raw_ostream &OS, const CoverageViewOptions &Options, bool isFileReport) {
+ size_t Length;
+ if (isFileReport) {
+ Length = std::accumulate(std::begin(FileReportColumns), std::end(FileReportColumns), 0);
+ if (!Options.ShowRegionSummary)
+ Length -= (FileReportColumns[1] + FileReportColumns[2] + FileReportColumns[3]);
+ if (!Options.ShowInstantiationSummary)
+ Length -= (FileReportColumns[7] + FileReportColumns[8] + FileReportColumns[9]);
+ if (!Options.ShowBranchSummary)
+ Length -= (FileReportColumns[13] + FileReportColumns[14] + FileReportColumns[15]);
+ if (!Options.ShowMCDCSummary)
+ Length -= (FileReportColumns[16] + FileReportColumns[17] + FileReportColumns[18]);
+ } else {
+ Length = std::accumulate(std::begin(FunctionReportColumns), std::end(FunctionReportColumns), 0);
+ if (!Options.ShowBranchSummary)
+ Length -= (FunctionReportColumns[7] + FunctionReportColumns[8] + FunctionReportColumns[9]);
+ if (!Options.ShowMCDCSummary)
+ Length -= (FunctionReportColumns[10] + FunctionReportColumns[11] + FunctionReportColumns[12]);
+ }
for (size_t I = 0; I < Length; ++I)
OS << '-';
}
@@ -405,7 +422,7 @@ void CoverageReport::renderFunctionReports(ArrayRef<std::string> Files,
<< column("Miss", FunctionReportColumns[11], Column::RightAlignment)
<< column("Cover", FunctionReportColumns[12], Column::RightAlignment);
OS << "\n";
- renderDivider(FunctionReportColumns, OS);
+ renderDivider(OS, Options, false);
OS << "\n";
FunctionCoverageSummary Totals("TOTAL");
for (const auto &F : Functions) {
@@ -418,7 +435,7 @@ void CoverageReport::renderFunctionReports(ArrayRef<std::string> Files,
render(Function, DC, OS);
}
if (Totals.ExecutionCount) {
- renderDivider(FunctionReportColumns, OS);
+ renderDivider(OS, Options, false);
OS << "\n";
render(Totals, DC, OS);
}
@@ -544,7 +561,7 @@ void CoverageReport::renderFileReports(
Column::RightAlignment)
<< column("Cover", FileReportColumns[18], Column::RightAlignment);
OS << "\n";
- renderDivider(FileReportColumns, OS);
+ renderDivider(OS, Options, true);
OS << "\n";
std::vector<const FileCoverageSummary *> EmptyFiles;
@@ -563,7 +580,7 @@ void CoverageReport::renderFileReports(
render(*FCS, OS);
}
- renderDivider(FileReportColumns, OS);
+ renderDivider(OS, Options, true);
OS << "\n";
render(Totals, OS);
}
EOF
git apply /tmp/llvm_cov_divider.patch
cat > /tmp/llvm_cov_final_new_line.patch << EOF
diff --git a/llvm/tools/llvm-cov/SourceCoverageViewText.cpp b/llvm/tools/llvm-cov/SourceCoverageViewText.cpp
index cab60c2d9..2aa588e6d 100644
Expand Down

0 comments on commit 37f692d

Please sign in to comment.