Skip to content

Commit 0a2f0dd

Browse files
Avoid repeated lookup
1 parent a6b6272 commit 0a2f0dd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/passes/GlobalEffects.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,13 @@ CallGraph buildCallGraph(const Module& module,
113113
const std::map<Function*, FuncInfo>& funcInfos) {
114114
CallGraph callGraph;
115115
for (const auto& [func, info] : funcInfos) {
116+
if (info.calledFunctions.empty()) {
117+
continue;
118+
}
119+
120+
auto& callees = callGraph[func];
116121
for (Name callee : info.calledFunctions) {
117-
callGraph[func].insert(module.getFunction(callee));
122+
callees.insert(module.getFunction(callee));
118123
}
119124
}
120125

0 commit comments

Comments
 (0)