Skip to content

Commit 916d58e

Browse files
committed
Use try_emplace in GCFunctionAnalysis
1 parent 285430f commit 916d58e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/lib/CodeGen/GCMetadata.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ GCFunctionAnalysis::run(Function &F, FunctionAnalysisManager &FAM) {
6363
"This pass need module analysis `collector-metadata`!");
6464
auto &Map =
6565
*MAMProxy.getCachedResult<CollectorMetadataAnalysis>(*F.getParent());
66-
GCFunctionInfo Info(F, Map[F.getGC()]);
66+
GCStrategy &S = *Map.try_emplace(F.getGC()).first->second;
67+
GCFunctionInfo Info(F, S);
6768
return Info;
6869
}
6970

0 commit comments

Comments
 (0)