~ubuntu-branches/ubuntu/maverick/clamav/maverick-updates

« back to all changes in this revision

Viewing changes to libclamav/c++/llvm/lib/Target/TargetMachine.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-17 12:30:20 UTC
  • mfrom: (97.1.1 maverick-proposed)
  • Revision ID: james.westby@ubuntu.com-20101217123020-o02fhyzykv5z98ri
Tags: 0.96.5+dfsg-1ubuntu1.10.10.1
* Microversion update for Maverick (LP: #691414)
  - Improved database login times
  - Expanded use of new bytecode signatures
  - Other bugfixes/improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
//
12
12
//===----------------------------------------------------------------------===//
13
13
 
 
14
#include "llvm/CodeGen/MachineFunction.h"
 
15
#include "llvm/CodeGen/MachineFrameInfo.h"
14
16
#include "llvm/MC/MCAsmInfo.h"
15
17
#include "llvm/Target/TargetMachine.h"
16
18
#include "llvm/Target/TargetOptions.h"
25
27
  bool LessPreciseFPMADOption;
26
28
  bool PrintMachineCode;
27
29
  bool NoFramePointerElim;
 
30
  bool NoFramePointerElimNonLeaf;
28
31
  bool NoExcessFPPrecision;
29
32
  bool UnsafeFPMath;
30
 
  bool FiniteOnlyFPMathOption;
 
33
  bool NoInfsFPMath;
 
34
  bool NoNaNsFPMath;
31
35
  bool HonorSignDependentRoundingFPMathOption;
32
36
  bool UseSoftFloat;
33
37
  FloatABI::ABIType FloatABIType;
34
38
  bool NoImplicitFloat;
35
39
  bool NoZerosInBSS;
36
 
  bool DwarfExceptionHandling;
37
 
  bool SjLjExceptionHandling;
 
40
  bool JITExceptionHandling;
38
41
  bool JITEmitDebugInfo;
39
42
  bool JITEmitDebugInfoToDisk;
40
43
  bool UnwindTablesMandatory;
58
61
  cl::location(NoFramePointerElim),
59
62
  cl::init(false));
60
63
static cl::opt<bool, true>
 
64
DisableFPElimNonLeaf("disable-non-leaf-fp-elim",
 
65
  cl::desc("Disable frame pointer elimination optimization for non-leaf funcs"),
 
66
  cl::location(NoFramePointerElimNonLeaf),
 
67
  cl::init(false));
 
68
static cl::opt<bool, true>
61
69
DisableExcessPrecision("disable-excess-fp-precision",
62
70
  cl::desc("Disable optimizations that may increase FP precision"),
63
71
  cl::location(NoExcessFPPrecision),
73
81
  cl::location(UnsafeFPMath),
74
82
  cl::init(false));
75
83
static cl::opt<bool, true>
76
 
EnableFiniteOnlyFPMath("enable-finite-only-fp-math",
77
 
  cl::desc("Enable optimizations that assumes non- NaNs / +-Infs"),
78
 
  cl::location(FiniteOnlyFPMathOption),
 
84
EnableNoInfsFPMath("enable-no-infs-fp-math",
 
85
  cl::desc("Enable FP math optimizations that assume no +-Infs"),
 
86
  cl::location(NoInfsFPMath),
 
87
  cl::init(false));
 
88
static cl::opt<bool, true>
 
89
EnableNoNaNsFPMath("enable-no-nans-fp-math",
 
90
  cl::desc("Enable FP math optimizations that assume no NaNs"),
 
91
  cl::location(NoNaNsFPMath),
79
92
  cl::init(false));
80
93
static cl::opt<bool, true>
81
94
EnableHonorSignDependentRoundingFPMath("enable-sign-dependent-rounding-fp-math",
107
120
  cl::location(NoZerosInBSS),
108
121
  cl::init(false));
109
122
static cl::opt<bool, true>
110
 
EnableDwarfExceptionHandling("enable-eh",
111
 
  cl::desc("Emit DWARF exception handling (default if target supports)"),
112
 
  cl::location(DwarfExceptionHandling),
113
 
  cl::init(false));
114
 
static cl::opt<bool, true>
115
 
EnableSjLjExceptionHandling("enable-sjlj-eh",
116
 
  cl::desc("Emit SJLJ exception handling (default if target supports)"),
117
 
  cl::location(SjLjExceptionHandling),
 
123
EnableJITExceptionHandling("jit-enable-eh",
 
124
  cl::desc("Emit exception handling information"),
 
125
  cl::location(JITExceptionHandling),
118
126
  cl::init(false));
119
127
// In debug builds, make this default to true.
120
128
#ifdef NDEBUG
197
205
  cl::desc("Use strong PHI elimination."),
198
206
  cl::location(StrongPHIElim),
199
207
  cl::init(false));
200
 
 
 
208
static cl::opt<bool>
 
209
DataSections("fdata-sections",
 
210
  cl::desc("Emit data into separate sections"),
 
211
  cl::init(false));
 
212
static cl::opt<bool>
 
213
FunctionSections("ffunction-sections",
 
214
  cl::desc("Emit functions into separate sections"),
 
215
  cl::init(false));
201
216
//---------------------------------------------------------------------------
202
217
// TargetMachine Class
203
218
//
204
219
 
205
220
TargetMachine::TargetMachine(const Target &T) 
206
 
  : TheTarget(T), AsmInfo(0) {
 
221
  : TheTarget(T), AsmInfo(0),
 
222
    MCRelaxAll(false) {
207
223
  // Typically it will be subtargets that will adjust FloatABIType from Default
208
224
  // to Soft or Hard.
209
225
  if (UseSoftFloat)
244
260
  AsmVerbosityDefault = V;
245
261
}
246
262
 
 
263
bool TargetMachine::getFunctionSections() {
 
264
  return FunctionSections;
 
265
}
 
266
 
 
267
bool TargetMachine::getDataSections() {
 
268
  return DataSections;
 
269
}
 
270
 
 
271
void TargetMachine::setFunctionSections(bool V) {
 
272
  FunctionSections = V;
 
273
}
 
274
 
 
275
void TargetMachine::setDataSections(bool V) {
 
276
  DataSections = V;
 
277
}
 
278
 
247
279
namespace llvm {
 
280
  /// DisableFramePointerElim - This returns true if frame pointer elimination
 
281
  /// optimization should be disabled for the given machine function.
 
282
  bool DisableFramePointerElim(const MachineFunction &MF) {
 
283
    // Check to see if we should eliminate non-leaf frame pointers and then
 
284
    // check to see if we should eliminate all frame pointers.
 
285
    if (NoFramePointerElimNonLeaf && !NoFramePointerElim) {
 
286
      const MachineFrameInfo *MFI = MF.getFrameInfo();
 
287
      return MFI->hasCalls();
 
288
    }
 
289
 
 
290
    return NoFramePointerElim;
 
291
  }
 
292
 
248
293
  /// LessPreciseFPMAD - This flag return true when -enable-fp-mad option
249
294
  /// is specified on the command line.  When this flag is off(default), the
250
295
  /// code generator is not allowed to generate mad (multiply add) if the
251
296
  /// result is "less precise" than doing those operations individually.
252
297
  bool LessPreciseFPMAD() { return UnsafeFPMath || LessPreciseFPMADOption; }
253
298
 
254
 
  /// FiniteOnlyFPMath - This returns true when the -enable-finite-only-fp-math
255
 
  /// option is specified on the command line. If this returns false (default),
256
 
  /// the code generator is not allowed to assume that FP arithmetic arguments
257
 
  /// and results are never NaNs or +-Infs.
258
 
  bool FiniteOnlyFPMath() { return UnsafeFPMath || FiniteOnlyFPMathOption; }
259
 
  
260
299
  /// HonorSignDependentRoundingFPMath - Return true if the codegen must assume
261
300
  /// that the rounding mode of the FPU can change from its default.
262
301
  bool HonorSignDependentRoundingFPMath() {