~louis/ubuntu/trusty/clamav/lp799623_fix_logrotate

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/Target/ARM/ARMSubtarget.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
//=====---- ARMSubtarget.h - Define Subtarget for the ARM -----*- 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 declares the ARM specific subclass of TargetSubtarget.
 
11
//
 
12
//===----------------------------------------------------------------------===//
 
13
 
 
14
#ifndef ARMSUBTARGET_H
 
15
#define ARMSUBTARGET_H
 
16
 
 
17
#include "llvm/Target/TargetInstrItineraries.h"
 
18
#include "llvm/Target/TargetMachine.h"
 
19
#include "llvm/Target/TargetSubtarget.h"
 
20
#include "ARMBaseRegisterInfo.h"
 
21
#include <string>
 
22
 
 
23
namespace llvm {
 
24
class GlobalValue;
 
25
 
 
26
class ARMSubtarget : public TargetSubtarget {
 
27
protected:
 
28
  enum ARMArchEnum {
 
29
    V4T, V5T, V5TE, V6, V6T2, V7A
 
30
  };
 
31
 
 
32
  enum ARMFPEnum {
 
33
    None, VFPv2, VFPv3, NEON
 
34
  };
 
35
 
 
36
  enum ThumbTypeEnum {
 
37
    Thumb1,
 
38
    Thumb2
 
39
  };
 
40
 
 
41
  /// ARMArchVersion - ARM architecture version: V4T (base), V5T, V5TE,
 
42
  /// V6, V6T2, V7A.
 
43
  ARMArchEnum ARMArchVersion;
 
44
 
 
45
  /// ARMFPUType - Floating Point Unit type.
 
46
  ARMFPEnum ARMFPUType;
 
47
 
 
48
  /// UseNEONForSinglePrecisionFP - if the NEONFP attribute has been
 
49
  /// specified. Use the method useNEONForSinglePrecisionFP() to
 
50
  /// determine if NEON should actually be used.
 
51
  bool UseNEONForSinglePrecisionFP;
 
52
 
 
53
  /// IsThumb - True if we are in thumb mode, false if in ARM mode.
 
54
  bool IsThumb;
 
55
 
 
56
  /// ThumbMode - Indicates supported Thumb version.
 
57
  ThumbTypeEnum ThumbMode;
 
58
 
 
59
  /// PostRAScheduler - True if using post-register-allocation scheduler.
 
60
  bool PostRAScheduler;
 
61
 
 
62
  /// IsR9Reserved - True if R9 is a not available as general purpose register.
 
63
  bool IsR9Reserved;
 
64
 
 
65
  /// UseMovt - True if MOVT / MOVW pairs are used for materialization of 32-bit
 
66
  /// imms (including global addresses).
 
67
  bool UseMovt;
 
68
 
 
69
  /// stackAlignment - The minimum alignment known to hold of the stack frame on
 
70
  /// entry to the function and which must be maintained by every function.
 
71
  unsigned stackAlignment;
 
72
 
 
73
  /// CPUString - String name of used CPU.
 
74
  std::string CPUString;
 
75
 
 
76
  /// Selected instruction itineraries (one entry per itinerary class.)
 
77
  InstrItineraryData InstrItins;
 
78
 
 
79
 public:
 
80
  enum {
 
81
    isELF, isDarwin
 
82
  } TargetType;
 
83
 
 
84
  enum {
 
85
    ARM_ABI_APCS,
 
86
    ARM_ABI_AAPCS // ARM EABI
 
87
  } TargetABI;
 
88
 
 
89
  /// This constructor initializes the data members to match that
 
90
  /// of the specified triple.
 
91
  ///
 
92
  ARMSubtarget(const std::string &TT, const std::string &FS, bool isThumb);
 
93
 
 
94
  /// getMaxInlineSizeThreshold - Returns the maximum memset / memcpy size
 
95
  /// that still makes it profitable to inline the call.
 
96
  unsigned getMaxInlineSizeThreshold() const {
 
97
    // FIXME: For now, we don't lower memcpy's to loads / stores for Thumb.
 
98
    // Change this once Thumb ldmia / stmia support is added.
 
99
    return isThumb() ? 0 : 64;
 
100
  }
 
101
  /// ParseSubtargetFeatures - Parses features string setting specified
 
102
  /// subtarget options.  Definition of function is auto generated by tblgen.
 
103
  std::string ParseSubtargetFeatures(const std::string &FS,
 
104
                                     const std::string &CPU);
 
105
 
 
106
  bool hasV4TOps()  const { return ARMArchVersion >= V4T;  }
 
107
  bool hasV5TOps()  const { return ARMArchVersion >= V5T;  }
 
108
  bool hasV5TEOps() const { return ARMArchVersion >= V5TE; }
 
109
  bool hasV6Ops()   const { return ARMArchVersion >= V6;   }
 
110
  bool hasV6T2Ops() const { return ARMArchVersion >= V6T2; }
 
111
  bool hasV7Ops()   const { return ARMArchVersion >= V7A;  }
 
112
 
 
113
  bool hasVFP2() const { return ARMFPUType >= VFPv2; }
 
114
  bool hasVFP3() const { return ARMFPUType >= VFPv3; }
 
115
  bool hasNEON() const { return ARMFPUType >= NEON;  }
 
116
  bool useNEONForSinglePrecisionFP() const {
 
117
    return hasNEON() && UseNEONForSinglePrecisionFP; }
 
118
 
 
119
  bool isTargetDarwin() const { return TargetType == isDarwin; }
 
120
  bool isTargetELF() const { return TargetType == isELF; }
 
121
 
 
122
  bool isAPCS_ABI() const { return TargetABI == ARM_ABI_APCS; }
 
123
  bool isAAPCS_ABI() const { return TargetABI == ARM_ABI_AAPCS; }
 
124
 
 
125
  bool isThumb() const { return IsThumb; }
 
126
  bool isThumb1Only() const { return IsThumb && (ThumbMode == Thumb1); }
 
127
  bool isThumb2() const { return IsThumb && (ThumbMode == Thumb2); }
 
128
  bool hasThumb2() const { return ThumbMode >= Thumb2; }
 
129
 
 
130
  bool isR9Reserved() const { return IsR9Reserved; }
 
131
 
 
132
  bool useMovt() const { return UseMovt && hasV6T2Ops(); }
 
133
 
 
134
  const std::string & getCPUString() const { return CPUString; }
 
135
 
 
136
  /// enablePostRAScheduler - True at 'More' optimization.
 
137
  bool enablePostRAScheduler(CodeGenOpt::Level OptLevel,
 
138
                             TargetSubtarget::AntiDepBreakMode& Mode,
 
139
                             RegClassVector& CriticalPathRCs) const;
 
140
 
 
141
  /// getInstrItins - Return the instruction itineraies based on subtarget
 
142
  /// selection.
 
143
  const InstrItineraryData &getInstrItineraryData() const { return InstrItins; }
 
144
 
 
145
  /// getStackAlignment - Returns the minimum alignment known to hold of the
 
146
  /// stack frame on entry to the function and which must be maintained by every
 
147
  /// function for this subtarget.
 
148
  unsigned getStackAlignment() const { return stackAlignment; }
 
149
 
 
150
  /// GVIsIndirectSymbol - true if the GV will be accessed via an indirect
 
151
  /// symbol.
 
152
  bool GVIsIndirectSymbol(GlobalValue *GV, Reloc::Model RelocM) const;
 
153
};
 
154
} // End llvm namespace
 
155
 
 
156
#endif  // ARMSUBTARGET_H