Revert "[Profile] Include a few asserts in coverage mapping test"
authorPetr Hosek <phosek@google.com>
Wed, 24 Feb 2021 22:01:42 +0000 (14:01 -0800)
committerPetr Hosek <phosek@google.com>
Wed, 24 Feb 2021 22:01:42 +0000 (14:01 -0800)
This reverts commit 80f329bcd0281c11062879025761d0657167fe8b.

llvm/unittests/ProfileData/CoverageMappingTest.cpp

index 3f9a00b..d1bb87a 100644 (file)
@@ -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));