LLVM  3.7.0
X86MCTargetDesc.h
Go to the documentation of this file.
1 //===-- X86MCTargetDesc.h - X86 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 X86 specific target descriptions.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
15 #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
16 
17 #include "llvm/Support/DataTypes.h"
18 #include <string>
19 
20 namespace llvm {
21 class MCAsmBackend;
22 class MCCodeEmitter;
23 class MCContext;
24 class MCInstrInfo;
25 class MCObjectWriter;
26 class MCRegisterInfo;
27 class MCSubtargetInfo;
28 class MCRelocationInfo;
29 class MCStreamer;
30 class Target;
31 class Triple;
32 class StringRef;
33 class raw_ostream;
35 
37 
38 /// Flavour of dwarf regnumbers
39 ///
40 namespace DWARFFlavour {
41  enum {
43  };
44 }
45 
46 /// Native X86 register numbers
47 ///
48 namespace N86 {
49  enum {
50  EAX = 0, ECX = 1, EDX = 2, EBX = 3, ESP = 4, EBP = 5, ESI = 6, EDI = 7
51  };
52 }
53 
54 namespace X86_MC {
55 std::string ParseX86Triple(const Triple &TT);
56 
57 unsigned getDwarfRegFlavour(const Triple &TT, bool isEH);
58 
60 
61 /// Create a X86 MCSubtargetInfo instance. This is exposed so Asm parser, etc.
62 /// do not need to go through TargetRegistry.
64  StringRef FS);
65 }
66 
68  const MCRegisterInfo &MRI,
69  MCContext &Ctx);
70 
72  const Triple &TT, StringRef CPU);
74  const Triple &TT, StringRef CPU);
75 
76 /// Construct an X86 Windows COFF machine code streamer which will generate
77 /// PE/COFF format object files.
78 ///
79 /// Takes ownership of \p AB and \p CE.
82  bool RelaxAll);
83 
84 /// Construct an X86 Mach-O object writer.
86  uint32_t CPUType,
87  uint32_t CPUSubtype);
88 
89 /// Construct an X86 ELF object writer.
91  uint8_t OSABI, uint16_t EMachine);
92 /// Construct an X86 Win COFF object writer.
94  bool Is64Bit);
95 
96 /// Construct X86-64 Mach-O relocation info.
98 
99 /// Construct X86-64 ELF relocation info.
101 } // End llvm namespace
102 
103 
104 // Defines symbolic names for X86 registers. This defines a mapping from
105 // register name to register number.
106 //
107 #define GET_REGINFO_ENUM
108 #include "X86GenRegisterInfo.inc"
109 
110 // Defines symbolic names for the X86 instructions.
111 //
112 #define GET_INSTRINFO_ENUM
113 #include "X86GenInstrInfo.inc"
114 
115 #define GET_SUBTARGETINFO_ENUM
116 #include "X86GenSubtargetInfo.inc"
117 
118 #endif
MCAsmBackend * createX86_64AsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU)
MCAsmBackend * createX86_32AsmBackend(const Target &T, const MCRegisterInfo &MRI, const Triple &TT, StringRef CPU)
unsigned getDwarfRegFlavour(const Triple &TT, bool isEH)
Defines the object file and target independent interfaces used by the assembler backend to write nati...
std::string ParseX86Triple(const Triple &TT)
MCObjectWriter * createX86WinCOFFObjectWriter(raw_pwrite_stream &OS, bool Is64Bit)
Construct an X86 Win COFF object writer.
MCCodeEmitter * createX86MCCodeEmitter(const MCInstrInfo &MCII, const MCRegisterInfo &MRI, MCContext &Ctx)
Target TheX86_64Target
Context object for machine code objects.
Definition: MCContext.h:48
MCRelocationInfo * createX86_64ELFRelocationInfo(MCContext &Ctx)
Construct X86-64 ELF relocation info.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Streaming machine code generation interface.
Definition: MCStreamer.h:157
MCObjectWriter * createX86MachObjectWriter(raw_pwrite_stream &OS, bool Is64Bit, uint32_t CPUType, uint32_t CPUSubtype)
Construct an X86 Mach-O object writer.
Target TheX86_32Target
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:23
Interface to description of machine instruction set.
Definition: MCInstrInfo.h:24
Create MCExprs from relocations found in an object file.
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
MCSubtargetInfo * createX86MCSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
Create a X86 MCSubtargetInfo instance.
void InitLLVM2SEHRegisterMapping(MCRegisterInfo *MRI)
MCRelocationInfo * createX86_64MachORelocationInfo(MCContext &Ctx)
Construct X86-64 Mach-O relocation info.
MCObjectWriter * createX86ELFObjectWriter(raw_pwrite_stream &OS, bool IsELF64, uint8_t OSABI, uint16_t EMachine)
Construct an X86 ELF object writer.
Target - Wrapper for Target specific information.
MCSubtargetInfo - Generic base class for all target subtargets.
MCStreamer * createX86WinCOFFStreamer(MCContext &C, MCAsmBackend &AB, raw_pwrite_stream &OS, MCCodeEmitter *CE, bool RelaxAll)
Construct an X86 Windows COFF machine code streamer which will generate PE/COFF format object files...
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:321
cl::opt< bool > RelaxAll("mc-relax-all", cl::desc("When used with filetype=obj, ""relax all fixups in the emitted object file"))
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:34
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40