1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/Analysis/Interval.cpp
Chris Lattner 8e9be000a7 * Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
  InstrTypes.h anymore

llvm-svn: 1750
2002-02-12 22:39:50 +00:00

29 lines
970 B
C++

//===- Interval.cpp - Interval class code ------------------------*- C++ -*--=//
//
// This file contains the definition of the cfg::Interval class, which
// represents a partition of a control flow graph of some kind.
//
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/Interval.h"
#include "llvm/BasicBlock.h"
#include "llvm/Support/CFG.h"
//===----------------------------------------------------------------------===//
// Interval Implementation
//===----------------------------------------------------------------------===//
// isLoop - Find out if there is a back edge in this interval...
//
bool cfg::Interval::isLoop() const {
// There is a loop in this interval iff one of the predecessors of the header
// node lives in the interval.
for (::pred_iterator I = ::pred_begin(HeaderNode), E = ::pred_end(HeaderNode);
I != E; ++I) {
if (contains(*I)) return true;
}
return false;
}