LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NVPTXMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- NVPTXMCTargetDesc.cpp - NVPTX Target Descriptions -------*- C++ -*-===//
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 NVPTX specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "NVPTXMCTargetDesc.h"
15 #include "NVPTXMCAsmInfo.h"
17 #include "llvm/MC/MCCodeGenInfo.h"
18 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h"
22 
23 #define GET_INSTRINFO_MC_DESC
24 #include "NVPTXGenInstrInfo.inc"
25 
26 #define GET_SUBTARGETINFO_MC_DESC
27 #include "NVPTXGenSubtargetInfo.inc"
28 
29 #define GET_REGINFO_MC_DESC
30 #include "NVPTXGenRegisterInfo.inc"
31 
32 using namespace llvm;
33 
35  MCInstrInfo *X = new MCInstrInfo();
36  InitNVPTXMCInstrInfo(X);
37  return X;
38 }
39 
42  // PTX does not have a return address register.
43  InitNVPTXMCRegisterInfo(X, 0);
44  return X;
45 }
46 
47 static MCSubtargetInfo *
50  InitNVPTXMCSubtargetInfo(X, TT, CPU, FS);
51  return X;
52 }
53 
56  MCCodeGenInfo *X = new MCCodeGenInfo();
57  X->InitMCCodeGenInfo(RM, CM, OL);
58  return X;
59 }
60 
62  unsigned SyntaxVariant,
63  const MCAsmInfo &MAI,
64  const MCInstrInfo &MII,
65  const MCRegisterInfo &MRI,
66  const MCSubtargetInfo &STI) {
67  if (SyntaxVariant == 0)
68  return new NVPTXInstPrinter(MAI, MII, MRI, STI);
69  return 0;
70 }
71 
72 // Force static initialization.
73 extern "C" void LLVMInitializeNVPTXTargetMC() {
74  // Register the MC asm info.
77 
78  // Register the MC codegen info.
83 
84  // Register the MC instruction info.
87 
88  // Register the MC register info.
93 
94  // Register the MC subtarget info.
99 
100  // Register the MCInstPrinter.
105 }
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
Target TheNVPTXTarget32
Definition: NVPTX.h:71
static MCInstrInfo * createNVPTXMCInstrInfo()
void InitMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
static MCCodeGenInfo * createNVPTXMCCodeGenInfo(StringRef TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
const MCInstrInfo & MII
Target TheNVPTXTarget64
Definition: NVPTX.h:72
static MCRegisterInfo * createNVPTXMCRegisterInfo(StringRef TT)
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 MCInstPrinter * createNVPTXMCInstPrinter(const Target &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI, const MCSubtargetInfo &STI)
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
void LLVMInitializeNVPTXTargetMC()
static MCSubtargetInfo * createNVPTXMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS)
const MCRegisterInfo & MRI
static GCMetadataPrinterRegistry::Add< OcamlGCMetadataPrinter > Y("ocaml","ocaml 3.10-compatible collector")
static RegisterPass< NVPTXAllocaHoisting > X("alloca-hoisting","Hoisting alloca instructions in non-entry ""blocks to the entry block")