~ubuntu-branches/ubuntu/wily/clamav/wily-proposed

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/CodeGen/MachineDominators.h

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman, Sebastian Andrzej Siewior, Andreas Cadhalpun, Scott Kitterman, Javier Fernández-Sanguino
  • Date: 2015-01-28 00:25:13 UTC
  • mfrom: (0.48.14 sid)
  • Revision ID: package-import@ubuntu.com-20150128002513-lil2oi74cooy4lzr
Tags: 0.98.6+dfsg-1
[ Sebastian Andrzej Siewior ]
* update "fix-ssize_t-size_t-off_t-printf-modifier", include of misc.h was
  missing but was pulled in via the systemd patch.
* Don't leak return codes from libmspack to clamav API. (Closes: #774686).

[ Andreas Cadhalpun ]
* Add patch to avoid emitting incremental progress messages when not
  outputting to a terminal. (Closes: #767350)
* Update lintian-overrides for unused-file-paragraph-in-dep5-copyright.
* clamav-base.postinst: always chown /var/log/clamav and /var/lib/clamav
  to clamav:clamav, not only on fresh installations. (Closes: #775400)
* Adapt the clamav-daemon and clamav-freshclam logrotate scripts,
  so that they correctly work under systemd.
* Move the PidFile variable from the clamd/freshclam configuration files
  to the init scripts. This makes the init scripts more robust against
  misconfiguration and avoids error messages with systemd. (Closes: #767353)
* debian/copyright: drop files from Files-Excluded only present in github
  tarballs
* Drop Workaround-a-bug-in-libc-on-Hurd.patch, because hurd got fixed.
  (see #752237)
* debian/rules: Remove useless --with-system-tommath --without-included-ltdl
  configure options.

[ Scott Kitterman ]
* Stop stripping llvm when repacking the tarball as the system llvm on some
  releases is too old to use
* New upstream bugfix release
  - Library shared object revisions.
  - Includes a patch from Sebastian Andrzej Siewior making ClamAV pid files
    compatible with systemd.
  - Fix a heap out of bounds condition with crafted Yoda's crypter files.
    This issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted mew packer files. This
    issue was discovered by Felix Groebert of the Google Security Team.
  - Fix a heap out of bounds condition with crafted upx packer files. This
    issue was discovered by Kevin Szkudlapski of Quarkslab.
  - Fix a heap out of bounds condition with crafted upack packer files. This
    issue was discovered by Sebastian Andrzej Siewior. CVE-2014-9328.
  - Compensate a crash due to incorrect compiler optimization when handling
    crafted petite packer files. This issue was discovered by Sebastian
    Andrzej Siewior.
* Update lintian override for embedded zlib to match new so version

[ Javier Fernández-Sanguino ]
* Updated Spanish Debconf template translation (Closes: #773563)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//=- llvm/CodeGen/MachineDominators.h - Machine Dom 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 defines classes mirroring those in llvm/Analysis/Dominators.h,
 
11
// but for target-specific code rather than target-independent IR.
 
12
//
 
13
//===----------------------------------------------------------------------===//
 
14
 
 
15
#ifndef LLVM_CODEGEN_MACHINEDOMINATORS_H
 
16
#define LLVM_CODEGEN_MACHINEDOMINATORS_H
 
17
 
 
18
#include "llvm/CodeGen/MachineBasicBlock.h"
 
19
#include "llvm/CodeGen/MachineFunction.h"
 
20
#include "llvm/CodeGen/MachineFunctionPass.h"
 
21
#include "llvm/Analysis/Dominators.h"
 
22
#include "llvm/Analysis/DominatorInternals.h"
 
23
 
 
24
namespace llvm {
 
25
 
 
26
template<>
 
27
inline void DominatorTreeBase<MachineBasicBlock>::addRoot(MachineBasicBlock* MBB) {
 
28
  this->Roots.push_back(MBB);
 
29
}
 
30
 
 
31
EXTERN_TEMPLATE_INSTANTIATION(class DomTreeNodeBase<MachineBasicBlock>);
 
32
EXTERN_TEMPLATE_INSTANTIATION(class DominatorTreeBase<MachineBasicBlock>);
 
33
 
 
34
typedef DomTreeNodeBase<MachineBasicBlock> MachineDomTreeNode;
 
35
 
 
36
//===-------------------------------------
 
37
/// DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to
 
38
/// compute a normal dominator tree.
 
39
///
 
40
class MachineDominatorTree : public MachineFunctionPass {
 
41
public:
 
42
  static char ID; // Pass ID, replacement for typeid
 
43
  DominatorTreeBase<MachineBasicBlock>* DT;
 
44
  
 
45
  MachineDominatorTree();
 
46
  
 
47
  ~MachineDominatorTree();
 
48
  
 
49
  DominatorTreeBase<MachineBasicBlock>& getBase() { return *DT; }
 
50
  
 
51
  virtual void getAnalysisUsage(AnalysisUsage &AU) const;
 
52
  
 
53
  /// getRoots -  Return the root blocks of the current CFG.  This may include
 
54
  /// multiple blocks if we are computing post dominators.  For forward
 
55
  /// dominators, this will always be a single block (the entry node).
 
56
  ///
 
57
  inline const std::vector<MachineBasicBlock*> &getRoots() const {
 
58
    return DT->getRoots();
 
59
  }
 
60
  
 
61
  inline MachineBasicBlock *getRoot() const {
 
62
    return DT->getRoot();
 
63
  }
 
64
  
 
65
  inline MachineDomTreeNode *getRootNode() const {
 
66
    return DT->getRootNode();
 
67
  }
 
68
  
 
69
  virtual bool runOnMachineFunction(MachineFunction &F);
 
70
  
 
71
  inline bool dominates(MachineDomTreeNode* A, MachineDomTreeNode* B) const {
 
72
    return DT->dominates(A, B);
 
73
  }
 
74
  
 
75
  inline bool dominates(MachineBasicBlock* A, MachineBasicBlock* B) const {
 
76
    return DT->dominates(A, B);
 
77
  }
 
78
  
 
79
  // dominates - Return true if A dominates B. This performs the
 
80
  // special checks necessary if A and B are in the same basic block.
 
81
  bool dominates(MachineInstr *A, MachineInstr *B) const {
 
82
    MachineBasicBlock *BBA = A->getParent(), *BBB = B->getParent();
 
83
    if (BBA != BBB) return DT->dominates(BBA, BBB);
 
84
 
 
85
    // Loop through the basic block until we find A or B.
 
86
    MachineBasicBlock::iterator I = BBA->begin();
 
87
    for (; &*I != A && &*I != B; ++I) /*empty*/;
 
88
 
 
89
    //if(!DT.IsPostDominators) {
 
90
      // A dominates B if it is found first in the basic block.
 
91
      return &*I == A;
 
92
    //} else {
 
93
    //  // A post-dominates B if B is found first in the basic block.
 
94
    //  return &*I == B;
 
95
    //}
 
96
  }
 
97
  
 
98
  inline bool properlyDominates(const MachineDomTreeNode* A,
 
99
                                MachineDomTreeNode* B) const {
 
100
    return DT->properlyDominates(A, B);
 
101
  }
 
102
  
 
103
  inline bool properlyDominates(MachineBasicBlock* A,
 
104
                                MachineBasicBlock* B) const {
 
105
    return DT->properlyDominates(A, B);
 
106
  }
 
107
  
 
108
  /// findNearestCommonDominator - Find nearest common dominator basic block
 
109
  /// for basic block A and B. If there is no such block then return NULL.
 
110
  inline MachineBasicBlock *findNearestCommonDominator(MachineBasicBlock *A,
 
111
                                                       MachineBasicBlock *B) {
 
112
    return DT->findNearestCommonDominator(A, B);
 
113
  }
 
114
  
 
115
  inline MachineDomTreeNode *operator[](MachineBasicBlock *BB) const {
 
116
    return DT->getNode(BB);
 
117
  }
 
118
  
 
119
  /// getNode - return the (Post)DominatorTree node for the specified basic
 
120
  /// block.  This is the same as using operator[] on this class.
 
121
  ///
 
122
  inline MachineDomTreeNode *getNode(MachineBasicBlock *BB) const {
 
123
    return DT->getNode(BB);
 
124
  }
 
125
  
 
126
  /// addNewBlock - Add a new node to the dominator tree information.  This
 
127
  /// creates a new node as a child of DomBB dominator node,linking it into 
 
128
  /// the children list of the immediate dominator.
 
129
  inline MachineDomTreeNode *addNewBlock(MachineBasicBlock *BB,
 
130
                                         MachineBasicBlock *DomBB) {
 
131
    return DT->addNewBlock(BB, DomBB);
 
132
  }
 
133
  
 
134
  /// changeImmediateDominator - This method is used to update the dominator
 
135
  /// tree information when a node's immediate dominator changes.
 
136
  ///
 
137
  inline void changeImmediateDominator(MachineBasicBlock *N,
 
138
                                       MachineBasicBlock* NewIDom) {
 
139
    DT->changeImmediateDominator(N, NewIDom);
 
140
  }
 
141
  
 
142
  inline void changeImmediateDominator(MachineDomTreeNode *N,
 
143
                                       MachineDomTreeNode* NewIDom) {
 
144
    DT->changeImmediateDominator(N, NewIDom);
 
145
  }
 
146
  
 
147
  /// eraseNode - Removes a node from  the dominator tree. Block must not
 
148
  /// domiante any other blocks. Removes node from its immediate dominator's
 
149
  /// children list. Deletes dominator node associated with basic block BB.
 
150
  inline void eraseNode(MachineBasicBlock *BB) {
 
151
    DT->eraseNode(BB);
 
152
  }
 
153
  
 
154
  /// splitBlock - BB is split and now it has one successor. Update dominator
 
155
  /// tree to reflect this change.
 
156
  inline void splitBlock(MachineBasicBlock* NewBB) {
 
157
    DT->splitBlock(NewBB);
 
158
  }
 
159
 
 
160
  /// isReachableFromEntry - Return true if A is dominated by the entry
 
161
  /// block of the function containing it.
 
162
  bool isReachableFromEntry(MachineBasicBlock *A) {
 
163
    return DT->isReachableFromEntry(A);
 
164
  }
 
165
 
 
166
  virtual void releaseMemory();
 
167
  
 
168
  virtual void print(raw_ostream &OS, const Module*) const;
 
169
};
 
170
 
 
171
//===-------------------------------------
 
172
/// DominatorTree GraphTraits specialization so the DominatorTree can be
 
173
/// iterable by generic graph iterators.
 
174
///
 
175
 
 
176
template<class T> struct GraphTraits;
 
177
 
 
178
template <> struct GraphTraits<MachineDomTreeNode *> {
 
179
  typedef MachineDomTreeNode NodeType;
 
180
  typedef NodeType::iterator  ChildIteratorType;
 
181
  
 
182
  static NodeType *getEntryNode(NodeType *N) {
 
183
    return N;
 
184
  }
 
185
  static inline ChildIteratorType child_begin(NodeType* N) {
 
186
    return N->begin();
 
187
  }
 
188
  static inline ChildIteratorType child_end(NodeType* N) {
 
189
    return N->end();
 
190
  }
 
191
};
 
192
 
 
193
template <> struct GraphTraits<MachineDominatorTree*>
 
194
  : public GraphTraits<MachineDomTreeNode *> {
 
195
  static NodeType *getEntryNode(MachineDominatorTree *DT) {
 
196
    return DT->getRootNode();
 
197
  }
 
198
};
 
199
 
 
200
}
 
201
 
 
202
#endif