~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/Analysis/PostDominators.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=- llvm/Analysis/PostDominators.h - Post Dominator Calculation-*- 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 exposes interfaces to post dominance information.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_ANALYSIS_POST_DOMINATORS_H
 
15
#define LLVM_ANALYSIS_POST_DOMINATORS_H
 
16
 
 
17
#include "llvm/Analysis/Dominators.h"
 
18
 
 
19
namespace llvm {
 
20
 
 
21
/// PostDominatorTree Class - Concrete subclass of DominatorTree that is used to
 
22
/// compute the a post-dominator tree.
 
23
///
 
24
struct PostDominatorTree : public FunctionPass {
 
25
  static char ID; // Pass identification, replacement for typeid
 
26
  DominatorTreeBase<BasicBlock>* DT;
 
27
 
 
28
  PostDominatorTree() : FunctionPass(&ID) {
 
29
    DT = new DominatorTreeBase<BasicBlock>(true);
 
30
  }
 
31
 
 
32
  ~PostDominatorTree();
 
33
 
 
34
  virtual bool runOnFunction(Function &F);
 
35
 
 
36
  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
 
37
    AU.setPreservesAll();
 
38
  }
 
39
 
 
40
  inline const std::vector<BasicBlock*> &getRoots() const {
 
41
    return DT->getRoots();
 
42
  }
 
43
 
 
44
  inline DomTreeNode *getRootNode() const {
 
45
    return DT->getRootNode();
 
46
  }
 
47
 
 
48
  inline DomTreeNode *operator[](BasicBlock *BB) const {
 
49
    return DT->getNode(BB);
 
50
  }
 
51
 
 
52
  inline DomTreeNode *getNode(BasicBlock *BB) const {
 
53
    return DT->getNode(BB);
 
54
  }
 
55
 
 
56
  inline bool dominates(DomTreeNode* A, DomTreeNode* B) const {
 
57
    return DT->dominates(A, B);
 
58
  }
 
59
 
 
60
  inline bool dominates(const BasicBlock* A, const BasicBlock* B) const {
 
61
    return DT->dominates(A, B);
 
62
  }
 
63
 
 
64
  inline bool properlyDominates(const DomTreeNode* A, DomTreeNode* B) const {
 
65
    return DT->properlyDominates(A, B);
 
66
  }
 
67
 
 
68
  inline bool properlyDominates(BasicBlock* A, BasicBlock* B) const {
 
69
    return DT->properlyDominates(A, B);
 
70
  }
 
71
 
 
72
  virtual void releaseMemory() {
 
73
    DT->releaseMemory();
 
74
  }
 
75
 
 
76
  virtual void print(raw_ostream &OS, const Module*) const;
 
77
};
 
78
 
 
79
FunctionPass* createPostDomTree();
 
80
 
 
81
template <> struct GraphTraits<PostDominatorTree*>
 
82
  : public GraphTraits<DomTreeNode*> {
 
83
  static NodeType *getEntryNode(PostDominatorTree *DT) {
 
84
    return DT->getRootNode();
 
85
  }
 
86
 
 
87
  static nodes_iterator nodes_begin(PostDominatorTree *N) {
 
88
    if (getEntryNode(N))
 
89
      return df_begin(getEntryNode(N));
 
90
    else
 
91
      return df_end(getEntryNode(N));
 
92
  }
 
93
 
 
94
  static nodes_iterator nodes_end(PostDominatorTree *N) {
 
95
    return df_end(getEntryNode(N));
 
96
  }
 
97
};
 
98
 
 
99
/// PostDominanceFrontier Class - Concrete subclass of DominanceFrontier that is
 
100
/// used to compute the a post-dominance frontier.
 
101
///
 
102
struct PostDominanceFrontier : public DominanceFrontierBase {
 
103
  static char ID;
 
104
  PostDominanceFrontier()
 
105
    : DominanceFrontierBase(&ID, true) {}
 
106
 
 
107
  virtual bool runOnFunction(Function &) {
 
108
    Frontiers.clear();
 
109
    PostDominatorTree &DT = getAnalysis<PostDominatorTree>();
 
110
    Roots = DT.getRoots();
 
111
    if (const DomTreeNode *Root = DT.getRootNode())
 
112
      calculate(DT, Root);
 
113
    return false;
 
114
  }
 
115
 
 
116
  virtual void getAnalysisUsage(AnalysisUsage &AU) const {
 
117
    AU.setPreservesAll();
 
118
    AU.addRequired<PostDominatorTree>();
 
119
  }
 
120
 
 
121
private:
 
122
  const DomSetType &calculate(const PostDominatorTree &DT,
 
123
                              const DomTreeNode *Node);
 
124
};
 
125
 
 
126
FunctionPass* createPostDomFrontier();
 
127
 
 
128
} // End llvm namespace
 
129
 
 
130
#endif