LLVM  3.7.0
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"
16 #include "NVPTXMCAsmInfo.h"
17 #include "llvm/MC/MCCodeGenInfo.h"
18 #include "llvm/MC/MCInstrInfo.h"
19 #include "llvm/MC/MCRegisterInfo.h"
22 
23 using namespace llvm;
24 
25 #define GET_INSTRINFO_MC_DESC
26 #include "NVPTXGenInstrInfo.inc"
27 
28 #define GET_SUBTARGETINFO_MC_DESC
29 #include "NVPTXGenSubtargetInfo.inc"
30 
31 #define GET_REGINFO_MC_DESC
32 #include "NVPTXGenRegisterInfo.inc"
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 *
49  return createNVPTXMCSubtargetInfoImpl(TT, CPU, FS);
50 }
51 
55  CodeGenOpt::Level OL) {
56  MCCodeGenInfo *X = new MCCodeGenInfo();
57 
58  // The default relocation model is used regardless of what the client has
59  // specified, as it is the only relocation model currently supported.
61  return X;
62 }
63 
65  unsigned SyntaxVariant,
66  const MCAsmInfo &MAI,
67  const MCInstrInfo &MII,
68  const MCRegisterInfo &MRI) {
69  if (SyntaxVariant == 0)
70  return new NVPTXInstPrinter(MAI, MII, MRI);
71  return nullptr;
72 }
73 
74 // Force static initialization.
75 extern "C" void LLVMInitializeNVPTXTargetMC() {
77  // Register the MC asm info.
79 
80  // Register the MC codegen info.
82 
83  // Register the MC instruction info.
85 
86  // Register the MC register info.
88 
89  // Register the MC subtarget info.
91 
92  // Register the MCInstPrinter.
94  }
95 }
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
Target TheNVPTXTarget32
Definition: NVPTX.h:78
static MCInstrInfo * createNVPTXMCInstrInfo()
static MCSubtargetInfo * createNVPTXMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:58
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
Target TheNVPTXTarget64
Definition: NVPTX.h:79
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang","erlang-compatible garbage collector")
static void RegisterMCCodeGenInfo(Target &T, Target::MCCodeGenInfoCtorFnTy Fn)
RegisterMCCodeGenInfo - Register a MCCodeGenInfo implementation for the given target.
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target...
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Target - Wrapper for Target specific information.
static MCCodeGenInfo * createNVPTXMCCodeGenInfo(const Triple &TT, Reloc::Model RM, CodeModel::Model CM, CodeGenOpt::Level OL)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:38
void initMCCodeGenInfo(Reloc::Model RM=Reloc::Default, CodeModel::Model CM=CodeModel::Default, CodeGenOpt::Level OL=CodeGenOpt::Default)
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
static MCRegisterInfo * createNVPTXMCRegisterInfo(const Triple &TT)
MCSubtargetInfo - Generic base class for all target subtargets.
void LLVMInitializeNVPTXTargetMC()
static MCInstPrinter * createNVPTXMCInstPrinter(const Triple &T, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40