[polly] r259337 - ScopInfo: use std::distance to shorten code [NFC]
Tobias Grosser via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 31 17:55:08 PST 2016
Author: grosser
Date: Sun Jan 31 19:55:08 2016
New Revision: 259337
URL: http://llvm.org/viewvc/llvm-project?rev=259337&view=rev
Log:
ScopInfo: use std::distance to shorten code [NFC]
Modified:
polly/trunk/lib/Analysis/ScopInfo.cpp
Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=259337&r1=259336&r2=259337&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Jan 31 19:55:08 2016
@@ -1987,13 +1987,8 @@ static inline unsigned getNumBlocksInReg
if (!RN->isSubRegion())
return 1;
- unsigned NumBlocks = 0;
Region *R = RN->getNodeAs<Region>();
- for (auto BB : R->blocks()) {
- (void)BB;
- NumBlocks++;
- }
- return NumBlocks;
+ return std::distance(R->block_begin(), R->block_end());
}
static bool containsErrorBlock(RegionNode *RN, const Region &R, LoopInfo &LI,
More information about the llvm-commits
mailing list