[PATCH] D150334: [llvm-profdata] Use string ref for FunctionSamplesMap
Wenlei He via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 11 15:45:40 PDT 2023
wenlei added inline comments.
================
Comment at: llvm/lib/ProfileData/SampleProf.cpp:517
auto &SamplesMap = NodeProfile->functionSamplesAt(ChildNode.CallSiteLoc);
SamplesMap.emplace(OrigChildContext.getName().str(), *ChildProfile);
NodeProfile->addTotalSamples(ChildProfile->getTotalSamples());
----------------
hoy wrote:
> wenlei wrote:
> > This is now creating a StringRef out of a temp string `OrigChildContext.getName().str()`.
> Good catch! Should just use `OrigChildContext.getName()`.
This is why it'd be safer to run through asan for this kind of change.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150334/new/
https://reviews.llvm.org/D150334
More information about the llvm-commits
mailing list