[llvm] 47b0052 - [CoverageMapping] Avoid use of pow() resulting in solaris build fail (#75559)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 14 21:49:39 PST 2023
Author: Alan Phipps
Date: 2023-12-14T23:49:35-06:00
New Revision: 47b0052f3144afdfe28c64d8b12e351141805ec6
URL: https://github.com/llvm/llvm-project/commit/47b0052f3144afdfe28c64d8b12e351141805ec6
DIFF: https://github.com/llvm/llvm-project/commit/47b0052f3144afdfe28c64d8b12e351141805ec6.diff
LOG: [CoverageMapping] Avoid use of pow() resulting in solaris build fail (#75559)
Fixes a build failure introduced by
commit 8ecbb0404d74 ("Reland [Coverage][llvm-cov]
Enable MC/DC Support in LLVM Source-based Code Coverage (2/3)")
Use of pow() is not necessary.
Added:
Modified:
llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
Removed:
################################################################################
diff --git a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
index 80875702b02ab9..eece6a2cc71797 100644
--- a/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
+++ b/llvm/lib/ProfileData/Coverage/CoverageMapping.cpp
@@ -281,7 +281,7 @@ class MCDCRecordProcessor {
: ExecutedTestVectorBitmap(Bitmap), Region(Region), Branches(Branches),
NumConditions(Region.MCDCParams.NumConditions),
Folded(NumConditions, false), IndependencePairs(NumConditions),
- TestVectors(pow(2, NumConditions)) {}
+ TestVectors((size_t)1 << NumConditions) {}
private:
void recordTestVector(MCDCRecord::TestVector &TV,
More information about the llvm-commits
mailing list