Skip to content

Commit

Permalink
[profgen][NFC] Pass parameter as const_ref
Browse files Browse the repository at this point in the history
Pass `ProbeNode` parameter of `trackInlineesOptimizedAway` as const
reference.

Reviewers: wlei-llvm, WenleiHe

Reviewed By: WenleiHe

Pull Request: #102787
  • Loading branch information
aaupov committed Aug 11, 2024
1 parent 4ac42af commit 242f4e8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions llvm/include/llvm/MC/MCPseudoProbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ class MCPseudoProbeInlineTreeBase {
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); }
// Caller node of the inline site
MCPseudoProbeInlineTreeBase<ProbeType, DerivedProbeInlineTreeType> *Parent =
Expand Down
3 changes: 2 additions & 1 deletion llvm/tools/llvm-profgen/ProfiledBinary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ void BinarySizeContextTracker::trackInlineesOptimizedAway(

void BinarySizeContextTracker::trackInlineesOptimizedAway(
MCPseudoProbeDecoder &ProbeDecoder,
MCDecodedPseudoProbeInlineTree &ProbeNode, ProbeFrameStack &ProbeContext) {
const MCDecodedPseudoProbeInlineTree &ProbeNode,
ProbeFrameStack &ProbeContext) {
StringRef FuncName =
ProbeDecoder.getFuncDescForGUID(ProbeNode.Guid)->FuncName;
ProbeContext.emplace_back(FuncName, 0);
Expand Down
7 changes: 4 additions & 3 deletions llvm/tools/llvm-profgen/ProfiledBinary.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ class BinarySizeContextTracker {
void trackInlineesOptimizedAway(MCPseudoProbeDecoder &ProbeDecoder);

using ProbeFrameStack = SmallVector<std::pair<StringRef, uint32_t>>;
void trackInlineesOptimizedAway(MCPseudoProbeDecoder &ProbeDecoder,
MCDecodedPseudoProbeInlineTree &ProbeNode,
ProbeFrameStack &Context);
void
trackInlineesOptimizedAway(MCPseudoProbeDecoder &ProbeDecoder,
const MCDecodedPseudoProbeInlineTree &ProbeNode,
ProbeFrameStack &Context);

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

Expand Down

0 comments on commit 242f4e8

Please sign in to comment.