LLVM  10.0.0svn
ARMMCTargetDesc.h
Go to the documentation of this file.
1 //===-- ARMMCTargetDesc.h - ARM 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 ARM specific target descriptions.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCTARGETDESC_H
14 #define LLVM_LIB_TARGET_ARM_MCTARGETDESC_ARMMCTARGETDESC_H
15 
16 #include "llvm/Support/DataTypes.h"
17 #include "llvm/MC/MCInstrDesc.h"
18 #include <memory>
19 #include <string>
20 
21 namespace llvm {
22 class formatted_raw_ostream;
23 class MCAsmBackend;
24 class MCCodeEmitter;
25 class MCContext;
26 class MCInstrInfo;
27 class MCInstPrinter;
28 class MCObjectTargetWriter;
29 class MCObjectWriter;
30 class MCRegisterInfo;
31 class MCSubtargetInfo;
32 class MCStreamer;
33 class MCTargetOptions;
34 class MCRelocationInfo;
35 class MCTargetStreamer;
36 class StringRef;
37 class Target;
38 class Triple;
39 class raw_ostream;
40 class raw_pwrite_stream;
41 
42 namespace ARM_MC {
43 std::string ParseARMTriple(const Triple &TT, StringRef CPU);
44 
45 /// Create a ARM MCSubtargetInfo instance. This is exposed so Asm parser, etc.
46 /// do not need to go through TargetRegistry.
48  StringRef FS);
49 }
50 
54  MCInstPrinter *InstPrint,
55  bool isVerboseAsm);
57  const MCSubtargetInfo &STI);
58 
60  const MCRegisterInfo &MRI,
61  MCContext &Ctx);
62 
64  const MCRegisterInfo &MRI,
65  MCContext &Ctx);
66 
68  const MCRegisterInfo &MRI,
69  const MCTargetOptions &Options);
70 
72  const MCRegisterInfo &MRI,
73  const MCTargetOptions &Options);
74 
75 // Construct a PE/COFF machine code streamer which will generate a PE/COFF
76 // object file.
78  std::unique_ptr<MCAsmBackend> &&MAB,
79  std::unique_ptr<MCObjectWriter> &&OW,
80  std::unique_ptr<MCCodeEmitter> &&Emitter,
81  bool RelaxAll,
82  bool IncrementalLinkerCompatible);
83 
84 /// Construct an ELF Mach-O object writer.
85 std::unique_ptr<MCObjectTargetWriter> createARMELFObjectWriter(uint8_t OSABI);
86 
87 /// Construct an ARM Mach-O object writer.
88 std::unique_ptr<MCObjectTargetWriter>
90  uint32_t CPUSubtype);
91 
92 /// Construct an ARM PE/COFF object writer.
93 std::unique_ptr<MCObjectTargetWriter>
94 createARMWinCOFFObjectWriter(bool Is64Bit);
95 
96 /// Construct ARM Mach-O relocation info.
98 
99 namespace ARM {
103 };
104 inline bool isVpred(OperandType op) {
105  return op == OPERAND_VPRED_R || op == OPERAND_VPRED_N;
106 }
107 inline bool isVpred(uint8_t op) {
108  return isVpred(static_cast<OperandType>(op));
109 }
110 } // end namespace ARM
111 
112 } // End llvm namespace
113 
114 // Defines symbolic names for ARM registers. This defines a mapping from
115 // register name to register number.
116 //
117 #define GET_REGINFO_ENUM
118 #include "ARMGenRegisterInfo.inc"
119 
120 // Defines symbolic names for the ARM instructions.
121 //
122 #define GET_INSTRINFO_ENUM
123 #include "ARMGenInstrInfo.inc"
124 
125 #define GET_SUBTARGETINFO_ENUM
126 #include "ARMGenSubtargetInfo.inc"
127 
128 #endif
MCAsmBackend * createARMLEAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
LLVMContext & Context
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
MCRelocationInfo * createARMMachORelocationInfo(MCContext &Ctx)
Construct ARM Mach-O relocation info.
#define op(i)
Context object for machine code objects.
Definition: MCContext.h:64
MCAsmBackend * createARMBEAsmBackend(const Target &T, const MCSubtargetInfo &STI, const MCRegisterInfo &MRI, const MCTargetOptions &Options)
MCTargetStreamer * createARMTargetAsmStreamer(MCStreamer &S, formatted_raw_ostream &OS, MCInstPrinter *InstPrint, bool isVerboseAsm)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
MCTargetStreamer * createARMObjectTargetStreamer(MCStreamer &S, const MCSubtargetInfo &STI)
Streaming machine code generation interface.
Definition: MCStreamer.h:188
unsigned const MachineRegisterInfo * MRI
bool isVpred(uint8_t op)
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:21
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:23
Create MCExprs from relocations found in an object file.
std::unique_ptr< MCObjectTargetWriter > createARMELFObjectWriter(uint8_t OSABI)
Construct an ELF Mach-O object writer.
MCSubtargetInfo * createARMMCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Create a ARM MCSubtargetInfo instance.
MCStreamer * createARMWinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > &&MAB, std::unique_ptr< MCObjectWriter > &&OW, std::unique_ptr< MCCodeEmitter > &&Emitter, bool RelaxAll, bool IncrementalLinkerCompatible)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
Target - Wrapper for Target specific information.
std::unique_ptr< MCObjectTargetWriter > createARMWinCOFFObjectWriter(bool Is64Bit)
Construct an ARM PE/COFF object writer.
std::unique_ptr< MCObjectTargetWriter > createARMMachObjectWriter(bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an ARM Mach-O object writer.
MCCodeEmitter * createARMLEMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
This is an instance of a target assembly language printer that converts an MCInst to valid target ass...
Definition: MCInstPrinter.h:39
Generic base class for all target subtargets.
MCTargetStreamer * createARMNullTargetStreamer(MCStreamer &S)
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:41
std::string ParseARMTriple(const Triple &TT, StringRef CPU)
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
MCCodeEmitter * createARMBEMCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)