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/Support/raw_ostream.h"
17*0b57cec5SDimitry Andric 
18*0b57cec5SDimitry Andric using namespace llvm;
19*0b57cec5SDimitry Andric 
20*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
21*0b57cec5SDimitry Andric // Interval Implementation
22*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===//
23*0b57cec5SDimitry Andric 
print(raw_ostream & OS) const24*0b57cec5SDimitry Andric void Interval::print(raw_ostream &OS) const {
25*0b57cec5SDimitry Andric   OS << "-------------------------------------------------------------\n"
26*0b57cec5SDimitry Andric        << "Interval Contents:\n";
27*0b57cec5SDimitry Andric 
28*0b57cec5SDimitry Andric   // Print out all of the basic blocks in the interval...
29*0b57cec5SDimitry Andric   for (const BasicBlock *Node : Nodes)
30*0b57cec5SDimitry Andric     OS << *Node << "\n";
31*0b57cec5SDimitry Andric 
32*0b57cec5SDimitry Andric   OS << "Interval Predecessors:\n";
33*0b57cec5SDimitry Andric   for (const BasicBlock *Predecessor : Predecessors)
34*0b57cec5SDimitry Andric     OS << *Predecessor << "\n";
35*0b57cec5SDimitry Andric 
36*0b57cec5SDimitry Andric   OS << "Interval Successors:\n";
37*0b57cec5SDimitry Andric   for (const BasicBlock *Successor : Successors)
38*0b57cec5SDimitry Andric     OS << *Successor << "\n";
39*0b57cec5SDimitry Andric }
40*0b57cec5SDimitry Andric