Interval.cpp 1.4 KB

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