[PATCH] D157913: [Coverage] Allow Clang coverage to be used with debug info correlation.

Ellis Hoag via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 14 13:16:56 PDT 2023


ellis added a comment.

It looks like `debug-info-correlate-coverage.ll` was renamed twice. Is this intended?



================
Comment at: compiler-rt/lib/profile/InstrProfilingWriter.c:276-277
       __llvm_profile_get_num_counters(CountersBegin, CountersEnd);
-  const uint64_t NamesSize = DebugInfoCorrelate ? 0 : NamesEnd - NamesBegin;
+  const uint64_t NamesSize =
+      DebugInfoCorrelate && IRLevelProfile ? 0 : NamesEnd - NamesBegin;
 
----------------
Can we remove changes to this file now that we are stripping the names section?


================
Comment at: llvm/lib/ProfileData/InstrProfCorrelator.cpp:423
+      }
+      return;
+    }
----------------
I think this return should be on the line above to break out of the for loop early. Or did I miscount the brackets?


================
Comment at: llvm/lib/ProfileData/InstrProfReader.cpp:577-578
     // Correlator.
-    assert(DataSize == 0 && NamesSize == 0);
-    assert(CountersDelta == 0 && NamesDelta == 0);
+    assert(DataSize == 0 && (!isIRLevelProfile() || NamesSize == 0));
+    assert(CountersDelta == 0 && (!isIRLevelProfile() || NamesDelta == 0));
     Data = Correlator->getDataPointer();
----------------
I think these changes can also be removed


================
Comment at: llvm/lib/Transforms/Instrumentation/InstrProfiling.cpp:769
   }
+  if (DebugInfoCorrelate && !ReferencedNames.empty()) {
+    MDNode *Node = *M->debug_compile_units_begin();
----------------
Just so that I understand. Does this code run only for names of unused functions? Or will we store all function names with `CovFunctionNameAnnotation`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157913/new/

https://reviews.llvm.org/D157913



More information about the cfe-commits mailing list