aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ProfileData/InstrProfReader.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2024-11-15 13:03:24 -0800
committerGitHub <noreply@github.com>2024-11-15 13:03:24 -0800
commitec353b7418e272e96cd63cc61bec586ab49da92f (patch)
treea90487470023456342f86fb4a0ea240a543a7a90 /llvm/lib/ProfileData/InstrProfReader.cpp
parent3734e4c0c4966f794b9588445448004fee769ab9 (diff)
downloadllvm-ec353b7418e272e96cd63cc61bec586ab49da92f.zip
llvm-ec353b7418e272e96cd63cc61bec586ab49da92f.tar.gz
llvm-ec353b7418e272e96cd63cc61bec586ab49da92f.tar.bz2
[memprof] Use llvm::function_ref instead of std::function (#116306)
We've seen bugs where we lost track of error states stored in the functor because we passed the functor by value (that is, std::function) as opposed to reference (llvm::function_ref). This patch fixes a couple of places we pass functors by value. While we are at it, this patch adds curly braces around a "for" loop spanning multiple lines.
Diffstat (limited to 'llvm/lib/ProfileData/InstrProfReader.cpp')
-rw-r--r--llvm/lib/ProfileData/InstrProfReader.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/ProfileData/InstrProfReader.cpp b/llvm/lib/ProfileData/InstrProfReader.cpp
index 54a7dea..5a2a335 100644
--- a/llvm/lib/ProfileData/InstrProfReader.cpp
+++ b/llvm/lib/ProfileData/InstrProfReader.cpp
@@ -1688,10 +1688,11 @@ IndexedMemProfReader::getMemProfCallerCalleePairs() const {
// duplicates, we first collect them in the form of a bit vector before
// processing them.
for (const memprof::IndexedMemProfRecord &IndexedRecord :
- MemProfRecordTable->data())
+ MemProfRecordTable->data()) {
for (const memprof::IndexedAllocationInfo &IndexedAI :
IndexedRecord.AllocSites)
Worklist.set(IndexedAI.CSId);
+ }
// Collect caller-callee pairs for each linear call stack ID in Worklist.
for (unsigned CS : Worklist.set_bits())