1*0b57cec5SDimitry Andric //===- Interval.cpp - Interval class code ---------------------------------===//
2*0b57cec5SDimitry Andric //
3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*0b57cec5SDimitry Andric //
7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
8*0b57cec5SDimitry Andric //
9*0b57cec5SDimitry Andric // This file contains the definition of the Interval class, which represents a
10*0b57cec5SDimitry Andric // partition of a control flow graph of some kind.
11*0b57cec5SDimitry Andric //
12*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
13*0b57cec5SDimitry Andric 
14*0b57cec5SDimitry Andric #include "llvm/Analysis/Interval.h"
15*0b57cec5SDimitry Andric #include "llvm/IR/BasicBlock.h"
16*0b57cec5SDimitry Andric #include "llvm/IR/CFG.h"
17*0b57cec5SDimitry Andric #include "llvm/Support/raw_ostream.h"
18*0b57cec5SDimitry Andric 
19*0b57cec5SDimitry Andric using namespace llvm;
20*0b57cec5SDimitry Andric 
21*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
22*0b57cec5SDimitry Andric // Interval Implementation
23*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
24*0b57cec5SDimitry Andric 
print(raw_ostream & OS) const25*0b57cec5SDimitry Andric void Interval::print(raw_ostream &OS) const {
26*0b57cec5SDimitry Andric   OS << "-------------------------------------------------------------\n"
27*0b57cec5SDimitry Andric        << "Interval Contents:\n";
28*0b57cec5SDimitry Andric 
29*0b57cec5SDimitry Andric   // Print out all of the basic blocks in the interval...
30*0b57cec5SDimitry Andric   for (const BasicBlock *Node : Nodes)
31*0b57cec5SDimitry Andric     OS << *Node << "\n";
32*0b57cec5SDimitry Andric 
33*0b57cec5SDimitry Andric   OS << "Interval Predecessors:\n";
34*0b57cec5SDimitry Andric   for (const BasicBlock *Predecessor : Predecessors)
35*0b57cec5SDimitry Andric     OS << *Predecessor << "\n";
36*0b57cec5SDimitry Andric 
37*0b57cec5SDimitry Andric   OS << "Interval Successors:\n";
38*0b57cec5SDimitry Andric   for (const BasicBlock *Successor : Successors)
39*0b57cec5SDimitry Andric     OS << *Successor << "\n";
40*0b57cec5SDimitry Andric }
41