diff options
| author | Pat Gavlin <pagavlin@microsoft.com> | 2015-05-12 21:33:48 +0000 |
|---|---|---|
| committer | Pat Gavlin <pagavlin@microsoft.com> | 2015-05-12 21:33:48 +0000 |
| commit | 08d7027cc1eb6ac8e9d54ab469e04b1f22a1d3c6 (patch) | |
| tree | 5217d6cdd27e2dae2a48d5b4a4b87fe7d894ab6a /llvm/lib/CodeGen/SelectionDAG | |
| parent | 0da8da58984965ccdaf0cba59c7a74917f66f062 (diff) | |
| download | bcm5719-llvm-08d7027cc1eb6ac8e9d54ab469e04b1f22a1d3c6.tar.gz bcm5719-llvm-08d7027cc1eb6ac8e9d54ab469e04b1f22a1d3c6.zip | |
[Statepoints] Clean up statepoint argument accessors.
Differential Revision: http://reviews.llvm.org/D9622
llvm-svn: 237191
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp index 86fbc635458..29f4b0ae182 100644 --- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp @@ -469,10 +469,7 @@ static void lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops, // particular value. This is purely an optimization over the code below and // doesn't change semantics at all. It is important for performance that we // reserve slots for both deopt and gc values before lowering either. - for (auto I = StatepointSite.vm_state_begin() + 1, - E = StatepointSite.vm_state_end(); - I != E; ++I) { - Value *V = *I; + for (const Value *V : StatepointSite.vm_state_args()) { SDValue Incoming = Builder.getValue(V); reservePreviousStackSlotForValue(Incoming, Builder); } @@ -490,8 +487,8 @@ static void lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops, const int NumVMSArgs = StatepointSite.getNumTotalVMSArgs(); pushStackMapConstant(Ops, Builder, NumVMSArgs); - assert(NumVMSArgs + 1 == std::distance(StatepointSite.vm_state_begin(), - StatepointSite.vm_state_end())); + assert(NumVMSArgs == std::distance(StatepointSite.vm_state_begin(), + StatepointSite.vm_state_end())); // The vm state arguments are lowered in an opaque manner. We do // not know what type of values are contained within. We skip the @@ -499,10 +496,7 @@ static void lowerStatepointMetaArgs(SmallVectorImpl<SDValue> &Ops, // explicitly just above. We could have left it in the loop and // not done it explicitly, but it's far easier to understand this // way. - for (auto I = StatepointSite.vm_state_begin() + 1, - E = StatepointSite.vm_state_end(); - I != E; ++I) { - const Value *V = *I; + for (const Value *V : StatepointSite.vm_state_args()) { SDValue Incoming = Builder.getValue(V); lowerIncomingStatepointValue(Incoming, Ops, Builder); } @@ -621,12 +615,10 @@ void SelectionDAGBuilder::LowerStatepoint( TSOps.push_back(Chain); // Add GC transition arguments - for (auto I = ISP.gc_transition_args_begin() + 1, - E = ISP.gc_transition_args_end(); - I != E; ++I) { - TSOps.push_back(getValue(*I)); - if ((*I)->getType()->isPointerTy()) - TSOps.push_back(DAG.getSrcValue(*I)); + for (const Value *V : ISP.gc_transition_args()) { + TSOps.push_back(getValue(V)); + if (V->getType()->isPointerTy()) + TSOps.push_back(DAG.getSrcValue(V)); } // Add glue if necessary @@ -704,12 +696,10 @@ void SelectionDAGBuilder::LowerStatepoint( TEOps.push_back(SDValue(StatepointMCNode, 0)); // Add GC transition arguments - for (auto I = ISP.gc_transition_args_begin() + 1, - E = ISP.gc_transition_args_end(); - I != E; ++I) { - TEOps.push_back(getValue(*I)); - if ((*I)->getType()->isPointerTy()) - TEOps.push_back(DAG.getSrcValue(*I)); + for (const Value *V : ISP.gc_transition_args()) { + TEOps.push_back(getValue(V)); + if (V->getType()->isPointerTy()) + TEOps.push_back(DAG.getSrcValue(V)); } // Add glue |

