LLVM  9.0.0svn
NVPTXMCTargetDesc.cpp
Go to the documentation of this file.
1 //===-- NVPTXMCTargetDesc.cpp - NVPTX Target Descriptions -------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file provides NVPTX specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
14 #include "NVPTXMCAsmInfo.h"
15 #include "NVPTXMCTargetDesc.h"
16 #include "NVPTXTargetStreamer.h"
17 #include "llvm/MC/MCInstrInfo.h"
18 #include "llvm/MC/MCRegisterInfo.h"
21 
22 using namespace llvm;
23 
24 #define GET_INSTRINFO_MC_DESC
25 #include "NVPTXGenInstrInfo.inc"
26 
27 #define GET_SUBTARGETINFO_MC_DESC
28 #include "NVPTXGenSubtargetInfo.inc"
29 
30 #define GET_REGINFO_MC_DESC
31 #include "NVPTXGenRegisterInfo.inc"
32 
34  MCInstrInfo *X = new MCInstrInfo();
35  InitNVPTXMCInstrInfo(X);
36  return X;
37 }
38 
41  // PTX does not have a return address register.
42  InitNVPTXMCRegisterInfo(X, 0);
43  return X;
44 }
45 
46 static MCSubtargetInfo *
48  return createNVPTXMCSubtargetInfoImpl(TT, CPU, FS);
49 }
50 
52  unsigned SyntaxVariant,
53  const MCAsmInfo &MAI,
54  const MCInstrInfo &MII,
55  const MCRegisterInfo &MRI) {
56  if (SyntaxVariant == 0)
57  return new NVPTXInstPrinter(MAI, MII, MRI);
58  return nullptr;
59 }
60 
63  MCInstPrinter *, bool) {
64  return new NVPTXTargetStreamer(S);
65 }
66 
67 // Force static initialization.
68 extern "C" void LLVMInitializeNVPTXTargetMC() {
70  // Register the MC asm info.
72 
73  // Register the MC instruction info.
75 
76  // Register the MC register info.
78 
79  // Register the MC subtarget info.
81 
82  // Register the MCInstPrinter.
84 
85  // Register the MCTargetStreamer.
87  }
88 }
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
This class represents lattice values for constants.
Definition: AllocatorList.h:23
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
Target specific streamer interface.
Definition: MCStreamer.h:83
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)
static MCInstrInfo * createNVPTXMCInstrInfo()
Target & getTheNVPTXTarget64()
static MCTargetStreamer * createTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &, MCInstPrinter *, bool)
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:55
Target & getTheNVPTXTarget32()
Streaming machine code generation interface.
Definition: MCStreamer.h:188
unsigned const MachineRegisterInfo * MRI
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:23
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:43
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
Target - Wrapper for Target specific information.
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:39
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target. ...
static MCRegisterInfo * createNVPTXMCRegisterInfo(const Triple &TT)
Generic base class for all target subtargets.
void LLVMInitializeNVPTXTargetMC()
Implments NVPTX-specific streamer.
RegisterMCAsmInfo - Helper template for registering a target assembly info implementation.
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:48