From 427ba2bcce1ccdc8a267bb55e92772985b316e76 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Mon, 14 Mar 2022 21:57:38 -0700 Subject: [llvm-cov] Assume repeat architectures for universal binaries In the case you pass multiple universal binaries to llvm-cov, assume that if only 1 architecture is passed, it should be used for all the passed binaries. This makes it easier to use multiple multi-arch binaries, since it's likely very rare that your architectures mismatch significantly if you also have multiple binaries in a single llvm-cov invocation. If the architecture is invalid for any of the passed binaries, it will still fail later. Differential Revision: https://reviews.llvm.org/D121667 --- llvm/tools/llvm-cov/CodeCoverage.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp') diff --git a/llvm/tools/llvm-cov/CodeCoverage.cpp b/llvm/tools/llvm-cov/CodeCoverage.cpp index 33874e3..b333f7f 100644 --- a/llvm/tools/llvm-cov/CodeCoverage.cpp +++ b/llvm/tools/llvm-cov/CodeCoverage.cpp @@ -883,6 +883,9 @@ int CodeCoverageTool::run(Command Cmd, int argc, const char **argv) { } CoverageArches.emplace_back(Arch); } + if (CoverageArches.size() == 1) + CoverageArches.insert(CoverageArches.end(), ObjectFilenames.size() - 1, + CoverageArches[0]); if (CoverageArches.size() != ObjectFilenames.size()) { error("Number of architectures doesn't match the number of objects"); return 1; -- cgit v1.1