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

Ruoyu Qiu via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 2 20:54:21 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);
+
----------------
cabbaken wrote:

No, the `I` is incremented at line 740. The `FDEntryBlockName` here refers to the first block in the function, which corresponds to the first `B` in the loop below.

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


More information about the llvm-commits mailing list