diff options
Diffstat (limited to 'llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp index 72ab175deca..3464b759280 100644 --- a/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp +++ b/llvm/lib/Transforms/Scalar/MergedLoadStoreMotion.cpp @@ -285,7 +285,8 @@ bool MergedLoadStoreMotion::mergeStores(BasicBlock *T) { return false; // No. More than 2 predecessors. // #Instructions in Succ1 for Compile Time Control - int Size1 = distance(Pred1->instructionsWithoutDebug()); + auto InstsNoDbg = Pred1->instructionsWithoutDebug(); + int Size1 = std::distance(InstsNoDbg.begin(), InstsNoDbg.end()); int NStores = 0; for (BasicBlock::reverse_iterator RBI = Pred0->rbegin(), RBE = Pred0->rend(); |