mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-24 09:29:42 +00:00
Stub out explicit MCELFObjectTargetWriter interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122067 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1f95a9db4b
commit
6024c97ffa
@ -14,11 +14,21 @@
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
|
||||
namespace llvm {
|
||||
class MCELFObjectTargetWriter {
|
||||
protected:
|
||||
MCELFObjectTargetWriter();
|
||||
|
||||
public:
|
||||
virtual ~MCELFObjectTargetWriter();
|
||||
};
|
||||
|
||||
/// \brief Construct a new ELF writer instance.
|
||||
///
|
||||
/// \param MOTW - The target specific ELF writer subclass.
|
||||
/// \param OS - The stream to write to.
|
||||
/// \returns The constructed object writer.
|
||||
MCObjectWriter *createELFObjectWriter(raw_ostream &OS, bool is64Bit,
|
||||
MCObjectWriter *createELFObjectWriter(MCELFObjectTargetWriter *MOTW,
|
||||
raw_ostream &OS, bool is64Bit,
|
||||
Triple::OSType OSType, uint16_t EMachine,
|
||||
bool IsLittleEndian,
|
||||
bool HasRelocationAddend);
|
||||
|
@ -8,6 +8,7 @@ add_llvm_library(LLVMMC
|
||||
MCCodeEmitter.cpp
|
||||
MCContext.cpp
|
||||
MCDisassembler.cpp
|
||||
MCELFObjectTargetWriter.cpp
|
||||
MCELFStreamer.cpp
|
||||
MCExpr.cpp
|
||||
MCInst.cpp
|
||||
|
@ -1467,7 +1467,8 @@ void ELFObjectWriter::WriteObject(MCAssembler &Asm,
|
||||
}
|
||||
}
|
||||
|
||||
MCObjectWriter *llvm::createELFObjectWriter(raw_ostream &OS,
|
||||
MCObjectWriter *llvm::createELFObjectWriter(MCELFObjectTargetWriter *MOTW,
|
||||
raw_ostream &OS,
|
||||
bool Is64Bit,
|
||||
Triple::OSType OSType,
|
||||
uint16_t EMachine,
|
||||
|
18
lib/MC/MCELFObjectTargetWriter.cpp
Normal file
18
lib/MC/MCELFObjectTargetWriter.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
//===-- MCELFObjectTargetWriter.cpp - ELF Target Writer Subclass ----------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/MCELFObjectWriter.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
MCELFObjectTargetWriter::MCELFObjectTargetWriter() {
|
||||
}
|
||||
|
||||
MCELFObjectTargetWriter::~MCELFObjectTargetWriter() {
|
||||
}
|
@ -37,6 +37,11 @@ public:
|
||||
/*UseAggressiveSymbolFolding=*/true) {}
|
||||
};
|
||||
|
||||
class ARMELFObjectWriter : public MCELFObjectTargetWriter {
|
||||
public:
|
||||
ARMELFObjectWriter() : MCELFObjectTargetWriter() {}
|
||||
};
|
||||
|
||||
class ARMAsmBackend : public TargetAsmBackend {
|
||||
bool isThumbMode; // Currently emitting Thumb code.
|
||||
public:
|
||||
@ -348,7 +353,8 @@ public:
|
||||
uint64_t Value) const;
|
||||
|
||||
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
|
||||
return createELFObjectWriter(OS, /*Is64Bit=*/false,
|
||||
return createELFObjectWriter(new ARMELFObjectWriter(), OS,
|
||||
/*Is64Bit=*/false,
|
||||
OSType, ELF::EM_ARM,
|
||||
/*IsLittleEndian=*/true,
|
||||
/*HasRelocationAddend=*/false);
|
||||
|
@ -42,6 +42,11 @@ static unsigned getFixupKindSize(unsigned Kind) {
|
||||
|
||||
|
||||
namespace {
|
||||
class MBlazeELFObjectWriter : public MCELFObjectTargetWriter {
|
||||
public:
|
||||
MBlazeELFObjectWriter() : MCELFObjectTargetWriter() {}
|
||||
};
|
||||
|
||||
class MBlazeAsmBackend : public TargetAsmBackend {
|
||||
public:
|
||||
MBlazeAsmBackend(const Target &T)
|
||||
@ -117,7 +122,8 @@ public:
|
||||
uint64_t Value) const;
|
||||
|
||||
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
|
||||
return createELFObjectWriter(OS,/*Is64Bit=*/false,
|
||||
return createELFObjectWriter(new MBlazeELFObjectWriter(),
|
||||
OS,/*Is64Bit=*/false,
|
||||
OSType, ELF::EM_MBLAZE,
|
||||
/*IsLittleEndian=*/false,
|
||||
/*HasRelocationAddend=*/true);
|
||||
|
@ -55,6 +55,11 @@ public:
|
||||
/*UseAggressiveSymbolFolding=*/Is64Bit) {}
|
||||
};
|
||||
|
||||
class X86ELFObjectWriter : public MCELFObjectTargetWriter {
|
||||
public:
|
||||
X86ELFObjectWriter() : MCELFObjectTargetWriter() {}
|
||||
};
|
||||
|
||||
class X86AsmBackend : public TargetAsmBackend {
|
||||
public:
|
||||
X86AsmBackend(const Target &T)
|
||||
@ -310,7 +315,8 @@ public:
|
||||
: ELFX86AsmBackend(T, OSType) {}
|
||||
|
||||
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
|
||||
return createELFObjectWriter(OS, /*Is64Bit=*/false,
|
||||
return createELFObjectWriter(new X86ELFObjectWriter(), OS,
|
||||
/*Is64Bit=*/false,
|
||||
OSType, ELF::EM_386,
|
||||
/*IsLittleEndian=*/true,
|
||||
/*HasRelocationAddend=*/false);
|
||||
@ -323,7 +329,7 @@ public:
|
||||
: ELFX86AsmBackend(T, OSType) {}
|
||||
|
||||
MCObjectWriter *createObjectWriter(raw_ostream &OS) const {
|
||||
return createELFObjectWriter(OS, /*Is64Bit=*/true,
|
||||
return createELFObjectWriter(new X86ELFObjectWriter(), OS, /*Is64Bit=*/true,
|
||||
OSType, ELF::EM_X86_64,
|
||||
/*IsLittleEndian=*/true,
|
||||
/*HasRelocationAddend=*/true);
|
||||
|
Loading…
Reference in New Issue
Block a user