Commit 7c9728fa by Jim Stichnoth

Subzero: Fix a build error against LLVM trunk.

LLVM commit 1d79fff9e65e77f84bf80c2cf4f0155bd167c90d changed the way ilist::reverse_iterator is converted to ilist::iterator. See https://github.com/llvm-mirror/llvm/commit/1d79fff9e65e77f84bf80c2cf4f0155bd167c90d BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/2297363002 .
parent 29823f1c
......@@ -1161,6 +1161,15 @@ inline const Inst *iteratorToInst(InstList::const_iterator Iter) {
return &*Iter;
}
inline InstList::iterator
reverseToForwardIterator(InstList::reverse_iterator RI) {
#ifdef PNACL_LLVM
return RI.base();
#else // !PNACL_LLVM
return ++RI.getReverse();
#endif // !PNACL_LLVM
}
} // end of namespace Ice
#endif // SUBZERO_SRC_ICEINST_H
......@@ -1703,7 +1703,7 @@ void TargetARM32::addEpilog(CfgNode *Node) {
// Convert the reverse_iterator position into its corresponding (forward)
// iterator position.
InstList::iterator InsertPoint = RI.base();
InstList::iterator InsertPoint = reverseToForwardIterator(RI);
--InsertPoint;
Context.init(Node);
Context.setInsertPoint(InsertPoint);
......
......@@ -996,7 +996,7 @@ void TargetMIPS32::addEpilog(CfgNode *Node) {
// Convert the reverse_iterator position into its corresponding (forward)
// iterator position.
InstList::iterator InsertPoint = RI.base();
InstList::iterator InsertPoint = reverseToForwardIterator(RI);
--InsertPoint;
Context.init(Node);
Context.setInsertPoint(InsertPoint);
......
......@@ -1309,7 +1309,7 @@ void TargetX86Base<TraitsType>::addEpilog(CfgNode *Node) {
// Convert the reverse_iterator position into its corresponding (forward)
// iterator position.
InstList::iterator InsertPoint = RI.base();
InstList::iterator InsertPoint = reverseToForwardIterator(RI);
--InsertPoint;
Context.init(Node);
Context.setInsertPoint(InsertPoint);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment