@@ -1478,8 +1478,9 @@ CallInst *replaceCalledFunction(Module &M, OutlinableRegion &Region) {
1478
1478
}
1479
1479
1480
1480
// If it is a constant, we simply add it to the argument list as a value.
1481
- if (Region.AggArgToConstant .contains (AggArgIdx)) {
1482
- Constant *CST = Region.AggArgToConstant .find (AggArgIdx)->second ;
1481
+ if (auto It = Region.AggArgToConstant .find (AggArgIdx);
1482
+ It != Region.AggArgToConstant .end ()) {
1483
+ Constant *CST = It->second ;
1483
1484
LLVM_DEBUG (dbgs () << " Setting argument " << AggArgIdx << " to value "
1484
1485
<< *CST << " \n " );
1485
1486
NewCallArgs.push_back (CST);
@@ -1612,9 +1613,10 @@ getPassedArgumentAndAdjustArgumentLocation(const Argument *A,
1612
1613
1613
1614
// If it is a constant, we can look at our mapping from when we created
1614
1615
// the outputs to figure out what the constant value is.
1615
- if (Region.AggArgToConstant .count (ArgNum))
1616
- return Region.AggArgToConstant .find (ArgNum)->second ;
1617
-
1616
+ if (auto It = Region.AggArgToConstant .find (ArgNum);
1617
+ It != Region.AggArgToConstant .end ())
1618
+ return It->second ;
1619
+
1618
1620
// If it is not a constant, and we are not looking at the overall function, we
1619
1621
// need to adjust which argument we are looking at.
1620
1622
ArgNum = Region.AggArgToExtracted .find (ArgNum)->second ;
@@ -2693,12 +2695,13 @@ void IROutliner::updateOutputMapping(OutlinableRegion &Region,
2693
2695
if (!OutputIdx)
2694
2696
return ;
2695
2697
2696
- if (!OutputMappings.contains (Outputs[*OutputIdx])) {
2698
+ auto It = OutputMappings.find (Outputs[*OutputIdx]);
2699
+ if (It == OutputMappings.end ()) {
2697
2700
LLVM_DEBUG (dbgs () << " Mapping extracted output " << *LI << " to "
2698
2701
<< *Outputs[*OutputIdx] << " \n " );
2699
2702
OutputMappings.insert (std::make_pair (LI, Outputs[*OutputIdx]));
2700
2703
} else {
2701
- Value *Orig = OutputMappings. find (Outputs[*OutputIdx]) ->second ;
2704
+ Value *Orig = It ->second ;
2702
2705
LLVM_DEBUG (dbgs () << " Mapping extracted output " << *Orig << " to "
2703
2706
<< *Outputs[*OutputIdx] << " \n " );
2704
2707
OutputMappings.insert (std::make_pair (LI, Orig));
0 commit comments