diff options
Diffstat (limited to 'llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp')
| -rw-r--r-- | llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp b/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp index 6a5192c866cc..11e7d5a17fa9 100644 --- a/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp +++ b/llvm/lib/Target/Hexagon/HexagonCommonGEP.cpp @@ -447,7 +447,7 @@ static void nodes_for_root(GepNode *Root, NodeChildrenMap &NCM, Work.erase(First); NodeChildrenMap::iterator CF = NCM.find(N); if (CF != NCM.end()) { - Work.insert(Work.end(), CF->second.begin(), CF->second.end()); + llvm::append_range(Work, CF->second); Nodes.insert(CF->second.begin(), CF->second.end()); } } @@ -472,10 +472,11 @@ static const NodeSet *node_class(GepNode *N, NodeSymRel &Rel) { // determining equality. The only purpose of the ordering is to eliminate // duplication due to the commutativity of equality/non-equality. static NodePair node_pair(GepNode *N1, GepNode *N2) { - uintptr_t P1 = uintptr_t(N1), P2 = uintptr_t(N2); - if (P1 <= P2) - return std::make_pair(N1, N2); - return std::make_pair(N2, N1); + uintptr_t P1 = reinterpret_cast<uintptr_t>(N1); + uintptr_t P2 = reinterpret_cast<uintptr_t>(N2); + if (P1 <= P2) + return std::make_pair(N1, N2); + return std::make_pair(N2, N1); } static unsigned node_hash(GepNode *N) { @@ -650,8 +651,7 @@ void HexagonCommonGEP::common() { // Node for removal. Erase.insert(*I); } - NodeVect::iterator NewE = remove_if(Nodes, in_set(Erase)); - Nodes.resize(std::distance(Nodes.begin(), NewE)); + erase_if(Nodes, in_set(Erase)); LLVM_DEBUG(dbgs() << "Gep nodes after post-commoning cleanup:\n" << Nodes); } @@ -1145,7 +1145,7 @@ void HexagonCommonGEP::getAllUsersForNode(GepNode *Node, ValueVect &Values, NodeChildrenMap::iterator CF = NCM.find(N); if (CF != NCM.end()) { NodeVect &Cs = CF->second; - Work.insert(Work.end(), Cs.begin(), Cs.end()); + llvm::append_range(Work, Cs); } } } |
