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"
10 #include "llvm/Support/CFG.h"
12 //===----------------------------------------------------------------------===//
13 // Interval Implementation
14 //===----------------------------------------------------------------------===//
16 // isLoop - Find out if there is a back edge in this interval...
18 bool cfg::Interval::isLoop() const {
19 // There is a loop in this interval iff one of the predecessors of the header
20 // node lives in the interval.
21 for (::pred_iterator I = ::pred_begin(HeaderNode), E = ::pred_end(HeaderNode);
23 if (contains(*I)) return true;