1 //===- Interval.cpp - Interval class code ------------------------*- C++ -*--=//
3 // This file contains the definition of the cfg::Interval class, which
4 // represents a partition of a control flow graph of some kind.
6 //===----------------------------------------------------------------------===//
8 #include "llvm/Analysis/Interval.h"
9 #include "llvm/BasicBlock.h"
13 //===----------------------------------------------------------------------===//
14 // Interval Implementation
15 //===----------------------------------------------------------------------===//
17 // isLoop - Find out if there is a back edge in this interval...
19 bool Interval::isLoop() const {
20 // There is a loop in this interval iff one of the predecessors of the header
21 // node lives in the interval.
22 for (BasicBlock::pred_iterator I = pred_begin(HeaderNode),
23 E = pred_end(HeaderNode); I != E; ++I) {
24 if (contains(*I)) return true;