Skip to content

Commit 242f4e8

Browse files
authored
[profgen][NFC] Pass parameter as const_ref
Pass `ProbeNode` parameter of `trackInlineesOptimizedAway` as const reference. Reviewers: wlei-llvm, WenleiHe Reviewed By: WenleiHe Pull Request: #102787
1 parent 4ac42af commit 242f4e8

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

llvm/include/llvm/MC/MCPseudoProbe.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ class MCPseudoProbeInlineTreeBase {
241241
InlinedProbeTreeMap &getChildren() { return Children; }
242242
const InlinedProbeTreeMap &getChildren() const { return Children; }
243243
std::vector<ProbeType> &getProbes() { return Probes; }
244+
const std::vector<ProbeType> &getProbes() const { return Probes; }
244245
void addProbes(ProbeType Probe) { Probes.push_back(Probe); }
245246
// Caller node of the inline site
246247
MCPseudoProbeInlineTreeBase<ProbeType, DerivedProbeInlineTreeType> *Parent =

llvm/tools/llvm-profgen/ProfiledBinary.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ void BinarySizeContextTracker::trackInlineesOptimizedAway(
137137

138138
void BinarySizeContextTracker::trackInlineesOptimizedAway(
139139
MCPseudoProbeDecoder &ProbeDecoder,
140-
MCDecodedPseudoProbeInlineTree &ProbeNode, ProbeFrameStack &ProbeContext) {
140+
const MCDecodedPseudoProbeInlineTree &ProbeNode,
141+
ProbeFrameStack &ProbeContext) {
141142
StringRef FuncName =
142143
ProbeDecoder.getFuncDescForGUID(ProbeNode.Guid)->FuncName;
143144
ProbeContext.emplace_back(FuncName, 0);

llvm/tools/llvm-profgen/ProfiledBinary.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,10 @@ class BinarySizeContextTracker {
167167
void trackInlineesOptimizedAway(MCPseudoProbeDecoder &ProbeDecoder);
168168

169169
using ProbeFrameStack = SmallVector<std::pair<StringRef, uint32_t>>;
170-
void trackInlineesOptimizedAway(MCPseudoProbeDecoder &ProbeDecoder,
171-
MCDecodedPseudoProbeInlineTree &ProbeNode,
172-
ProbeFrameStack &Context);
170+
void
171+
trackInlineesOptimizedAway(MCPseudoProbeDecoder &ProbeDecoder,
172+
const MCDecodedPseudoProbeInlineTree &ProbeNode,
173+
ProbeFrameStack &Context);
173174

174175
void dump() { RootContext.dumpTree(); }
175176

0 commit comments

Comments
 (0)