[llvm] [memprof] Use std::move in toMemProfRecord (PR #93133)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Thu May 23 10:01:07 PDT 2024
kazutakahirata wrote:
> This leaves the current IndexedMemProfRecord in a bad state. How can we ensure that users don't accidentally try to read after this method has been called?
>
> I'm also skeptical how much impact this has in real usage since we don't expect to read all records for a single module. Perhaps we can try safer optimizations such as reserve() for the AllocSites vector (and the Callsites vector too)?
`AI` here is a local variable. This patch does not modify the current `IndexedMemProfRecord` in any way. In fact, `toMemProfRecord` is a const function.
https://github.com/llvm/llvm-project/pull/93133
More information about the llvm-commits
mailing list