[llvm] 03692aa - [memprof] Use a lambda instead of std::bind (NFC) (#144940)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 19 13:17:50 PDT 2025
Author: Kazu Hirata
Date: 2025-06-19T13:17:47-07:00
New Revision: 03692aa40487d0f4090d329ca2904fb888242c94
URL: https://github.com/llvm/llvm-project/commit/03692aa40487d0f4090d329ca2904fb888242c94
DIFF: https://github.com/llvm/llvm-project/commit/03692aa40487d0f4090d329ca2904fb888242c94.diff
LOG: [memprof] Use a lambda instead of std::bind (NFC) (#144940)
A lambda is a lot shorter than std::bind here.
Added:
Modified:
llvm/include/llvm/ProfileData/MemProfReader.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ProfileData/MemProfReader.h b/llvm/include/llvm/ProfileData/MemProfReader.h
index 4d41d05b1457c..25578ecd06f12 100644
--- a/llvm/include/llvm/ProfileData/MemProfReader.h
+++ b/llvm/include/llvm/ProfileData/MemProfReader.h
@@ -62,8 +62,7 @@ class MemProfReader {
return make_error<InstrProfError>(instrprof_error::eof);
if (Callback == nullptr)
- Callback =
- std::bind(&MemProfReader::idToFrame, this, std::placeholders::_1);
+ Callback = [&](FrameId Id) { return idToFrame(Id); };
CallStackIdConverter<decltype(MemProfData.CallStacks)> CSIdConv(
MemProfData.CallStacks, Callback);
More information about the llvm-commits
mailing list