diff options
author | Kazu Hirata <kazu@google.com> | 2024-11-15 13:03:24 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-15 13:03:24 -0800 |
commit | ec353b7418e272e96cd63cc61bec586ab49da92f (patch) | |
tree | a90487470023456342f86fb4a0ea240a543a7a90 /llvm/lib/ProfileData/InstrProfReader.cpp | |
parent | 3734e4c0c4966f794b9588445448004fee769ab9 (diff) | |
download | llvm-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.cpp | 3 |
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()) |