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

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/CodeGen/MachineConstantPool.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
//===-- CodeGen/MachineConstantPool.h - Abstract Constant Pool --*- 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
/// @file
 
11
/// This file declares the MachineConstantPool class which is an abstract
 
12
/// constant pool to keep track of constants referenced by a function.
 
13
//
 
14
//===----------------------------------------------------------------------===//
 
15
 
 
16
#ifndef LLVM_CODEGEN_MACHINECONSTANTPOOL_H
 
17
#define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
 
18
 
 
19
#include <cassert>
 
20
#include <climits>
 
21
#include <vector>
 
22
 
 
23
namespace llvm {
 
24
 
 
25
class Constant;
 
26
class FoldingSetNodeID;
 
27
class TargetData;
 
28
class TargetMachine;
 
29
class Type;
 
30
class MachineConstantPool;
 
31
class raw_ostream;
 
32
 
 
33
/// Abstract base class for all machine specific constantpool value subclasses.
 
34
///
 
35
class MachineConstantPoolValue {
 
36
  const Type *Ty;
 
37
 
 
38
public:
 
39
  explicit MachineConstantPoolValue(const Type *ty) : Ty(ty) {}
 
40
  virtual ~MachineConstantPoolValue() {}
 
41
 
 
42
  /// getType - get type of this MachineConstantPoolValue.
 
43
  ///
 
44
  const Type *getType() const { return Ty; }
 
45
 
 
46
  
 
47
  /// getRelocationInfo - This method classifies the entry according to
 
48
  /// whether or not it may generate a relocation entry.  This must be
 
49
  /// conservative, so if it might codegen to a relocatable entry, it should say
 
50
  /// so.  The return values are the same as Constant::getRelocationInfo().
 
51
  virtual unsigned getRelocationInfo() const = 0;
 
52
  
 
53
  virtual int getExistingMachineCPValue(MachineConstantPool *CP,
 
54
                                        unsigned Alignment) = 0;
 
55
 
 
56
  virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID) = 0;
 
57
 
 
58
  /// print - Implement operator<<
 
59
  virtual void print(raw_ostream &O) const = 0;
 
60
};
 
61
 
 
62
inline raw_ostream &operator<<(raw_ostream &OS,
 
63
                               const MachineConstantPoolValue &V) {
 
64
  V.print(OS);
 
65
  return OS;
 
66
}
 
67
  
 
68
 
 
69
/// This class is a data container for one entry in a MachineConstantPool.
 
70
/// It contains a pointer to the value and an offset from the start of
 
71
/// the constant pool.
 
72
/// @brief An entry in a MachineConstantPool
 
73
class MachineConstantPoolEntry {
 
74
public:
 
75
  /// The constant itself.
 
76
  union {
 
77
    const Constant *ConstVal;
 
78
    MachineConstantPoolValue *MachineCPVal;
 
79
  } Val;
 
80
 
 
81
  /// The required alignment for this entry. The top bit is set when Val is
 
82
  /// a MachineConstantPoolValue.
 
83
  unsigned Alignment;
 
84
 
 
85
  MachineConstantPoolEntry(const Constant *V, unsigned A)
 
86
    : Alignment(A) {
 
87
    Val.ConstVal = V;
 
88
  }
 
89
  MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A)
 
90
    : Alignment(A) {
 
91
    Val.MachineCPVal = V; 
 
92
    Alignment |= 1U << (sizeof(unsigned)*CHAR_BIT-1);
 
93
  }
 
94
 
 
95
  bool isMachineConstantPoolEntry() const {
 
96
    return (int)Alignment < 0;
 
97
  }
 
98
 
 
99
  int getAlignment() const { 
 
100
    return Alignment & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
 
101
  }
 
102
 
 
103
  const Type *getType() const;
 
104
  
 
105
  /// getRelocationInfo - This method classifies the entry according to
 
106
  /// whether or not it may generate a relocation entry.  This must be
 
107
  /// conservative, so if it might codegen to a relocatable entry, it should say
 
108
  /// so.  The return values are:
 
109
  /// 
 
110
  ///  0: This constant pool entry is guaranteed to never have a relocation
 
111
  ///     applied to it (because it holds a simple constant like '4').
 
112
  ///  1: This entry has relocations, but the entries are guaranteed to be
 
113
  ///     resolvable by the static linker, so the dynamic linker will never see
 
114
  ///     them.
 
115
  ///  2: This entry may have arbitrary relocations. 
 
116
  unsigned getRelocationInfo() const;
 
117
};
 
118
  
 
119
/// The MachineConstantPool class keeps track of constants referenced by a
 
120
/// function which must be spilled to memory.  This is used for constants which
 
121
/// are unable to be used directly as operands to instructions, which typically
 
122
/// include floating point and large integer constants.
 
123
///
 
124
/// Instructions reference the address of these constant pool constants through
 
125
/// the use of MO_ConstantPoolIndex values.  When emitting assembly or machine
 
126
/// code, these virtual address references are converted to refer to the
 
127
/// address of the function constant pool values.
 
128
/// @brief The machine constant pool.
 
129
class MachineConstantPool {
 
130
  const TargetData *TD;   ///< The machine's TargetData.
 
131
  unsigned PoolAlignment; ///< The alignment for the pool.
 
132
  std::vector<MachineConstantPoolEntry> Constants; ///< The pool of constants.
 
133
public:
 
134
  /// @brief The only constructor.
 
135
  explicit MachineConstantPool(const TargetData *td)
 
136
    : TD(td), PoolAlignment(1) {}
 
137
  ~MachineConstantPool();
 
138
    
 
139
  /// getConstantPoolAlignment - Return the alignment required by
 
140
  /// the whole constant pool, of which the first element must be aligned.
 
141
  unsigned getConstantPoolAlignment() const { return PoolAlignment; }
 
142
  
 
143
  /// getConstantPoolIndex - Create a new entry in the constant pool or return
 
144
  /// an existing one.  User must specify the minimum required alignment for
 
145
  /// the object.
 
146
  unsigned getConstantPoolIndex(const Constant *C, unsigned Alignment);
 
147
  unsigned getConstantPoolIndex(MachineConstantPoolValue *V,unsigned Alignment);
 
148
  
 
149
  /// isEmpty - Return true if this constant pool contains no constants.
 
150
  bool isEmpty() const { return Constants.empty(); }
 
151
 
 
152
  const std::vector<MachineConstantPoolEntry> &getConstants() const {
 
153
    return Constants;
 
154
  }
 
155
 
 
156
  /// print - Used by the MachineFunction printer to print information about
 
157
  /// constant pool objects.  Implemented in MachineFunction.cpp
 
158
  ///
 
159
  void print(raw_ostream &OS) const;
 
160
 
 
161
  /// dump - Call print(cerr) to be called from the debugger.
 
162
  void dump() const;
 
163
};
 
164
 
 
165
} // End llvm namespace
 
166
 
 
167
#endif