LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HexagonMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- HexagonMCTargetDesc.cpp - Hexagon 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 Hexagon specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "HexagonMCTargetDesc.h"
15 #include "HexagonMCAsmInfo.h"
18 #include "llvm/MC/MCCodeGenInfo.h"
19 #include "llvm/MC/MCInstrInfo.h"
20 #include "llvm/MC/MCRegisterInfo.h"
21 #include "llvm/MC/MCStreamer.h"
25 
26 #define GET_INSTRINFO_MC_DESC
27 #include "HexagonGenInstrInfo.inc"
28 
29 #define GET_SUBTARGETINFO_MC_DESC
30 #include "HexagonGenSubtargetInfo.inc"
31 
32 #define GET_REGINFO_MC_DESC
33 #include "HexagonGenRegisterInfo.inc"
34 
35 using namespace llvm;
36 
38  MCInstrInfo *X = new MCInstrInfo();
39  InitHexagonMCInstrInfo(X);
40  return X;
41 }
42 
45  InitHexagonMCRegisterInfo(X, Hexagon::R0);
46  return X;
47 }
48 
50  StringRef CPU,
51  StringRef FS) {
53  InitHexagonMCSubtargetInfo(X, TT, CPU, FS);
54  return X;
55 }
56 
58  StringRef TT) {
59  MCAsmInfo *MAI = new HexagonMCAsmInfo(TT);
60 
61  // VirtualFP = (R30 + #0).
63  0, Hexagon::R30, 0);
64  MAI->addInitialFrameState(Inst);
65 
66  return MAI;
67 }
68 
71  CodeGenOpt::Level OL) {
72  MCCodeGenInfo *X = new MCCodeGenInfo();
73  // For the time being, use static relocations, since there's really no
74  // support for PIC yet.
75  X->InitMCCodeGenInfo(Reloc::Static, CM, OL);
76  return X;
77 }
78 
79 // Force static initialization.
80 extern "C" void LLVMInitializeHexagonTargetMC() {
81  // Register the MC asm info.
83 
84  // Register the MC codegen info.
87 
88  // Register the MC instruction info.
90 
91  // Register the MC register info.
94 
95  // Register the MC subtarget info.
98 }
static MCSubtargetInfo * createHexagonMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS)
static MCAsmInfo * createHexagonMCAsmInfo(const MCRegisterInfo &MRI, StringRef TT)
void LLVMInitializeHexagonTargetMC()
static MCRegisterInfo * createHexagonMCRegisterInfo(StringRef TT)
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 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
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
static MCInstrInfo * createHexagonMCInstrInfo()
static MCCodeGenInfo * createHexagonMCCodeGenInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
const MCRegisterInfo & MRI
Target TheHexagonTarget
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")