continue;
if (auto *BCI = dyn_cast<BitCastInst>(Ptr)) {
- if (!Seen.count(BCI->getOperand(0))) {
+ if (Seen.insert(BCI->getOperand(0)).second) {
LoadOperandsQueue.push_back(BCI->getOperand(0));
- Seen.insert(BCI->getOperand(0));
}
}
continue;
if (auto *BCI = dyn_cast<BitCastInst>(U)) {
- if (!Seen.count(BCI)) {
+ if (Seen.insert(BCI).second) {
LoadOperandsQueue.push_back(BCI);
- Seen.insert(BCI);
}
continue;
}
if (OLChanged) {
OLChanged = false;
for (auto s : MBB->successors())
- if (!OnPending.count(s)) {
- OnPending.insert(s);
+ if (OnPending.insert(s).second) {
Pending.push(BBToOrder[s]);
}
}
E = SortedCategories.end();
Category != E; ++Category) {
// Hide empty categories for -help, but show for -help-hidden.
- bool IsEmptyCategory = CategorizedOptions[*Category].size() == 0;
+ const auto &CategoryOptions = CategorizedOptions[*Category];
+ bool IsEmptyCategory = CategoryOptions.empty();
if (!ShowHidden && IsEmptyCategory)
continue;
continue;
}
// Loop over the options in the category and print.
- for (std::vector<Option *>::const_iterator
- Opt = CategorizedOptions[*Category].begin(),
- E = CategorizedOptions[*Category].end();
- Opt != E; ++Opt)
- (*Opt)->printOptionInfo(MaxArgLen);
+ for (const Option *Opt : CategoryOptions)
+ Opt->printOptionInfo(MaxArgLen);
}
}
};
// If the precision was not specified, the double entry is also initialized.
if (Val.back() != 'f' && Val.back() != 'd') {
- RecipMap[Val.str() + 'd'].Enabled = !IsDisabled;
+ RecipParams &Params = RecipMap[Val.str() + 'd'];
+ Params.Enabled = !IsDisabled;
if (!RefStepString.empty())
- RecipMap[Val.str() + 'd'].RefinementSteps = RefSteps;
+ Params.RefinementSteps = RefSteps;
}
}
}
if (BBI->isTerminator()) {
BasicBlock *BB = BBI->getParent();
for (BasicBlock *Succ : successors(BB)) {
- if (Seen.count(Succ) == 0) {
+ if (Seen.insert(Succ).second) {
Worklist.push_back(Succ);
- Seen.insert(Succ);
}
}
}
// We may have base pointers which are now live that weren't before. We need
// to update the PointerToBase structure to reflect this.
for (auto V : Updated)
- if (!Info.PointerToBase.count(V)) {
+ if (Info.PointerToBase.insert(std::make_pair(V, V)).second) {
assert(Bases.count(V) && "can't find base for unexpected live value");
- Info.PointerToBase[V] = V;
continue;
}
for (RegionNode *RN : TempOrder) {
BasicBlock *BB = RN->getEntry();
Loop *Loop = LI->getLoopFor(BB);
- if (!LoopBlocks.count(Loop)) {
- LoopBlocks[Loop] = 1;
- continue;
- }
- LoopBlocks[Loop]++;
+ ++LoopBlocks[Loop];
}
unsigned CurrentLoopDepth = 0;
// the outer loop.
RNVector::iterator LoopI = I;
- while(LoopBlocks[CurrentLoop]) {
+ while (unsigned &BlockCount = LoopBlocks[CurrentLoop]) {
LoopI++;
BasicBlock *LoopBB = (*LoopI)->getEntry();
if (LI->getLoopFor(LoopBB) == CurrentLoop) {
- LoopBlocks[CurrentLoop]--;
+ --BlockCount;
Order.push_back(*LoopI);
}
}