[llvm-branch-commits] [llvm] [MC][NFC] Statically allocate storage for decoded pseudo probes and function records (PR #102789)

Lei Wang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Aug 15 00:16:37 PDT 2024


================
@@ -240,12 +235,11 @@ class MCPseudoProbeInlineTreeBase {
   bool isRoot() const { return Guid == 0; }
   InlinedProbeTreeMap &getChildren() { return Children; }
   const InlinedProbeTreeMap &getChildren() const { return Children; }
-  std::vector<ProbeType> &getProbes() { return Probes; }
-  const std::vector<ProbeType> &getProbes() const { return Probes; }
-  void addProbes(ProbeType Probe) { Probes.push_back(Probe); }
+  ProbesType &getProbes() { return Probes; }
----------------
wlei-llvm wrote:

Do you know where we require this function(anywhere can't replace with `const`), I thought we won't change the probe after it's decoded. is it possible to only keep only one `getProbes` and `getChildren` (with the `const`)?

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


More information about the llvm-branch-commits mailing list