LLVM 20.0.0git
XtensaMCTargetDesc.cpp
Go to the documentation of this file.
1//===-- XtensaMCTargetDesc.cpp - Xtensa target descriptions ---------------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6// See https://llvm.org/LICENSE.txt for license information.
7// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8//
9//===----------------------------------------------------------------------===//
10#include "XtensaMCTargetDesc.h"
12#include "XtensaInstPrinter.h"
13#include "XtensaMCAsmInfo.h"
15#include "llvm/ADT/STLExtras.h"
16#include "llvm/MC/MCAsmInfo.h"
17#include "llvm/MC/MCInstrInfo.h"
19#include "llvm/MC/MCStreamer.h"
23
24#define GET_INSTRINFO_MC_DESC
25#include "XtensaGenInstrInfo.inc"
26
27#define GET_REGINFO_MC_DESC
28#include "XtensaGenRegisterInfo.inc"
29
30#define GET_SUBTARGETINFO_MC_DESC
31#include "XtensaGenSubtargetInfo.inc"
32
33using namespace llvm;
34
36 const Triple &TT,
37 const MCTargetOptions &Options) {
38 MCAsmInfo *MAI = new XtensaMCAsmInfo(TT);
39 return MAI;
40}
41
43 MCInstrInfo *X = new MCInstrInfo();
44 InitXtensaMCInstrInfo(X);
45 return X;
46}
47
49 unsigned SyntaxVariant,
50 const MCAsmInfo &MAI,
51 const MCInstrInfo &MII,
52 const MCRegisterInfo &MRI) {
53 return new XtensaInstPrinter(MAI, MII, MRI);
54}
55
58 InitXtensaMCRegisterInfo(X, Xtensa::SP);
59 return X;
60}
61
62static MCSubtargetInfo *
64 return createXtensaMCSubtargetInfoImpl(TT, CPU, CPU, FS);
65}
66
67static MCTargetStreamer *
69 MCInstPrinter *InstPrint) {
70 return new XtensaTargetAsmStreamer(S, OS);
71}
72
73static MCTargetStreamer *
75 return new XtensaTargetELFStreamer(S);
76}
77
79 // Register the MCAsmInfo.
82
83 // Register the MCCodeEmitter.
86
87 // Register the MCInstrInfo.
90
91 // Register the MCInstPrinter.
94
95 // Register the MCRegisterInfo.
98
99 // Register the MCSubtargetInfo.
102
103 // Register the MCAsmBackend.
106
107 // Register the asm target streamer.
110
111 // Register the ELF target streamer.
114}
unsigned const MachineRegisterInfo * MRI
#define LLVM_EXTERNAL_VISIBILITY
Definition: Compiler.h:128
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
static LVOptions Options
Definition: LVOptions.cpp:25
This file contains some templates that are useful if you are working with the STL at all.
raw_pwrite_stream & OS
static MCTargetStreamer * createXtensaObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
static MCInstrInfo * createXtensaMCInstrInfo()
static MCInstPrinter * createXtensaMCInstPrinter(const Triple &TT, unsigned SyntaxVariant, const MCAsmInfo &MAI, const MCInstrInfo &MII, const MCRegisterInfo &MRI)
static MCAsmInfo * createXtensaMCAsmInfo(const MCRegisterInfo &MRI, const Triple &TT, const MCTargetOptions &Options)
static MCTargetStreamer * createXtensaAsmTargetStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint)
static MCRegisterInfo * createXtensaMCRegisterInfo(const Triple &TT)
LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXtensaTargetMC()
static MCSubtargetInfo * createXtensaMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
This class is intended to be used as a base class for asm properties and features specific to the tar...
Definition: MCAsmInfo.h:56
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:46
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:26
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Streaming machine code generation interface.
Definition: MCStreamer.h:213
Generic base class for all target subtargets.
Target specific streamer interface.
Definition: MCStreamer.h:94
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:51
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
formatted_raw_ostream - A raw_ostream that wraps another one and keeps track of line and column posit...
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Target & getTheXtensaTarget()
MCCodeEmitter * createXtensaMCCodeEmitter(const MCInstrInfo &MCII, MCContext &Ctx)
MCAsmBackend * createXtensaMCAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
static void RegisterMCRegInfo(Target &T, Target::MCRegInfoCtorFnTy Fn)
RegisterMCRegInfo - Register a MCRegisterInfo implementation for the given target.
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn)
RegisterMCAsmBackend - Register a MCAsmBackend implementation for the given target.
static void RegisterMCCodeEmitter(Target &T, Target::MCCodeEmitterCtorTy Fn)
RegisterMCCodeEmitter - Register a MCCodeEmitter implementation for the given target.
static void RegisterMCAsmInfo(Target &T, Target::MCAsmInfoCtorFnTy Fn)
RegisterMCAsmInfo - Register a MCAsmInfo implementation for the given target.
static void RegisterMCSubtargetInfo(Target &T, Target::MCSubtargetInfoCtorFnTy Fn)
RegisterMCSubtargetInfo - Register a MCSubtargetInfo implementation for the given target.
static void RegisterObjectTargetStreamer(Target &T, Target::ObjectTargetStreamerCtorTy Fn)
static void RegisterMCInstPrinter(Target &T, Target::MCInstPrinterCtorTy Fn)
RegisterMCInstPrinter - Register a MCInstPrinter implementation for the given target.
static void RegisterMCInstrInfo(Target &T, Target::MCInstrInfoCtorFnTy Fn)
RegisterMCInstrInfo - Register a MCInstrInfo implementation for the given target.
static void RegisterAsmTargetStreamer(Target &T, Target::AsmTargetStreamerCtorTy Fn)