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