[llvm] [StandardInstrumentations]Add support for numeric label (PR #148844)

Jamie Schmeiser via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 3 07:32:41 PDT 2025


================
@@ -727,8 +727,13 @@ template <typename T>
 template <typename FunctionT>
 bool IRComparer<T>::generateFunctionData(IRDataT<T> &Data, const FunctionT &F) {
   if (shouldGenerateData(F)) {
-    FuncDataT<T> FD(F.front().getName().str());
     int I = 0;
+    // Basic block with numberic label will be empty here.
+    std::string FDEntryBlockName = F.front().getName().str();
+    if (FDEntryBlockName.empty())
+      FDEntryBlockName = formatv("{0}", I);
+
----------------
jamieschmeiser wrote:

Ok, but could you please add a comment indicating that it will be incremented later?  As is, it looks like a bug (and will to you also in a year from now :-) )

https://github.com/llvm/llvm-project/pull/148844


More information about the llvm-commits mailing list