Chris Lattner | 40ead95 | 2002-12-02 21:24:12 +0000 | [diff] [blame^] | 1 | //===-- X86/MachineCodeEmitter.cpp - Convert X86 code to machine code -----===// |
| 2 | // |
| 3 | // This file contains the pass that transforms the X86 machine instructions into |
| 4 | // actual executable machine code. |
| 5 | // |
| 6 | //===----------------------------------------------------------------------===// |
| 7 | |
| 8 | #include "X86TargetMachine.h" |
| 9 | #include "llvm/PassManager.h" |
| 10 | #include "llvm/CodeGen/MachineCodeEmitter.h" |
| 11 | |
| 12 | namespace { |
| 13 | struct Emitter : public FunctionPass { |
| 14 | TargetMachine &TM; |
| 15 | MachineCodeEmitter &MCE; |
| 16 | |
| 17 | Emitter(TargetMachine &tm, MachineCodeEmitter &mce) : TM(tm), MCE(mce) {} |
| 18 | ~Emitter() { |
| 19 | } |
| 20 | |
| 21 | bool runOnFunction(Function &F) { return false; } |
| 22 | }; |
| 23 | } |
| 24 | |
| 25 | |
| 26 | /// addPassesToEmitMachineCode - Add passes to the specified pass manager to get |
| 27 | /// machine code emitted. This uses a MAchineCodeEmitter object to handle |
| 28 | /// actually outputting the machine code and resolving things like the address |
| 29 | /// of functions. This method should returns true if machine code emission is |
| 30 | /// not supported. |
| 31 | /// |
| 32 | bool X86TargetMachine::addPassesToEmitMachineCode(PassManager &PM, |
| 33 | MachineCodeEmitter &MCE) { |
| 34 | PM.add(new Emitter(*this, MCE)); |
| 35 | return false; |
| 36 | } |