diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-07-06 05:09:34 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2009-07-06 05:09:34 +0000 |
commit | 5661ea68e7ad13cbc166f6ec0f349af773369b5b (patch) | |
tree | 6e61eab3a2d47168f32e41462b4a71a14fbc12f8 /llvm/lib/CodeGen/MachOWriter.h | |
parent | 1fb1cf4e26c18f9763e528dfbbc1c2efd3112d7b (diff) | |
download | bcm5719-llvm-5661ea68e7ad13cbc166f6ec0f349af773369b5b.tar.gz bcm5719-llvm-5661ea68e7ad13cbc166f6ec0f349af773369b5b.zip |
Add the Object Code Emitter class. Original patch by Aaron Gray, I did some
cleanup, removed some #includes and moved Object Code Emitter out-of-line.
llvm-svn: 74813
Diffstat (limited to 'llvm/lib/CodeGen/MachOWriter.h')
-rw-r--r-- | llvm/lib/CodeGen/MachOWriter.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/MachOWriter.h b/llvm/lib/CodeGen/MachOWriter.h index 3af2b0af4b7..9f5b7c5ad31 100644 --- a/llvm/lib/CodeGen/MachOWriter.h +++ b/llvm/lib/CodeGen/MachOWriter.h @@ -15,17 +15,24 @@ #define MACHOWRITER_H #include "MachO.h" +#include "llvm/Constants.h" +#include "llvm/DerivedTypes.h" #include "llvm/CodeGen/MachineFunctionPass.h" +#include "llvm/CodeGen/ObjectCodeEmitter.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetMachOWriterInfo.h" +#include <vector> #include <map> namespace llvm { class GlobalVariable; class Mangler; - class MachineCodeEmitter; + class MachineRelocation; + class ObjectCodeEmitter; class MachOCodeEmitter; + class TargetData; + class TargetMachine; class OutputBuffer; class raw_ostream; @@ -38,8 +45,9 @@ namespace llvm { friend class MachOCodeEmitter; public: static char ID; - MachineCodeEmitter &getMachineCodeEmitter() const { - return *(MachineCodeEmitter*)MCE; + + ObjectCodeEmitter *getObjectCodeEmitter() { + return reinterpret_cast<ObjectCodeEmitter*>(MachOCE); } MachOWriter(raw_ostream &O, TargetMachine &TM); @@ -62,10 +70,10 @@ namespace llvm { /// Mangler *Mang; - /// MCE - The MachineCodeEmitter object that we are exposing to emit machine + /// MachOCE - The MachineCodeEmitter object that we are exposing to emit machine /// code for functions to the .o file. - MachOCodeEmitter *MCE; + MachOCodeEmitter *MachOCE; /// is64Bit/isLittleEndian - This information is inferred from the target /// machine directly, indicating what header values and flags to set. @@ -225,9 +233,10 @@ namespace llvm { /// SymbolTable to aid in emitting the DYSYMTAB load command. std::vector<unsigned> DynamicSymbolTable; - static void InitMem(const Constant *C, void *Addr, intptr_t Offset, + static void InitMem(const Constant *C, + uintptr_t Offset, const TargetData *TD, - std::vector<MachineRelocation> &MRs); + MachOSection* mos); private: void AddSymbolToSection(MachOSection *MOS, GlobalVariable *GV); |