From: Tom Stellard <thomas.stell...@amd.com>

The use list may change during the execution of the loop, so we
need to manually keep track of the next item in the list.
---
 lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp 
b/lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp
index a765438..5a98463 100644
--- a/lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp
+++ b/lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp
@@ -208,8 +208,9 @@ SDNode *AMDGPUDAGToDAGISel::Select(SDNode *N) {
       }
     }
 
-    for (SDNode::use_iterator Use = N->use_begin(), E = SDNode::use_end();
-                                                    Use != E; ++Use) {
+    for (SDNode::use_iterator Use = N->use_begin(), Next = llvm::next(Use);
+                              Use != SDNode::use_end(); Use = Next) {
+      Next = llvm::next(Use);
       std::vector<SDValue> Ops;
       for (unsigned i = 0; i < Use->getNumOperands(); ++i) {
         Ops.push_back(Use->getOperand(i));
-- 
1.7.11.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to