@@ -360,8 +360,7 @@ class CallsiteContextGraph {
360360 ? CallerEdges
361361 : std::vector<std::shared_ptr<ContextEdge>>());
362362 for (const auto &Edge : Edges)
363- ContextIds.insert (Edge->getContextIds ().begin (),
364- Edge->getContextIds ().end ());
363+ ContextIds.insert_range (Edge->getContextIds ());
365364 return ContextIds;
366365 }
367366
@@ -1372,7 +1371,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
13721371 for (auto Id : ContextIds)
13731372 if (auto NewId = OldToNewContextIds.find (Id);
13741373 NewId != OldToNewContextIds.end ())
1375- NewIds.insert (NewId->second . begin (), NewId-> second . end () );
1374+ NewIds.insert_range (NewId->second );
13761375 return NewIds;
13771376 };
13781377
@@ -1389,7 +1388,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
13891388 // Only need to recursively iterate to NextNode via this caller edge if
13901389 // it resulted in any added ids to NextNode.
13911390 if (!NewIdsToAdd.empty ()) {
1392- Edge->getContextIds ().insert (NewIdsToAdd. begin (), NewIdsToAdd. end () );
1391+ Edge->getContextIds ().insert_range (NewIdsToAdd);
13931392 UpdateCallers (NextNode, Visited, UpdateCallers);
13941393 }
13951394 }
@@ -2534,8 +2533,7 @@ bool CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::calleesMatch(
25342533 // If there is already an edge between these nodes, simply update it and
25352534 // return.
25362535 if (CurEdge) {
2537- CurEdge->ContextIds .insert (Edge->ContextIds .begin (),
2538- Edge->ContextIds .end ());
2536+ CurEdge->ContextIds .insert_range (Edge->ContextIds );
25392537 CurEdge->AllocTypes |= Edge->AllocTypes ;
25402538 return ;
25412539 }
@@ -3281,8 +3279,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
32813279 if (ExistingEdgeToNewCallee) {
32823280 // Since we already have an edge to NewCallee, simply move the ids
32833281 // onto it, and remove the existing Edge.
3284- ExistingEdgeToNewCallee->getContextIds ().insert (ContextIdsToMove.begin (),
3285- ContextIdsToMove.end ());
3282+ ExistingEdgeToNewCallee->getContextIds ().insert_range (ContextIdsToMove);
32863283 ExistingEdgeToNewCallee->AllocTypes |= Edge->AllocTypes ;
32873284 assert (Edge->ContextIds == ContextIdsToMove);
32883285 removeEdgeFromGraph (Edge.get ());
@@ -3302,8 +3299,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
33023299 if (ExistingEdgeToNewCallee) {
33033300 // Since we already have an edge to NewCallee, simply move the ids
33043301 // onto it.
3305- ExistingEdgeToNewCallee->getContextIds ().insert (ContextIdsToMove.begin (),
3306- ContextIdsToMove.end ());
3302+ ExistingEdgeToNewCallee->getContextIds ().insert_range (ContextIdsToMove);
33073303 ExistingEdgeToNewCallee->AllocTypes |= CallerEdgeAllocType;
33083304 } else {
33093305 // Otherwise, create a new edge to NewCallee for the ids being moved.
@@ -3350,8 +3346,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
33503346 // removed none type edges after creating the clone. If we can't find
33513347 // a corresponding edge there, fall through to the cloning below.
33523348 if (auto *NewCalleeEdge = NewCallee->findEdgeFromCallee (CalleeToUse)) {
3353- NewCalleeEdge->getContextIds ().insert (EdgeContextIdsToMove.begin (),
3354- EdgeContextIdsToMove.end ());
3349+ NewCalleeEdge->getContextIds ().insert_range (EdgeContextIdsToMove);
33553350 NewCalleeEdge->AllocTypes |= computeAllocType (EdgeContextIdsToMove);
33563351 continue ;
33573352 }
@@ -3402,8 +3397,8 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
34023397 if (ExistingEdgeToNewCaller) {
34033398 // Since we already have an edge to NewCaller, simply move the ids
34043399 // onto it, and remove the existing Edge.
3405- ExistingEdgeToNewCaller->getContextIds ().insert (
3406- Edge->getContextIds (). begin (), Edge-> getContextIds (). end () );
3400+ ExistingEdgeToNewCaller->getContextIds ().insert_range (
3401+ Edge->getContextIds ());
34073402 ExistingEdgeToNewCaller->AllocTypes |= Edge->AllocTypes ;
34083403 Edge->ContextIds .clear ();
34093404 Edge->AllocTypes = (uint8_t )AllocationType::None;
@@ -3465,8 +3460,7 @@ void CallsiteContextGraph<DerivedCCG, FuncTy, CallTy>::
34653460 // edge, this may not hold true when recursive handling enabled.
34663461 assert (IsNewNode || ExistingCallerEdge || AllowRecursiveCallsites);
34673462 if (ExistingCallerEdge) {
3468- ExistingCallerEdge->getContextIds ().insert (EdgeContextIdsToMove.begin (),
3469- EdgeContextIdsToMove.end ());
3463+ ExistingCallerEdge->getContextIds ().insert_range (EdgeContextIdsToMove);
34703464 ExistingCallerEdge->AllocTypes |=
34713465 computeAllocType (EdgeContextIdsToMove);
34723466 continue ;
0 commit comments