diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-11-19 07:49:26 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-11-19 07:49:26 +0000 |
commit | 70573dcd9f002307584b63033e6e017474e11b0c (patch) | |
tree | 0c227393f46738f668ebe94ec0b0c4132b661b55 /llvm/lib/CodeGen/CodeGenPrepare.cpp | |
parent | 2aa06a989dfef2950ab45da80dd9c1adadd9f9a2 (diff) | |
download | llvm-70573dcd9f002307584b63033e6e017474e11b0c.zip llvm-70573dcd9f002307584b63033e6e017474e11b0c.tar.gz llvm-70573dcd9f002307584b63033e6e017474e11b0c.tar.bz2 |
Update SetVector to rely on the underlying set's insert to return a pair<iterator, bool>
This is to be consistent with StringSet and ultimately with the standard
library's associative container insert function.
This lead to updating SmallSet::insert to return pair<iterator, bool>,
and then to update SmallPtrSet::insert to return pair<iterator, bool>,
and then to update all the existing users of those functions...
llvm-svn: 222334
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r-- | llvm/lib/CodeGen/CodeGenPrepare.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp index 7afa2a0..8d20848b 100644 --- a/llvm/lib/CodeGen/CodeGenPrepare.cpp +++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp @@ -1001,7 +1001,7 @@ bool CodeGenPrepare::DupRetToEnableTailCallOpts(BasicBlock *BB) { } else { SmallPtrSet<BasicBlock*, 4> VisitedBBs; for (pred_iterator PI = pred_begin(BB), PE = pred_end(BB); PI != PE; ++PI) { - if (!VisitedBBs.insert(*PI)) + if (!VisitedBBs.insert(*PI).second) continue; BasicBlock::InstListType &InstList = (*PI)->getInstList(); @@ -2401,7 +2401,7 @@ static bool FindAllMemoryUses(Instruction *I, SmallPtrSetImpl<Instruction*> &ConsideredInsts, const TargetLowering &TLI) { // If we already considered this instruction, we're done. - if (!ConsideredInsts.insert(I)) + if (!ConsideredInsts.insert(I).second) return false; // If this is an obviously unfoldable instruction, bail out. @@ -2615,7 +2615,7 @@ bool CodeGenPrepare::OptimizeMemoryInst(Instruction *MemoryInst, Value *Addr, worklist.pop_back(); // Break use-def graph loops. - if (!Visited.insert(V)) { + if (!Visited.insert(V).second) { Consensus = nullptr; break; } |