Skip to content

Commit 26ac742

Browse files
[memprof] std::move matchings (NFC) (#128933)
We do not use Matchings after we call try_emplace, so we can just std::move Matchings.
1 parent f3b4d94 commit 26ac742

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Transforms/Instrumentation/MemProfiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,11 +929,11 @@ memprof::computeUndriftMap(Module &M, IndexedInstrProfReader *MemProfReader,
929929
longestCommonSequence<LineLocation, GlobalValue::GUID>(
930930
ProfileAnchors, IRAnchors, std::equal_to<GlobalValue::GUID>(),
931931
[&](LineLocation A, LineLocation B) { Matchings.try_emplace(A, B); });
932-
bool Inserted = UndriftMaps.try_emplace(CallerGUID, Matchings).second;
932+
[[maybe_unused]] bool Inserted =
933+
UndriftMaps.try_emplace(CallerGUID, std::move(Matchings)).second;
933934

934935
// The insertion must succeed because we visit each GUID exactly once.
935936
assert(Inserted);
936-
(void)Inserted;
937937
}
938938

939939
return UndriftMaps;

0 commit comments

Comments
 (0)