Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Analysis/Interval.cpp
Line
Count
Source (jump to first uncovered line)
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
14
#include "llvm/Analysis/Interval.h"
15
#include "llvm/IR/BasicBlock.h"
16
#include "llvm/IR/CFG.h"
17
#include "llvm/Support/raw_ostream.h"
18
19
using namespace llvm;
20
21
//===----------------------------------------------------------------------===//
22
// Interval Implementation
23
//===----------------------------------------------------------------------===//
24
25
// isLoop - Find out if there is a back edge in this interval...
26
0
bool Interval::isLoop() const {
27
0
  // There is a loop in this interval iff one of the predecessors of the header
28
0
  // node lives in the interval.
29
0
  for (::pred_iterator I = ::pred_begin(HeaderNode), E = ::pred_end(HeaderNode);
30
0
       I != E; ++I)
31
0
    if (contains(*I))
32
0
      return true;
33
0
  return false;
34
0
}
35
36
0
void Interval::print(raw_ostream &OS) const {
37
0
  OS << "-------------------------------------------------------------\n"
38
0
       << "Interval Contents:\n";
39
0
40
0
  // Print out all of the basic blocks in the interval...
41
0
  for (const BasicBlock *Node : Nodes)
42
0
    OS << *Node << "\n";
43
0
44
0
  OS << "Interval Predecessors:\n";
45
0
  for (const BasicBlock *Predecessor : Predecessors)
46
0
    OS << *Predecessor << "\n";
47
0
48
0
  OS << "Interval Successors:\n";
49
0
  for (const BasicBlock *Successor : Successors)
50
0
    OS << *Successor << "\n";
51
0
}