Skip to content

Commit 92a8fbd

Browse files
committed
[Profiler] Assert that counters are present
1 parent df66f27 commit 92a8fbd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/SIL/IR/SILProfiler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,9 @@ class CounterExpr {
395395
expand(llvm::coverage::CounterExpressionBuilder &Builder,
396396
const llvm::DenseMap<ASTNode, unsigned> &Counters) const {
397397
return expand(Builder, [&](auto Node) {
398-
// FIXME: We ought to assert that the node is present.
399-
return Counters.lookup(Node);
398+
auto Result = Counters.find(Node);
399+
assert(Result != Counters.end() && "Counter not found");
400+
return Result->second;
400401
});
401402
}
402403

0 commit comments

Comments
 (0)