[llvm-branch-commits] [llvm] [MC][NFC] Use vector for GUIDProbeFunctionMap (PR #102905)

Amir Ayupov via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Aug 26 09:15:33 PDT 2024


https://github.com/aaupov updated https://github.com/llvm/llvm-project/pull/102905

>From 284c701cc57a613d11130a349aba522397946f12 Mon Sep 17 00:00:00 2001
From: Amir Ayupov <aaupov at fb.com>
Date: Fri, 16 Aug 2024 03:30:54 -0700
Subject: [PATCH] Assert func desc size

Created using spr 1.3.4
---
 llvm/lib/MC/MCPseudoProbe.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/llvm/lib/MC/MCPseudoProbe.cpp b/llvm/lib/MC/MCPseudoProbe.cpp
index 10def15275fac3..90d7588407068a 100644
--- a/llvm/lib/MC/MCPseudoProbe.cpp
+++ b/llvm/lib/MC/MCPseudoProbe.cpp
@@ -425,6 +425,8 @@ bool MCPseudoProbeDecoder::buildGUID2FuncDescMap(const uint8_t *Start,
     GUID2FuncDescMap.emplace_back(GUID, Hash, Name.copy(FuncNameAllocator));
   }
   assert(Data == End && "Have unprocessed data in pseudo_probe_desc section");
+  assert(GUID2FuncDescMap.size() == FuncDescCount &&
+         "Mismatching function description count pre- and post-parsing");
   llvm::sort(GUID2FuncDescMap, [](const auto &LHS, const auto &RHS) {
     return LHS.FuncGUID < RHS.FuncGUID;
   });



More information about the llvm-branch-commits mailing list