@@ -1478,8 +1478,9 @@ CallInst *replaceCalledFunction(Module &M, OutlinableRegion &Region) {
14781478 }
14791479
14801480 // 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 ;
14831484 LLVM_DEBUG (dbgs () << " Setting argument " << AggArgIdx << " to value "
14841485 << *CST << " \n " );
14851486 NewCallArgs.push_back (CST);
@@ -1612,9 +1613,10 @@ getPassedArgumentAndAdjustArgumentLocation(const Argument *A,
16121613
16131614 // If it is a constant, we can look at our mapping from when we created
16141615 // 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+
16181620 // If it is not a constant, and we are not looking at the overall function, we
16191621 // need to adjust which argument we are looking at.
16201622 ArgNum = Region.AggArgToExtracted .find (ArgNum)->second ;
@@ -2693,12 +2695,13 @@ void IROutliner::updateOutputMapping(OutlinableRegion &Region,
26932695 if (!OutputIdx)
26942696 return ;
26952697
2696- if (!OutputMappings.contains (Outputs[*OutputIdx])) {
2698+ auto It = OutputMappings.find (Outputs[*OutputIdx]);
2699+ if (It == OutputMappings.end ()) {
26972700 LLVM_DEBUG (dbgs () << " Mapping extracted output " << *LI << " to "
26982701 << *Outputs[*OutputIdx] << " \n " );
26992702 OutputMappings.insert (std::make_pair (LI, Outputs[*OutputIdx]));
27002703 } else {
2701- Value *Orig = OutputMappings. find (Outputs[*OutputIdx]) ->second ;
2704+ Value *Orig = It ->second ;
27022705 LLVM_DEBUG (dbgs () << " Mapping extracted output " << *Orig << " to "
27032706 << *Outputs[*OutputIdx] << " \n " );
27042707 OutputMappings.insert (std::make_pair (LI, Orig));
0 commit comments