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

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/CodeGen/MachineJumpTableInfo.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/MachineJumpTableInfo.h - Abstract Jump Tables  --*- 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
// The MachineJumpTableInfo class keeps track of jump tables referenced by
 
11
// lowered switch instructions in the MachineFunction.
 
12
//
 
13
// Instructions reference the address of these jump tables through the use of 
 
14
// MO_JumpTableIndex values.  When emitting assembly or machine code, these 
 
15
// virtual address references are converted to refer to the address of the 
 
16
// function jump tables.
 
17
//
 
18
//===----------------------------------------------------------------------===//
 
19
 
 
20
#ifndef LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
 
21
#define LLVM_CODEGEN_MACHINEJUMPTABLEINFO_H
 
22
 
 
23
#include <vector>
 
24
#include <cassert>
 
25
 
 
26
namespace llvm {
 
27
 
 
28
class MachineBasicBlock;
 
29
class TargetData;
 
30
class raw_ostream;
 
31
 
 
32
/// MachineJumpTableEntry - One jump table in the jump table info.
 
33
///
 
34
struct MachineJumpTableEntry {
 
35
  /// MBBs - The vector of basic blocks from which to create the jump table.
 
36
  std::vector<MachineBasicBlock*> MBBs;
 
37
  
 
38
  explicit MachineJumpTableEntry(const std::vector<MachineBasicBlock*> &M)
 
39
  : MBBs(M) {}
 
40
};
 
41
  
 
42
class MachineJumpTableInfo {
 
43
public:
 
44
  /// JTEntryKind - This enum indicates how each entry of the jump table is
 
45
  /// represented and emitted.
 
46
  enum JTEntryKind {
 
47
    /// EK_BlockAddress - Each entry is a plain address of block, e.g.:
 
48
    ///     .word LBB123
 
49
    EK_BlockAddress,
 
50
    
 
51
    /// EK_GPRel32BlockAddress - Each entry is an address of block, encoded
 
52
    /// with a relocation as gp-relative, e.g.:
 
53
    ///     .gprel32 LBB123
 
54
    EK_GPRel32BlockAddress,
 
55
    
 
56
    /// EK_LabelDifference32 - Each entry is the address of the block minus
 
57
    /// the address of the jump table.  This is used for PIC jump tables where
 
58
    /// gprel32 is not supported.  e.g.:
 
59
    ///      .word LBB123 - LJTI1_2
 
60
    /// If the .set directive is supported, this is emitted as:
 
61
    ///      .set L4_5_set_123, LBB123 - LJTI1_2
 
62
    ///      .word L4_5_set_123
 
63
    EK_LabelDifference32,
 
64
 
 
65
    /// EK_Inline - Jump table entries are emitted inline at their point of
 
66
    /// use. It is the responsibility of the target to emit the entries.
 
67
    EK_Inline,
 
68
 
 
69
    /// EK_Custom32 - Each entry is a 32-bit value that is custom lowered by the
 
70
    /// TargetLowering::LowerCustomJumpTableEntry hook.
 
71
    EK_Custom32
 
72
  };
 
73
private:
 
74
  JTEntryKind EntryKind;
 
75
  std::vector<MachineJumpTableEntry> JumpTables;
 
76
public:
 
77
  explicit MachineJumpTableInfo(JTEntryKind Kind): EntryKind(Kind) {}
 
78
    
 
79
  JTEntryKind getEntryKind() const { return EntryKind; }
 
80
 
 
81
  /// getEntrySize - Return the size of each entry in the jump table.
 
82
  unsigned getEntrySize(const TargetData &TD) const;
 
83
  /// getEntryAlignment - Return the alignment of each entry in the jump table.
 
84
  unsigned getEntryAlignment(const TargetData &TD) const;
 
85
  
 
86
  /// createJumpTableIndex - Create a new jump table.
 
87
  ///
 
88
  unsigned createJumpTableIndex(const std::vector<MachineBasicBlock*> &DestBBs);
 
89
  
 
90
  /// isEmpty - Return true if there are no jump tables.
 
91
  ///
 
92
  bool isEmpty() const { return JumpTables.empty(); }
 
93
 
 
94
  const std::vector<MachineJumpTableEntry> &getJumpTables() const {
 
95
    return JumpTables;
 
96
  }
 
97
 
 
98
  /// RemoveJumpTable - Mark the specific index as being dead.  This will
 
99
  /// prevent it from being emitted.
 
100
  void RemoveJumpTable(unsigned Idx) {
 
101
    JumpTables[Idx].MBBs.clear();
 
102
  }
 
103
  
 
104
  /// ReplaceMBBInJumpTables - If Old is the target of any jump tables, update
 
105
  /// the jump tables to branch to New instead.
 
106
  bool ReplaceMBBInJumpTables(MachineBasicBlock *Old, MachineBasicBlock *New);
 
107
 
 
108
  /// ReplaceMBBInJumpTable - If Old is a target of the jump tables, update
 
109
  /// the jump table to branch to New instead.
 
110
  bool ReplaceMBBInJumpTable(unsigned Idx, MachineBasicBlock *Old,
 
111
                             MachineBasicBlock *New);
 
112
 
 
113
  /// print - Used by the MachineFunction printer to print information about
 
114
  /// jump tables.  Implemented in MachineFunction.cpp
 
115
  ///
 
116
  void print(raw_ostream &OS) const;
 
117
 
 
118
  /// dump - Call to stderr.
 
119
  ///
 
120
  void dump() const;
 
121
};
 
122
 
 
123
} // End llvm namespace
 
124
 
 
125
#endif