LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SparcMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- SparcMCTargetDesc.cpp - Sparc Target Descriptions -----------------===//
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 provides Sparc specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "SparcMCTargetDesc.h"
15 #include "SparcMCAsmInfo.h"
16 #include "llvm/MC/MCCodeGenInfo.h"
17 #include "llvm/MC/MCInstrInfo.h"
18 #include "llvm/MC/MCRegisterInfo.h"
22 
23 #define GET_INSTRINFO_MC_DESC
24 #include "SparcGenInstrInfo.inc"
25 
26 #define GET_SUBTARGETINFO_MC_DESC
27 #include "SparcGenSubtargetInfo.inc"
28 
29 #define GET_REGINFO_MC_DESC
30 #include "SparcGenRegisterInfo.inc"
31 
32 using namespace llvm;
33 
35  MCInstrInfo *X = new MCInstrInfo();
36  InitSparcMCInstrInfo(X);
37  return X;
38 }
39 
42  InitSparcMCRegisterInfo(X, SP::I7);
43  return X;
44 }
45 
47  StringRef FS) {
49  InitSparcMCSubtargetInfo(X, TT, CPU, FS);
50  return X;
51 }
52 
53 // Code models. Some only make sense for 64-bit code.
54 //
55 // SunCC Reloc CodeModel Constraints
56 // abs32 Static Small text+data+bss linked below 2^32 bytes
57 // abs44 Static Medium text+data+bss linked below 2^44 bytes
58 // abs64 Static Large text smaller than 2^31 bytes
59 // pic13 PIC_ Small GOT < 2^13 bytes
60 // pic32 PIC_ Medium GOT < 2^32 bytes
61 //
62 // All code models require that the text segment is smaller than 2GB.
63 
66  CodeGenOpt::Level OL) {
67  MCCodeGenInfo *X = new MCCodeGenInfo();
68 
69  // The default 32-bit code model is abs32/pic32.
70  if (CM == CodeModel::Default)
72 
73  X->InitMCCodeGenInfo(RM, CM, OL);
74  return X;
75 }
76 
79  CodeGenOpt::Level OL) {
80  MCCodeGenInfo *X = new MCCodeGenInfo();
81 
82  // The default 64-bit code model is abs44/pic32.
83  if (CM == CodeModel::Default)
84  CM = CodeModel::Medium;
85 
86  X->InitMCCodeGenInfo(RM, CM, OL);
87  return X;
88 }
89 extern "C" void LLVMInitializeSparcTargetMC() {
90  // Register the MC asm info.
93 
94  // Register the MC codegen info.
99 
100  // Register the MC instruction info.
102 
103  // Register the MC register info.
105 
106  // Register the MC subtarget info.
109 }
void LLVMInitializeSparcTargetMC()
Target TheSparcTarget
static MCSubtargetInfo * createSparcMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS)
void InitMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
static MCRegisterInfo * createSparcMCRegisterInfo(StringRef TT)
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
static MCInstrInfo * createSparcMCInstrInfo()
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
Target TheSparcV9Target
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
static MCCodeGenInfo * createSparcMCCodeGenInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
static MCCodeGenInfo * createSparcV9MCCodeGenInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")