aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-cov/CodeCoverage.cpp
diff options
context:
space:
mode:
authorKeith Smiley <keithbsmiley@gmail.com>2022-03-14 21:57:38 -0700
committerKeith Smiley <keithbsmiley@gmail.com>2022-06-08 13:22:57 -0700
commit427ba2bcce1ccdc8a267bb55e92772985b316e76 (patch)
treec9d421db8827e4b6cf73d0a6b149444fa17a46cc /llvm/tools/llvm-cov/CodeCoverage.cpp
parent14d50df2720b1f9ec444c68c6a06766d1e010f58 (diff)
downloadllvm-427ba2bcce1ccdc8a267bb55e92772985b316e76.zip
llvm-427ba2bcce1ccdc8a267bb55e92772985b316e76.tar.gz
llvm-427ba2bcce1ccdc8a267bb55e92772985b316e76.tar.bz2
[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
Diffstat (limited to 'llvm/tools/llvm-cov/CodeCoverage.cpp')
-rw-r--r--llvm/tools/llvm-cov/CodeCoverage.cpp3
1 files changed, 3 insertions, 0 deletions
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;