~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/Target/ARM/ARMConstantPoolValue.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-03-12 11:30:04 UTC
  • mfrom: (0.41.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312113004-b0fop4bkycszdd0z
Tags: 0.96~rc1+dfsg-0ubuntu1
* New upstream RC - FFE (LP: #537636):
  - Add OfficialDatabaseOnly option to clamav-base.postinst.in
  - Add LocalSocketGroup option to clamav-base.postinst.in
  - Add LocalSocketMode option to clamav-base.postinst.in
  - Add CrossFilesystems option to clamav-base.postinst.in
  - Add ClamukoScannerCount option to clamav-base.postinst.in
  - Add BytecodeSecurity opiton to clamav-base.postinst.in
  - Add DetectionStatsHostID option to clamav-freshclam.postinst.in
  - Add Bytecode option to clamav-freshclam.postinst.in
  - Add MilterSocketGroup option to clamav-milter.postinst.in
  - Add MilterSocketMode option to clamav-milter.postinst.in
  - Add ReportHostname option to clamav-milter.postinst.in
  - Bump libclamav SO version to 6.1.0 in libclamav6.install
  - Drop clamdmon from clamav.examples (no longer shipped by upstream)
  - Drop libclamav.a from libclamav-dev.install (not built by upstream)
  - Update SO version for lintian override for libclamav6
  - Add new Bytecode Testing Tool, usr/bin/clambc, to clamav.install
  - Add build-depends on python and python-setuptools for new test suite
  - Update debian/copyright for the embedded copy of llvm (using the system
    llvm is not currently feasible)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===- ARMConstantPoolValue.h - ARM constantpool value ----------*- 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 ARM specific constantpool value class.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef LLVM_TARGET_ARM_CONSTANTPOOLVALUE_H
 
15
#define LLVM_TARGET_ARM_CONSTANTPOOLVALUE_H
 
16
 
 
17
#include "llvm/CodeGen/MachineConstantPool.h"
 
18
 
 
19
namespace llvm {
 
20
 
 
21
class Constant;
 
22
class BlockAddress;
 
23
class GlobalValue;
 
24
class LLVMContext;
 
25
 
 
26
namespace ARMCP {
 
27
  enum ARMCPKind {
 
28
    CPValue,
 
29
    CPExtSymbol,
 
30
    CPBlockAddress,
 
31
    CPLSDA
 
32
  };
 
33
}
 
34
 
 
35
/// ARMConstantPoolValue - ARM specific constantpool value. This is used to
 
36
/// represent PC-relative displacement between the address of the load
 
37
/// instruction and the constant being loaded, i.e. (&GV-(LPIC+8)).
 
38
class ARMConstantPoolValue : public MachineConstantPoolValue {
 
39
  Constant *CVal;          // Constant being loaded.
 
40
  const char *S;           // ExtSymbol being loaded.
 
41
  unsigned LabelId;        // Label id of the load.
 
42
  ARMCP::ARMCPKind Kind;   // Kind of constant.
 
43
  unsigned char PCAdjust;  // Extra adjustment if constantpool is pc-relative.
 
44
                           // 8 for ARM, 4 for Thumb.
 
45
  const char *Modifier;    // GV modifier i.e. (&GV(modifier)-(LPIC+8))
 
46
  bool AddCurrentAddress;
 
47
 
 
48
public:
 
49
  ARMConstantPoolValue(Constant *cval, unsigned id,
 
50
                       ARMCP::ARMCPKind Kind = ARMCP::CPValue,
 
51
                       unsigned char PCAdj = 0, const char *Modifier = NULL,
 
52
                       bool AddCurrentAddress = false);
 
53
  ARMConstantPoolValue(LLVMContext &C, const char *s, unsigned id,
 
54
                       unsigned char PCAdj = 0, const char *Modifier = NULL,
 
55
                       bool AddCurrentAddress = false);
 
56
  ARMConstantPoolValue(GlobalValue *GV, const char *Modifier);
 
57
  ARMConstantPoolValue();
 
58
  ~ARMConstantPoolValue();
 
59
 
 
60
  GlobalValue *getGV() const;
 
61
  const char *getSymbol() const { return S; }
 
62
  BlockAddress *getBlockAddress() const;
 
63
  const char *getModifier() const { return Modifier; }
 
64
  bool hasModifier() const { return Modifier != NULL; }
 
65
  bool mustAddCurrentAddress() const { return AddCurrentAddress; }
 
66
  unsigned getLabelId() const { return LabelId; }
 
67
  unsigned char getPCAdjustment() const { return PCAdjust; }
 
68
  bool isGlobalValue() const { return Kind == ARMCP::CPValue; }
 
69
  bool isExtSymbol() const { return Kind == ARMCP::CPExtSymbol; }
 
70
  bool isBlockAddress() { return Kind == ARMCP::CPBlockAddress; }
 
71
  bool isLSDA() { return Kind == ARMCP::CPLSDA; }
 
72
 
 
73
  virtual unsigned getRelocationInfo() const {
 
74
    // FIXME: This is conservatively claiming that these entries require a
 
75
    // relocation, we may be able to do better than this.
 
76
    return 2;
 
77
  }
 
78
 
 
79
  virtual int getExistingMachineCPValue(MachineConstantPool *CP,
 
80
                                        unsigned Alignment);
 
81
 
 
82
  virtual void AddSelectionDAGCSEId(FoldingSetNodeID &ID);
 
83
 
 
84
  /// hasSameValue - Return true if this ARM constpool value
 
85
  /// can share the same constantpool entry as another ARM constpool value.
 
86
  bool hasSameValue(ARMConstantPoolValue *ACPV);
 
87
 
 
88
  void print(raw_ostream *O) const { if (O) print(*O); }
 
89
  void print(raw_ostream &O) const;
 
90
  void dump() const;
 
91
};
 
92
 
 
93
inline raw_ostream &operator<<(raw_ostream &O, const ARMConstantPoolValue &V) {
 
94
  V.print(O);
 
95
  return O;
 
96
}
 
97
 
 
98
} // End llvm namespace
 
99
 
 
100
#endif