Skip to content

Commit db348c8

Browse files
[Passes] Avoid repeated hash lookups (NFC) (#126404)
1 parent c741cf1 commit db348c8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/include/llvm/Passes/DroppedVariableStats.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,10 @@ class DroppedVariableStats {
9696
DenseSet<VarID> &DebugVariablesBeforeSet =
9797
DbgVariables.DebugVariablesBefore;
9898
DenseSet<VarID> &DebugVariablesAfterSet = DbgVariables.DebugVariablesAfter;
99-
if (InlinedAts.back().find(FuncName) == InlinedAts.back().end())
99+
auto It = InlinedAts.back().find(FuncName);
100+
if (It == InlinedAts.back().end())
100101
return;
101-
DenseMap<VarID, DILocation *> &InlinedAtsMap = InlinedAts.back()[FuncName];
102+
DenseMap<VarID, DILocation *> &InlinedAtsMap = It->second;
102103
// Find an Instruction that shares the same scope as the dropped #dbg_value
103104
// or has a scope that is the child of the scope of the #dbg_value, and has
104105
// an inlinedAt equal to the inlinedAt of the #dbg_value or it's inlinedAt

0 commit comments

Comments
 (0)