[llvm] ae7528a - Revert "[Profile] Include a few asserts in coverage mapping test"
Petr Hosek via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 24 14:01:53 PST 2021
Author: Petr Hosek
Date: 2021-02-24T14:01:42-08:00
New Revision: ae7528a34e2771ba4f0741e4941f78810854103d
URL: https://github.com/llvm/llvm-project/commit/ae7528a34e2771ba4f0741e4941f78810854103d
DIFF: https://github.com/llvm/llvm-project/commit/ae7528a34e2771ba4f0741e4941f78810854103d.diff
LOG: Revert "[Profile] Include a few asserts in coverage mapping test"
This reverts commit 80f329bcd0281c11062879025761d0657167fe8b.
Added:
Modified:
llvm/unittests/ProfileData/CoverageMappingTest.cpp
Removed:
################################################################################
diff --git a/llvm/unittests/ProfileData/CoverageMappingTest.cpp b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
index 3f9a00b89954..d1bb87ae966a 100644
--- a/llvm/unittests/ProfileData/CoverageMappingTest.cpp
+++ b/llvm/unittests/ProfileData/CoverageMappingTest.cpp
@@ -145,10 +145,8 @@ struct CoverageMappingTest : ::testing::TestWithParam<std::pair<bool, bool>> {
unsigned getGlobalFileIndex(StringRef Name) {
auto R = Files.find(Name);
- if (R != Files.end()) {
- assert(R->second > 0 && "got index of compilation dir");
+ if (R != Files.end())
return R->second;
- }
unsigned Index = Files.size() + 1;
Files.try_emplace(Name, Index);
return Index;
@@ -163,10 +161,8 @@ struct CoverageMappingTest : ::testing::TestWithParam<std::pair<bool, bool>> {
auto &CurrentFunctionFileMapping =
InputFunctions.back().ReverseVirtualFileMapping;
auto R = CurrentFunctionFileMapping.find(GlobalIndex);
- if (R != CurrentFunctionFileMapping.end()) {
- assert(R->second > 0 && "got index of compilation dir");
+ if (R != CurrentFunctionFileMapping.end())
return R->second;
- }
unsigned IndexInFunction = CurrentFunctionFileMapping.size();
CurrentFunctionFileMapping.insert(
std::make_pair(GlobalIndex, IndexInFunction));
More information about the llvm-commits
mailing list