Move ARMMachObjectWriter to its own file.

Just tidy up a bit. No functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Jim Grosbach 2011-06-22 20:14:52 +00:00
parent a098bf1239
commit 2fc6898886
4 changed files with 43 additions and 14 deletions

View File

@ -27,6 +27,7 @@ class FunctionPass;
class JITCodeEmitter;
class formatted_raw_ostream;
class MCCodeEmitter;
class MCObjectWriter;
class TargetAsmBackend;
class MachineInstr;
class ARMAsmPrinter;
@ -58,6 +59,12 @@ extern Target TheARMTarget, TheThumbTarget;
void LowerARMMachineInstrToMCInst(const MachineInstr *MI, MCInst &OutMI,
ARMAsmPrinter &AP);
/// createARMMachObjectWriter - Construct an ARM Mach-O object writer.
MCObjectWriter *createARMMachObjectWriter(raw_ostream &OS,
bool Is64Bit,
uint32_t CPUType,
uint32_t CPUSubtype);
} // end namespace llvm;
#endif

View File

@ -28,14 +28,6 @@
using namespace llvm;
namespace {
class ARMMachObjectWriter : public MCMachObjectTargetWriter {
public:
ARMMachObjectWriter(bool Is64Bit, uint32_t CPUType,
uint32_t CPUSubtype)
: MCMachObjectTargetWriter(Is64Bit, CPUType, CPUSubtype,
/*UseAggressiveSymbolFolding=*/true) {}
};
class ARMELFObjectWriter : public MCELFObjectTargetWriter {
public:
ARMELFObjectWriter(Triple::OSType OSType)
@ -423,12 +415,9 @@ public:
: ARMAsmBackend(T), Subtype(st) { }
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
return createMachObjectWriter(new ARMMachObjectWriter(
/*Is64Bit=*/false,
return createARMMachObjectWriter(OS, /*Is64Bit=*/false,
object::mach::CTM_ARM,
Subtype),
OS,
/*IsLittleEndian=*/true);
Subtype);
}
void ApplyFixup(const MCFixup &Fixup, char *Data, unsigned DataSize,

View File

@ -0,0 +1,32 @@
//===-- ARMMachObjectWriter.cpp - ARM Mach Object Writer ------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "ARM.h"
#include "llvm/MC/MCMachObjectWriter.h"
using namespace llvm;
namespace {
class ARMMachObjectWriter : public MCMachObjectTargetWriter {
public:
ARMMachObjectWriter(bool Is64Bit, uint32_t CPUType,
uint32_t CPUSubtype)
: MCMachObjectTargetWriter(Is64Bit, CPUType, CPUSubtype,
/*UseAggressiveSymbolFolding=*/true) {}
};
}
MCObjectWriter *llvm::createARMMachObjectWriter(raw_ostream &OS,
bool Is64Bit,
uint32_t CPUType,
uint32_t CPUSubtype) {
return createMachObjectWriter(new ARMMachObjectWriter(Is64Bit,
CPUType,
CPUSubtype),
OS, /*IsLittleEndian=*/true);
}

View File

@ -34,6 +34,7 @@ add_llvm_target(ARMCodeGen
ARMISelLowering.cpp
ARMInstrInfo.cpp
ARMJITInfo.cpp
ARMMachObjectWriter.cpp
ARMMCCodeEmitter.cpp
ARMMCExpr.cpp
ARMLoadStoreOptimizer.cpp