mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-02 16:56:50 +00:00
Make ivars private and use getters. Have the MachOWriter return "Mach-O
Writer" for the pass name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de268f7dcf
commit
2b7218218f
@ -85,11 +85,13 @@ namespace llvm {
|
||||
MachineCodeEmitter &getMachineCodeEmitter() const {
|
||||
return *(MachineCodeEmitter*)MCE;
|
||||
}
|
||||
virtual ~MachOWriter();
|
||||
|
||||
~MachOWriter();
|
||||
virtual const char *getPassName() const {
|
||||
return "Mach-O Writer";
|
||||
}
|
||||
|
||||
typedef std::vector<unsigned char> DataBuffer;
|
||||
|
||||
protected:
|
||||
MachOWriter(std::ostream &O, TargetMachine &TM);
|
||||
|
||||
|
@ -24,10 +24,10 @@ namespace llvm {
|
||||
// TargetMachOWriterInfo
|
||||
//===--------------------------------------------------------------------===//
|
||||
|
||||
struct TargetMachOWriterInfo {
|
||||
class TargetMachOWriterInfo {
|
||||
uint32_t CPUType; // CPU specifier
|
||||
uint32_t CPUSubType; // Machine specifier
|
||||
|
||||
public:
|
||||
// The various CPU_TYPE_* constants are already defined by at least one
|
||||
// system header file and create compilation errors if not respected.
|
||||
#if !defined(CPU_TYPE_I386)
|
||||
@ -93,9 +93,8 @@ namespace llvm {
|
||||
virtual MachineRelocation GetJTRelocation(unsigned Offset,
|
||||
MachineBasicBlock *MBB) const;
|
||||
|
||||
virtual const char *getPassName() const {
|
||||
return "Mach-O Writer";
|
||||
}
|
||||
uint32_t getCPUType() const { return CPUType; }
|
||||
uint32_t getCPUSubType() const { return CPUSubType; }
|
||||
};
|
||||
|
||||
} // end llvm namespace
|
||||
|
@ -461,8 +461,8 @@ void MachOWriter::EmitHeaderAndLoadCommands() {
|
||||
OutputBuffer FHOut(FH, is64Bit, isLittleEndian);
|
||||
|
||||
FHOut.outword(Header.magic);
|
||||
FHOut.outword(TM.getMachOWriterInfo()->CPUType);
|
||||
FHOut.outword(TM.getMachOWriterInfo()->CPUSubType);
|
||||
FHOut.outword(TM.getMachOWriterInfo()->getCPUType());
|
||||
FHOut.outword(TM.getMachOWriterInfo()->getCPUSubType());
|
||||
FHOut.outword(Header.filetype);
|
||||
FHOut.outword(Header.ncmds);
|
||||
FHOut.outword(Header.sizeofcmds);
|
||||
|
@ -21,13 +21,10 @@ namespace llvm {
|
||||
// Forward declarations
|
||||
class PPCTargetMachine;
|
||||
|
||||
struct PPCMachOWriterInfo : public TargetMachOWriterInfo {
|
||||
class PPCMachOWriterInfo : public TargetMachOWriterInfo {
|
||||
public:
|
||||
PPCMachOWriterInfo(const PPCTargetMachine &TM);
|
||||
virtual ~PPCMachOWriterInfo() {}
|
||||
|
||||
virtual const char *getPassName() const {
|
||||
return "PowerPC Mach-O Writer";
|
||||
}
|
||||
};
|
||||
|
||||
} // end llvm namespace
|
||||
|
Loading…
Reference in New Issue
Block a user