Convert more code to use new style casts
[oota-llvm.git] / lib / Analysis / Interval.cpp
1 //===- Interval.cpp - Interval class code ------------------------*- C++ -*--=//
2 //
3 // This file contains the definition of the cfg::Interval class, which
4 // represents a partition of a control flow graph of some kind.
5 //
6 //===----------------------------------------------------------------------===//
7
8 #include "llvm/Analysis/Interval.h"
9 #include "llvm/BasicBlock.h"
10
11 //===----------------------------------------------------------------------===//
12 // Interval Implementation
13 //===----------------------------------------------------------------------===//
14
15 // isLoop - Find out if there is a back edge in this interval...
16 //
17 bool cfg::Interval::isLoop() const {
18   // There is a loop in this interval iff one of the predecessors of the header
19   // node lives in the interval.
20   for (BasicBlock::pred_iterator I = HeaderNode->pred_begin(), 
21                                  E = HeaderNode->pred_end(); I != E; ++I) {
22     if (contains(*I)) return true;
23   }
24   return false;
25 }
26
27