1 //===-- X86/MachineCodeEmitter.cpp - Convert X86 code to machine code -----===//
3 // This file contains the pass that transforms the X86 machine instructions into
4 // actual executable machine code.
6 //===----------------------------------------------------------------------===//
8 #include "X86TargetMachine.h"
9 #include "llvm/PassManager.h"
10 #include "llvm/CodeGen/MachineCodeEmitter.h"
13 struct Emitter : public FunctionPass {
15 MachineCodeEmitter &MCE;
17 Emitter(TargetMachine &tm, MachineCodeEmitter &mce) : TM(tm), MCE(mce) {}
21 bool runOnFunction(Function &F) { return false; }
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
32 bool X86TargetMachine::addPassesToEmitMachineCode(PassManager &PM,
33 MachineCodeEmitter &MCE) {
34 PM.add(new Emitter(*this, MCE));