Cleanup. Avoid relying on specialization of std::distance.
authorAndrew Trick <atrick@apple.com>
Wed, 10 Aug 2011 00:49:12 +0000 (00:49 +0000)
committerAndrew Trick <atrick@apple.com>
Wed, 10 Aug 2011 00:49:12 +0000 (00:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137191 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/LoopInfo.h

index 48c59ac4e9a75730f7406db52ce9a9baa1d7a6c2..7ebcd6b849888a29bb100bc43c7ea0f0c7216c9d 100644 (file)
@@ -134,9 +134,9 @@ public:
   block_iterator block_begin() const { return Blocks.begin(); }
   block_iterator block_end() const { return Blocks.end(); }
 
-  /// getNumBlocks - Get the number of blocks in this loop.
+  /// getNumBlocks - Get the number of blocks in this loop in constant time.
   unsigned getNumBlocks() const {
-    return std::distance(block_begin(), block_end());
+    return Blocks.size();
   }
 
   /// isLoopExiting - True if terminator in the block can branch to another