LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XCoreMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- XCoreMCTargetDesc.cpp - XCore 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 XCore specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "XCoreMCTargetDesc.h"
16 #include "XCoreMCAsmInfo.h"
17 #include "llvm/MC/MCCodeGenInfo.h"
18 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h"
23 
24 #define GET_INSTRINFO_MC_DESC
25 #include "XCoreGenInstrInfo.inc"
26 
27 #define GET_SUBTARGETINFO_MC_DESC
28 #include "XCoreGenSubtargetInfo.inc"
29 
30 #define GET_REGINFO_MC_DESC
31 #include "XCoreGenRegisterInfo.inc"
32 
33 using namespace llvm;
34 
36  MCInstrInfo *X = new MCInstrInfo();
37  InitXCoreMCInstrInfo(X);
38  return X;
39 }
40 
43  InitXCoreMCRegisterInfo(X, XCore::LR);
44  return X;
45 }
46 
48  StringRef FS) {
50  InitXCoreMCSubtargetInfo(X, TT, CPU, FS);
51  return X;
52 }
53 
55  StringRef TT) {
56  MCAsmInfo *MAI = new XCoreMCAsmInfo(TT);
57 
58  // Initial state of the frame pointer is SP.
59  MCCFIInstruction Inst = MCCFIInstruction::createDefCfa(0, XCore::SP, 0);
60  MAI->addInitialFrameState(Inst);
61 
62  return MAI;
63 }
64 
67  CodeGenOpt::Level OL) {
68  MCCodeGenInfo *X = new MCCodeGenInfo();
69  if (RM == Reloc::Default) {
70  RM = Reloc::Static;
71  }
72  X->InitMCCodeGenInfo(RM, CM, OL);
73  return X;
74 }
75 
77  unsigned SyntaxVariant,
78  const MCAsmInfo &MAI,
79  const MCInstrInfo &MII,
80  const MCRegisterInfo &MRI,
81  const MCSubtargetInfo &STI) {
82  return new XCoreInstPrinter(MAI, MII, MRI);
83 }
84 
85 // Force static initialization.
86 extern "C" void LLVMInitializeXCoreTargetMC() {
87  // Register the MC asm info.
89 
90  // Register the MC codegen info.
93 
94  // Register the MC instruction info.
96 
97  // Register the MC register info.
99 
100  // Register the MC subtarget info.
103 
104  // Register the MCInstPrinter
107 }
void LLVMInitializeXCoreTargetMC()
static MCAsmInfo * createXCoreMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT)
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
static MCInstrInfo * createXCoreMCInstrInfo()
void addInitialFrameState(const MCCFIInstruction &Inst)
Definition: MCAsmInfo.h:535
void InitMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
static MCCodeGenInfo * createXCoreMCCodeGenInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
static MCCFIInstruction createDefCfa(MCSymbol *L, unsigned Register, int Offset)
.cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it...
Definition: MCDwarf.h:321
const MCInstrInfo & MII
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
static MCSubtargetInfo * createXCoreMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS)
static MCRegisterInfo * createXCoreMCRegisterInfo(StringRef TT)
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
static MCInstPrinter * createXCoreMCInstPrinter(const Target &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)
Target TheXCoreTarget
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
This file contains the declaration of the XCoreInstPrinter class, which is used to print XCore MCInst...
const MCRegisterInfo & MRI
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")