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

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/include/llvm/TypeSymbolTable.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/TypeSymbolTable.h - Implement a Type Symtab --------*- 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 implements the name/type symbol table for LLVM.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_TYPE_SYMBOL_TABLE_H
 
15
#define LLVM_TYPE_SYMBOL_TABLE_H
 
16
 
 
17
#include "llvm/Type.h"
 
18
#include "llvm/ADT/StringRef.h"
 
19
#include <map>
 
20
 
 
21
namespace llvm {
 
22
 
 
23
class StringRef;
 
24
 
 
25
/// This class provides a symbol table of name/type pairs with operations to
 
26
/// support constructing, searching and iterating over the symbol table. The
 
27
/// class derives from AbstractTypeUser so that the contents of the symbol
 
28
/// table can be updated when abstract types become concrete.
 
29
class TypeSymbolTable : public AbstractTypeUser {
 
30
 
 
31
/// @name Types
 
32
/// @{
 
33
public:
 
34
 
 
35
  /// @brief A mapping of names to types.
 
36
  typedef std::map<const std::string, const Type*> TypeMap;
 
37
 
 
38
  /// @brief An iterator over the TypeMap.
 
39
  typedef TypeMap::iterator iterator;
 
40
 
 
41
  /// @brief A const_iterator over the TypeMap.
 
42
  typedef TypeMap::const_iterator const_iterator;
 
43
 
 
44
/// @}
 
45
/// @name Constructors
 
46
/// @{
 
47
public:
 
48
 
 
49
  TypeSymbolTable():LastUnique(0) {}
 
50
  ~TypeSymbolTable();
 
51
 
 
52
/// @}
 
53
/// @name Accessors
 
54
/// @{
 
55
public:
 
56
 
 
57
  /// Generates a unique name for a type based on the \p BaseName by
 
58
  /// incrementing an integer and appending it to the name, if necessary
 
59
  /// @returns the unique name
 
60
  /// @brief Get a unique name for a type
 
61
  std::string getUniqueName(StringRef BaseName) const;
 
62
 
 
63
  /// This method finds the type with the given \p name in the type map
 
64
  /// and returns it.
 
65
  /// @returns null if the name is not found, otherwise the Type
 
66
  /// associated with the \p name.
 
67
  /// @brief Lookup a type by name.
 
68
  Type *lookup(StringRef name) const;
 
69
 
 
70
  /// Lookup the type associated with name.
 
71
  /// @returns end() if the name is not found, or an iterator at the entry for
 
72
  /// Type.
 
73
  iterator find(StringRef Name) {
 
74
    return tmap.find(Name);
 
75
  }
 
76
 
 
77
  /// Lookup the type associated with name.
 
78
  /// @returns end() if the name is not found, or an iterator at the entry for
 
79
  /// Type.
 
80
  const_iterator find(StringRef Name) const {
 
81
    return tmap.find(Name);
 
82
  }
 
83
 
 
84
  /// @returns true iff the symbol table is empty.
 
85
  /// @brief Determine if the symbol table is empty
 
86
  inline bool empty() const { return tmap.empty(); }
 
87
 
 
88
  /// @returns the size of the symbol table
 
89
  /// @brief The number of name/type pairs is returned.
 
90
  inline unsigned size() const { return unsigned(tmap.size()); }
 
91
 
 
92
  /// This function can be used from the debugger to display the
 
93
  /// content of the symbol table while debugging.
 
94
  /// @brief Print out symbol table on stderr
 
95
  void dump() const;
 
96
 
 
97
/// @}
 
98
/// @name Iteration
 
99
/// @{
 
100
public:
 
101
  /// Get an iterator to the start of the symbol table
 
102
  inline iterator begin() { return tmap.begin(); }
 
103
 
 
104
  /// @brief Get a const_iterator to the start of the symbol table
 
105
  inline const_iterator begin() const { return tmap.begin(); }
 
106
 
 
107
  /// Get an iterator to the end of the symbol table.
 
108
  inline iterator end() { return tmap.end(); }
 
109
 
 
110
  /// Get a const_iterator to the end of the symbol table.
 
111
  inline const_iterator end() const { return tmap.end(); }
 
112
 
 
113
/// @}
 
114
/// @name Mutators
 
115
/// @{
 
116
public:
 
117
 
 
118
  /// Inserts a type into the symbol table with the specified name. There can be
 
119
  /// a many-to-one mapping between names and types. This method allows a type
 
120
  /// with an existing entry in the symbol table to get a new name.
 
121
  /// @brief Insert a type under a new name.
 
122
  void insert(StringRef Name, const Type *Typ);
 
123
 
 
124
  /// Remove a type at the specified position in the symbol table.
 
125
  /// @returns the removed Type.
 
126
  /// @returns the Type that was erased from the symbol table.
 
127
  Type* remove(iterator TI);
 
128
 
 
129
/// @}
 
130
/// @name AbstractTypeUser Methods
 
131
/// @{
 
132
private:
 
133
  /// This function is called when one of the types in the type plane
 
134
  /// is refined.
 
135
  virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
 
136
 
 
137
  /// This function markes a type as being concrete (defined).
 
138
  virtual void typeBecameConcrete(const DerivedType *AbsTy);
 
139
 
 
140
/// @}
 
141
/// @name Internal Data
 
142
/// @{
 
143
private:
 
144
  TypeMap tmap; ///< This is the mapping of names to types.
 
145
  mutable uint32_t LastUnique; ///< Counter for tracking unique names
 
146
 
 
147
/// @}
 
148
 
 
149
};
 
150
 
 
151
} // End llvm namespace
 
152
 
 
153
#endif