Coverage Report

Created: 2017-04-29 12:21

/Users/buildslave/jenkins/sharedspace/clang-stage2-coverage-R@2/llvm/tools/polly/include/polly/ScopPass.h
Line
Count
Source
1
//===--------- ScopPass.h - Pass for Static Control Parts --------*-C++ -*-===//
2
//
3
//                     The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
//
10
// This file defines the ScopPass class.  ScopPasses are just RegionPasses,
11
// except they operate on Polly IR (Scop and ScopStmt) built by ScopInfo Pass.
12
// Because they operate on Polly IR, not the LLVM IR, ScopPasses are not allowed
13
// to modify the LLVM IR. Due to this limitation, the ScopPass class takes
14
// care of declaring that no LLVM passes are invalidated.
15
//
16
//===----------------------------------------------------------------------===//
17
18
#ifndef POLLY_SCOP_PASS_H
19
#define POLLY_SCOP_PASS_H
20
21
#include "llvm/Analysis/RegionPass.h"
22
23
using namespace llvm;
24
25
namespace polly {
26
class Scop;
27
28
/// ScopPass - This class adapts the RegionPass interface to allow convenient
29
/// creation of passes that operate on the Polly IR. Instead of overriding
30
/// runOnRegion, subclasses override runOnScop.
31
class ScopPass : public RegionPass {
32
  Scop *S;
33
34
protected:
35
1.31k
  explicit ScopPass(char &ID) : RegionPass(ID), S(0) {}
36
37
  /// runOnScop - This method must be overloaded to perform the
38
  /// desired Polyhedral transformation or analysis.
39
  ///
40
  virtual bool runOnScop(Scop &S) = 0;
41
42
  /// Print method for SCoPs.
43
27
  virtual void printScop(raw_ostream &OS, Scop &S) const {}
44
45
  /// getAnalysisUsage - Subclasses that override getAnalysisUsage
46
  /// must call this.
47
  ///
48
  virtual void getAnalysisUsage(AnalysisUsage &AU) const override;
49
50
private:
51
  bool runOnRegion(Region *R, RGPassManager &RGM) override;
52
  void print(raw_ostream &OS, const Module *) const override;
53
};
54
55
} // namespace polly
56
57
#endif