diff options
author | Chris Lattner <sabre@nondot.org> | 2002-12-02 21:24:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-12-02 21:24:12 +0000 |
commit | 40ead9592888c345d6514dff427ae67dfcf23805 (patch) | |
tree | 8a298aa0060de7a9f460becf66cbc94d6e5aeeef /lib/Target/X86/MachineCodeEmitter.cpp | |
parent | 18a171f34c5033d360f3c7e8a9813f09a04d6ed8 (diff) |
Initial support for machine code emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4866 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/MachineCodeEmitter.cpp')
-rw-r--r-- | lib/Target/X86/MachineCodeEmitter.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/Target/X86/MachineCodeEmitter.cpp b/lib/Target/X86/MachineCodeEmitter.cpp new file mode 100644 index 0000000000..ba82503e49 --- /dev/null +++ b/lib/Target/X86/MachineCodeEmitter.cpp @@ -0,0 +1,36 @@ +//===-- X86/MachineCodeEmitter.cpp - Convert X86 code to machine code -----===// +// +// This file contains the pass that transforms the X86 machine instructions into +// actual executable machine code. +// +//===----------------------------------------------------------------------===// + +#include "X86TargetMachine.h" +#include "llvm/PassManager.h" +#include "llvm/CodeGen/MachineCodeEmitter.h" + +namespace { + struct Emitter : public FunctionPass { + TargetMachine &TM; + MachineCodeEmitter &MCE; + + Emitter(TargetMachine &tm, MachineCodeEmitter &mce) : TM(tm), MCE(mce) {} + ~Emitter() { + } + + bool runOnFunction(Function &F) { return false; } + }; +} + + +/// addPassesToEmitMachineCode - Add passes to the specified pass manager to get +/// machine code emitted. This uses a MAchineCodeEmitter object to handle +/// actually outputting the machine code and resolving things like the address +/// of functions. This method should returns true if machine code emission is +/// not supported. +/// +bool X86TargetMachine::addPassesToEmitMachineCode(PassManager &PM, + MachineCodeEmitter &MCE) { + PM.add(new Emitter(*this, MCE)); + return false; +} |