Rename TargetDesc to MCTargetDesc
[oota-llvm.git] / lib / Target / X86 / X86.h
1 //===-- X86.h - Top-level interface for X86 representation ------*- 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 contains the entry points for global functions defined in the x86
11 // target library, as used by the LLVM JIT.
12 //
13 //===----------------------------------------------------------------------===//
14
15 #ifndef TARGET_X86_H
16 #define TARGET_X86_H
17
18 #include "llvm/Support/DataTypes.h"
19 #include "llvm/Target/TargetMachine.h"
20
21 namespace llvm {
22
23 class FunctionPass;
24 class JITCodeEmitter;
25 class MCCodeEmitter;
26 class MCContext;
27 class MCObjectWriter;
28 class MachineCodeEmitter;
29 class Target;
30 class TargetAsmBackend;
31 class X86TargetMachine;
32 class formatted_raw_ostream;
33 class raw_ostream;
34
35 /// createX86ISelDag - This pass converts a legalized DAG into a 
36 /// X86-specific DAG, ready for instruction scheduling.
37 ///
38 FunctionPass *createX86ISelDag(X86TargetMachine &TM,
39                                CodeGenOpt::Level OptLevel);
40
41 /// createGlobalBaseRegPass - This pass initializes a global base
42 /// register for PIC on x86-32.
43 FunctionPass* createGlobalBaseRegPass();
44
45 /// createX86FloatingPointStackifierPass - This function returns a pass which
46 /// converts floating point register references and pseudo instructions into
47 /// floating point stack references and physical instructions.
48 ///
49 FunctionPass *createX86FloatingPointStackifierPass();
50
51 /// createSSEDomainFixPass - This pass twiddles SSE opcodes to prevent domain
52 /// crossings.
53 FunctionPass *createSSEDomainFixPass();
54
55 /// createX86CodeEmitterPass - Return a pass that emits the collected X86 code
56 /// to the specified MCE object.
57 FunctionPass *createX86JITCodeEmitterPass(X86TargetMachine &TM,
58                                           JITCodeEmitter &JCE);
59
60 MCCodeEmitter *createX86_32MCCodeEmitter(const Target &, TargetMachine &TM,
61                                          MCContext &Ctx);
62 MCCodeEmitter *createX86_64MCCodeEmitter(const Target &, TargetMachine &TM,
63                                          MCContext &Ctx);
64
65 TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
66 TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
67
68 /// createX86EmitCodeToMemory - Returns a pass that converts a register
69 /// allocated function into raw machine code in a dynamically
70 /// allocated chunk of memory.
71 ///
72 FunctionPass *createEmitX86CodeToMemory();
73
74 /// createX86MaxStackAlignmentHeuristicPass - This function returns a pass
75 /// which determines whether the frame pointer register should be
76 /// reserved in case dynamic stack alignment is later required.
77 ///
78 FunctionPass *createX86MaxStackAlignmentHeuristicPass();
79
80
81 /// createX86MachObjectWriter - Construct an X86 Mach-O object writer.
82 MCObjectWriter *createX86MachObjectWriter(raw_ostream &OS,
83                                           bool Is64Bit,
84                                           uint32_t CPUType,
85                                           uint32_t CPUSubtype);
86
87 } // End llvm namespace
88
89 #include "MCTargetDesc/X86TargetDesc.h"
90
91 // Defines symbolic names for the X86 instructions.
92 //
93 #include "X86GenInstrNames.inc"
94
95 #endif