diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2012-12-05 22:15:38 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2012-12-05 22:17:47 +0000 |
commit | 8ac1a1f17d7d36869e5661d6f4219c8c6cd3015a (patch) | |
tree | a1d21e95580aee7a9a20c91807ab02bb0aca7c27 | |
parent | bed50ee430232475073c0c02fd547c070e556d4a (diff) |
R600: Fix use iterator in custom select of ISD::Constant
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.
-rw-r--r-- | lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp b/lib/Target/AMDGPU/AMDILISelDAGToDAG.cpp index a765438269..5a98463192 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)); |