Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions llvm/lib/IR/LegacyPassManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ void PMDataManager::emitInstrCountChangedRemark(
[&FunctionToInstrCount](Function &MaybeChangedFn) {
// Update the total module count.
unsigned FnSize = MaybeChangedFn.getInstructionCount();
auto It = FunctionToInstrCount.find(MaybeChangedFn.getName());

// If we created a new function, then we need to add it to the map and
// say that it changed from 0 instructions to FnSize.
if (It == FunctionToInstrCount.end()) {
FunctionToInstrCount[MaybeChangedFn.getName()] =
std::pair<unsigned, unsigned>(0, FnSize);
auto [It, Inserted] = FunctionToInstrCount.try_emplace(
MaybeChangedFn.getName(), 0, FnSize);
if (Inserted)
return;
}
// Insert the new function size into the second member of the pair. This
// tells us whether or not this function changed in size.
It->second.second = FnSize;
Expand Down
Loading