~ubuntu-branches/ubuntu/trusty/llvm-toolchain-snapshot/trusty-201310232150

« back to all changes in this revision

Viewing changes to lib/Target/TargetMachineC.cpp

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-27 15:01:57 UTC
  • mfrom: (0.10.1) (0.9.1) (0.8.1) (0.7.1) (0.6.1) (0.5.2)
  • Revision ID: package-import@ubuntu.com-20130527150157-tdkrsjpuvht7v0qx
Tags: 1:3.4~svn182733-1~exp1
* New snapshot release (3.4 release)
* Add a symlink of libLLVM-3.4.so.1 to usr/lib/llvm-3.4/lib/libLLVM-3.4.so
    to fix make the llvm-config-3.4 --libdir work (Closes: #708677)
  * Various packages rename to allow co installations:
    * libclang1 => libclang1-3.4
    * libclang1-dbg => libclang1-3.4-dbg
    * libclang-dev => libclang-3.4-dev
    * libclang-common-dev => libclang-common-3.4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
using namespace llvm;
30
30
 
31
 
 
 
31
inline DataLayout *unwrap(LLVMTargetDataRef P) {
 
32
  return reinterpret_cast<DataLayout*>(P);
 
33
}
 
34
 
 
35
inline LLVMTargetDataRef wrap(const DataLayout *P) {
 
36
  return reinterpret_cast<LLVMTargetDataRef>(const_cast<DataLayout*>(P));
 
37
}
 
38
 
 
39
inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) {
 
40
  return reinterpret_cast<TargetLibraryInfo*>(P);
 
41
}
 
42
 
 
43
inline LLVMTargetLibraryInfoRef wrap(const TargetLibraryInfo *P) {
 
44
  TargetLibraryInfo *X = const_cast<TargetLibraryInfo*>(P);
 
45
  return reinterpret_cast<LLVMTargetLibraryInfoRef>(X);
 
46
}
 
47
 
 
48
inline TargetMachine *unwrap(LLVMTargetMachineRef P) {
 
49
  return reinterpret_cast<TargetMachine*>(P);
 
50
}
 
51
inline Target *unwrap(LLVMTargetRef P) {
 
52
  return reinterpret_cast<Target*>(P);
 
53
}
 
54
inline LLVMTargetMachineRef wrap(const TargetMachine *P) {
 
55
  return
 
56
    reinterpret_cast<LLVMTargetMachineRef>(const_cast<TargetMachine*>(P));
 
57
}
 
58
inline LLVMTargetRef wrap(const Target * P) {
 
59
  return reinterpret_cast<LLVMTargetRef>(const_cast<Target*>(P));
 
60
}
32
61
 
33
62
LLVMTargetRef LLVMGetFirstTarget() {
34
63
   const Target* target = &*TargetRegistry::begin();
77
106
      break;
78
107
  }
79
108
 
80
 
  CodeModel::Model CM;
81
 
  switch (CodeModel) {
82
 
    case LLVMCodeModelJITDefault:
83
 
      CM = CodeModel::JITDefault;
84
 
      break;
85
 
    case LLVMCodeModelSmall:
86
 
      CM = CodeModel::Small;
87
 
      break;
88
 
    case LLVMCodeModelKernel:
89
 
      CM = CodeModel::Kernel;
90
 
      break;
91
 
    case LLVMCodeModelMedium:
92
 
      CM = CodeModel::Medium;
93
 
      break;
94
 
    case LLVMCodeModelLarge:
95
 
      CM = CodeModel::Large;
96
 
      break;
97
 
    default:
98
 
      CM = CodeModel::Default;
99
 
      break;
100
 
  }
 
109
  CodeModel::Model CM = unwrap(CodeModel);
 
110
 
101
111
  CodeGenOpt::Level OL;
102
 
 
103
112
  switch (Level) {
104
113
    case LLVMCodeGenLevelNone:
105
114
      OL = CodeGenOpt::None;