[llvm-commits] [llvm] r137191 - /llvm/trunk/include/llvm/Analysis/LoopInfo.h

Andrew Trick atrick at apple.com
Tue Aug 9 17:49:13 PDT 2011


Author: atrick
Date: Tue Aug  9 19:49:12 2011
New Revision: 137191

URL: http://llvm.org/viewvc/llvm-project?rev=137191&view=rev
Log:
Cleanup. Avoid relying on specialization of std::distance.

Modified:
    llvm/trunk/include/llvm/Analysis/LoopInfo.h

Modified: llvm/trunk/include/llvm/Analysis/LoopInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/LoopInfo.h?rev=137191&r1=137190&r2=137191&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/LoopInfo.h (original)
+++ llvm/trunk/include/llvm/Analysis/LoopInfo.h Tue Aug  9 19:49:12 2011
@@ -134,9 +134,9 @@
   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





More information about the llvm-commits mailing list