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

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/Transforms/Utils/AddrModeMatcher.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
//===- AddrModeMatcher.h - Addressing mode matching facility ----*- 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
// AddressingModeMatcher - This class exposes a single public method, which is
 
11
// used to construct a "maximal munch" of the addressing mode for the target
 
12
// specified by TLI for an access to "V" with an access type of AccessTy.  This
 
13
// returns the addressing mode that is actually matched by value, but also
 
14
// returns the list of instructions involved in that addressing computation in
 
15
// AddrModeInsts.
 
16
//
 
17
//===----------------------------------------------------------------------===//
 
18
 
 
19
#ifndef LLVM_TRANSFORMS_UTILS_ADDRMODEMATCHER_H
 
20
#define LLVM_TRANSFORMS_UTILS_ADDRMODEMATCHER_H
 
21
 
 
22
#include "llvm/ADT/SmallVector.h"
 
23
#include "llvm/Target/TargetLowering.h"
 
24
 
 
25
namespace llvm {
 
26
 
 
27
class GlobalValue;
 
28
class Instruction;
 
29
class Value;
 
30
class Type;
 
31
class User;
 
32
class raw_ostream;
 
33
 
 
34
/// ExtAddrMode - This is an extended version of TargetLowering::AddrMode
 
35
/// which holds actual Value*'s for register values.
 
36
struct ExtAddrMode : public TargetLowering::AddrMode {
 
37
  Value *BaseReg;
 
38
  Value *ScaledReg;
 
39
  ExtAddrMode() : BaseReg(0), ScaledReg(0) {}
 
40
  void print(raw_ostream &OS) const;
 
41
  void dump() const;
 
42
};
 
43
 
 
44
static inline raw_ostream &operator<<(raw_ostream &OS, const ExtAddrMode &AM) {
 
45
  AM.print(OS);
 
46
  return OS;
 
47
}
 
48
 
 
49
class AddressingModeMatcher {
 
50
  SmallVectorImpl<Instruction*> &AddrModeInsts;
 
51
  const TargetLowering &TLI;
 
52
 
 
53
  /// AccessTy/MemoryInst - This is the type for the access (e.g. double) and
 
54
  /// the memory instruction that we're computing this address for.
 
55
  const Type *AccessTy;
 
56
  Instruction *MemoryInst;
 
57
  
 
58
  /// AddrMode - This is the addressing mode that we're building up.  This is
 
59
  /// part of the return value of this addressing mode matching stuff.
 
60
  ExtAddrMode &AddrMode;
 
61
  
 
62
  /// IgnoreProfitability - This is set to true when we should not do
 
63
  /// profitability checks.  When true, IsProfitableToFoldIntoAddressingMode
 
64
  /// always returns true.
 
65
  bool IgnoreProfitability;
 
66
  
 
67
  AddressingModeMatcher(SmallVectorImpl<Instruction*> &AMI,
 
68
                        const TargetLowering &T, const Type *AT,
 
69
                        Instruction *MI, ExtAddrMode &AM)
 
70
    : AddrModeInsts(AMI), TLI(T), AccessTy(AT), MemoryInst(MI), AddrMode(AM) {
 
71
    IgnoreProfitability = false;
 
72
  }
 
73
public:
 
74
  
 
75
  /// Match - Find the maximal addressing mode that a load/store of V can fold,
 
76
  /// give an access type of AccessTy.  This returns a list of involved
 
77
  /// instructions in AddrModeInsts.
 
78
  static ExtAddrMode Match(Value *V, const Type *AccessTy,
 
79
                           Instruction *MemoryInst,
 
80
                           SmallVectorImpl<Instruction*> &AddrModeInsts,
 
81
                           const TargetLowering &TLI) {
 
82
    ExtAddrMode Result;
 
83
 
 
84
    bool Success = 
 
85
      AddressingModeMatcher(AddrModeInsts, TLI, AccessTy,
 
86
                            MemoryInst, Result).MatchAddr(V, 0);
 
87
    Success = Success; assert(Success && "Couldn't select *anything*?");
 
88
    return Result;
 
89
  }
 
90
private:
 
91
  bool MatchScaledValue(Value *ScaleReg, int64_t Scale, unsigned Depth);
 
92
  bool MatchAddr(Value *V, unsigned Depth);
 
93
  bool MatchOperationAddr(User *Operation, unsigned Opcode, unsigned Depth);
 
94
  bool IsProfitableToFoldIntoAddressingMode(Instruction *I,
 
95
                                            ExtAddrMode &AMBefore,
 
96
                                            ExtAddrMode &AMAfter);
 
97
  bool ValueAlreadyLiveAtInst(Value *Val, Value *KnownLive1, Value *KnownLive2);
 
98
};
 
99
 
 
100
} // End llvm namespace
 
101
 
 
102
#endif