#ifndef MACHOCODEEMITTER_H
#define MACHOCODEEMITTER_H
-#include "MachOWriter.h"
+#include "llvm/CodeGen/ObjectCodeEmitter.h"
+#include <map>
namespace llvm {
+class MachOWriter;
+
/// MachOCodeEmitter - This class is used by the MachOWriter to emit the code
/// for functions to the Mach-O file.
/// machine directly, indicating what header values and flags to set.
bool is64Bit, isLittleEndian;
- const TargetAsmInfo *TAI;
+ const MCAsmInfo *MAI;
/// Relocations - These are the relocations that the function needs, as
/// emitted.
std::map<uint64_t, uintptr_t> Labels;
public:
- MachOCodeEmitter(MachOWriter &mow, MachOSection &mos) :
- ObjectCodeEmitter(&mos), MOW(mow), TM(MOW.TM) {
- is64Bit = TM.getTargetData()->getPointerSizeInBits() == 64;
- isLittleEndian = TM.getTargetData()->isLittleEndian();
- TAI = TM.getTargetAsmInfo();
- }
+ MachOCodeEmitter(MachOWriter &mow, MachOSection &mos);
virtual void startFunction(MachineFunction &MF);
virtual bool finishFunction(MachineFunction &MF);
virtual void addRelocation(const MachineRelocation &MR) {
Relocations.push_back(MR);
}
-
+
void emitConstantPool(MachineConstantPool *MCP);
void emitJumpTables(MachineJumpTableInfo *MJTI);