099e930a72411273887010dc8ad31e50f2067e87
[oota-llvm.git] / lib / Target / X86 / X86.h
1 //===-- X86.h - Top-level interface for X86 representation ------*- C++ -*-===//
2 //
3 // This file contains the entry points for global functions defined in the x86
4 // target library, as used by the LLVM JIT.
5 //
6 // FIXME: This file will be dramatically changed in the future
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef TARGET_X86_H
11 #define TARGET_X86_H
12
13 #include <iosfwd>
14 class TargetMachine;
15 class Pass;
16
17 /// createSimpleX86InstructionSelector - This pass converts an LLVM function
18 /// into a machine code representation is a very simple peep-hole fashion.  The
19 /// generated code sucks but the implementation is nice and simple.
20 ///
21 Pass *createSimpleX86InstructionSelector(TargetMachine &TM);
22
23 /// createSimpleRegisterAllocation - This function converts the specified
24 /// machine code function from SSA form to use explicit registers by spilling
25 /// every register.  Wow, great policy huh?
26 ///
27 Pass *createSimpleRegisterAllocator(TargetMachine &TM);
28 Pass *createLocalRegisterAllocator(TargetMachine &TM);
29
30 /// createX86CodePrinterPass - Print out the specified machine code function to
31 /// the specified stream.  This function should work regardless of whether or
32 /// not the function is in SSA form or not.
33 ///
34 Pass *createX86CodePrinterPass(TargetMachine &TM, std::ostream &O);
35
36 /// X86EmitCodeToMemory - This function converts a register allocated function
37 /// into raw machine code in a dynamically allocated chunk of memory.  A pointer
38 /// to the start of the function is returned.
39 ///
40 Pass *createEmitX86CodeToMemory(TargetMachine &TM);
41
42 // Put symbolic names in a namespace to avoid causing these to clash with all
43 // kinds of other things...
44 //
45 namespace X86 {
46   // Defines a large number of symbolic names for X86 registers.  This defines a
47   // mapping from register name to register number.
48   //
49   enum Register {
50 #define R(ENUM, NAME, FLAGS, TSFLAGS, A1, A2, A3) ENUM,
51 #include "X86RegisterInfo.def"
52   };
53
54   // This defines a large number of symbolic names for X86 instruction opcodes.
55   enum Opcode {
56 #define I(ENUM, NAME, BASEOPCODE, FLAGS, TSFLAGS, IMPDEFS, IMPUSES) ENUM,
57 #include "X86InstrInfo.def"
58   };
59 }
60
61 #endif