mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-03 08:51:43 +00:00
Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
llvm-svn: 136010
This commit is contained in:
parent
50291d09da
commit
2a0a4e1a73
@ -1,4 +1,4 @@
|
||||
//===-- llvm/MC/TargetAsmBackend.h - Target Asm Backend ---------*- C++ -*-===//
|
||||
//===-- llvm/MC/MCAsmBack.h - MC Asm Backend --------------------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@ -7,8 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_MC_TARGETASMBACKEND_H
|
||||
#define LLVM_MC_TARGETASMBACKEND_H
|
||||
#ifndef LLVM_MC_MCASMBACKEND_H
|
||||
#define LLVM_MC_MCASMBACKEND_H
|
||||
|
||||
#include "llvm/MC/MCDirectives.h"
|
||||
#include "llvm/MC/MCFixup.h"
|
||||
@ -25,17 +25,17 @@ template<typename T>
|
||||
class SmallVectorImpl;
|
||||
class raw_ostream;
|
||||
|
||||
/// TargetAsmBackend - Generic interface to target specific assembler backends.
|
||||
class TargetAsmBackend {
|
||||
TargetAsmBackend(const TargetAsmBackend &); // DO NOT IMPLEMENT
|
||||
void operator=(const TargetAsmBackend &); // DO NOT IMPLEMENT
|
||||
/// MCAsmBackend - Generic interface to target specific assembler backends.
|
||||
class MCAsmBackend {
|
||||
MCAsmBackend(const MCAsmBackend &); // DO NOT IMPLEMENT
|
||||
void operator=(const MCAsmBackend &); // DO NOT IMPLEMENT
|
||||
protected: // Can only create subclasses.
|
||||
TargetAsmBackend();
|
||||
MCAsmBackend();
|
||||
|
||||
unsigned HasReliableSymbolDifference : 1;
|
||||
|
||||
public:
|
||||
virtual ~TargetAsmBackend();
|
||||
virtual ~MCAsmBackend();
|
||||
|
||||
/// createObjectWriter - Create a new MCObjectWriter instance for use by the
|
||||
/// assembler backend to emit the final object file.
|
@ -10,14 +10,14 @@
|
||||
#ifndef LLVM_MC_MCASSEMBLER_H
|
||||
#define LLVM_MC_MCASSEMBLER_H
|
||||
|
||||
#include "llvm/MC/MCFixup.h"
|
||||
#include "llvm/MC/MCInst.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/SmallPtrSet.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/ilist.h"
|
||||
#include "llvm/ADT/ilist_node.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
#include "llvm/MC/MCFixup.h"
|
||||
#include "llvm/MC/MCInst.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include <vector> // FIXME: Shouldn't be needed.
|
||||
|
||||
@ -36,7 +36,7 @@ class MCSectionData;
|
||||
class MCSymbol;
|
||||
class MCSymbolData;
|
||||
class MCValue;
|
||||
class TargetAsmBackend;
|
||||
class MCAsmBackend;
|
||||
|
||||
class MCFragment : public ilist_node<MCFragment> {
|
||||
friend class MCAsmLayout;
|
||||
@ -660,7 +660,7 @@ private:
|
||||
|
||||
MCContext &Context;
|
||||
|
||||
TargetAsmBackend &Backend;
|
||||
MCAsmBackend &Backend;
|
||||
|
||||
MCCodeEmitter &Emitter;
|
||||
|
||||
@ -780,14 +780,14 @@ public:
|
||||
// concrete and require clients to pass in a target like object. The other
|
||||
// option is to make this abstract, and have targets provide concrete
|
||||
// implementations as we do with AsmParser.
|
||||
MCAssembler(MCContext &Context_, TargetAsmBackend &Backend_,
|
||||
MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
|
||||
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_,
|
||||
raw_ostream &OS);
|
||||
~MCAssembler();
|
||||
|
||||
MCContext &getContext() const { return Context; }
|
||||
|
||||
TargetAsmBackend &getBackend() const { return Backend; }
|
||||
MCAsmBackend &getBackend() const { return Backend; }
|
||||
|
||||
MCCodeEmitter &getEmitter() const { return Emitter; }
|
||||
|
||||
|
@ -19,7 +19,7 @@ class MCSectionData;
|
||||
class MCExpr;
|
||||
class MCFragment;
|
||||
class MCDataFragment;
|
||||
class TargetAsmBackend;
|
||||
class MCAsmBackend;
|
||||
class raw_ostream;
|
||||
|
||||
/// \brief Streaming object file generation interface.
|
||||
@ -36,9 +36,9 @@ class MCObjectStreamer : public MCStreamer {
|
||||
virtual void EmitInstToData(const MCInst &Inst) = 0;
|
||||
|
||||
protected:
|
||||
MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &_OS, MCCodeEmitter *_Emitter);
|
||||
MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &_OS, MCCodeEmitter *_Emitter,
|
||||
MCAssembler *_Assembler);
|
||||
~MCObjectStreamer();
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "llvm/ADT/SmallVector.h"
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmBackend;
|
||||
class MCAsmInfo;
|
||||
class MCCodeEmitter;
|
||||
class MCContext;
|
||||
@ -31,7 +32,6 @@ namespace llvm {
|
||||
class MCSection;
|
||||
class MCSymbol;
|
||||
class StringRef;
|
||||
class TargetAsmBackend;
|
||||
class TargetLoweringObjectFile;
|
||||
class Twine;
|
||||
class raw_ostream;
|
||||
@ -563,14 +563,14 @@ namespace llvm {
|
||||
bool useCFI,
|
||||
MCInstPrinter *InstPrint = 0,
|
||||
MCCodeEmitter *CE = 0,
|
||||
TargetAsmBackend *TAB = 0,
|
||||
MCAsmBackend *TAB = 0,
|
||||
bool ShowInst = false);
|
||||
|
||||
/// createMachOStreamer - Create a machine code streamer which will generate
|
||||
/// Mach-O format object files.
|
||||
///
|
||||
/// Takes ownership of \arg TAB and \arg CE.
|
||||
MCStreamer *createMachOStreamer(MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCStreamer *createMachOStreamer(MCContext &Ctx, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *CE,
|
||||
bool RelaxAll = false);
|
||||
|
||||
@ -579,13 +579,13 @@ namespace llvm {
|
||||
///
|
||||
/// Takes ownership of \arg TAB and \arg CE.
|
||||
MCStreamer *createWinCOFFStreamer(MCContext &Ctx,
|
||||
TargetAsmBackend &TAB,
|
||||
MCAsmBackend &TAB,
|
||||
MCCodeEmitter &CE, raw_ostream &OS,
|
||||
bool RelaxAll = false);
|
||||
|
||||
/// createELFStreamer - Create a machine code streamer which will generate
|
||||
/// ELF format object files.
|
||||
MCStreamer *createELFStreamer(MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCStreamer *createELFStreamer(MCContext &Ctx, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *CE,
|
||||
bool RelaxAll, bool NoExecStack);
|
||||
|
||||
@ -599,7 +599,7 @@ namespace llvm {
|
||||
/// "pure" MC object files, for use with MC-JIT and testing tools.
|
||||
///
|
||||
/// Takes ownership of \arg TAB and \arg CE.
|
||||
MCStreamer *createPureStreamer(MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCStreamer *createPureStreamer(MCContext &Ctx, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *CE);
|
||||
|
||||
} // end namespace llvm
|
||||
|
@ -39,7 +39,7 @@ namespace llvm {
|
||||
class MCStreamer;
|
||||
class MCSubtargetInfo;
|
||||
class MCCodeGenInfo;
|
||||
class TargetAsmBackend;
|
||||
class MCAsmBackend;
|
||||
class TargetAsmLexer;
|
||||
class TargetAsmParser;
|
||||
class TargetMachine;
|
||||
@ -51,7 +51,7 @@ namespace llvm {
|
||||
bool useLoc, bool useCFI,
|
||||
MCInstPrinter *InstPrint,
|
||||
MCCodeEmitter *CE,
|
||||
TargetAsmBackend *TAB,
|
||||
MCAsmBackend *TAB,
|
||||
bool ShowInst);
|
||||
|
||||
/// Target - Wrapper for Target specific information.
|
||||
@ -86,8 +86,7 @@ namespace llvm {
|
||||
CodeModel::Model CM);
|
||||
typedef AsmPrinter *(*AsmPrinterCtorTy)(TargetMachine &TM,
|
||||
MCStreamer &Streamer);
|
||||
typedef TargetAsmBackend *(*AsmBackendCtorTy)(const Target &T,
|
||||
const std::string &TT);
|
||||
typedef MCAsmBackend *(*MCAsmBackendCtorTy)(const Target &T, StringRef TT);
|
||||
typedef TargetAsmLexer *(*AsmLexerCtorTy)(const Target &T,
|
||||
const MCRegisterInfo &MRI,
|
||||
const MCAsmInfo &MAI);
|
||||
@ -103,7 +102,7 @@ namespace llvm {
|
||||
typedef MCStreamer *(*ObjectStreamerCtorTy)(const Target &T,
|
||||
const std::string &TT,
|
||||
MCContext &Ctx,
|
||||
TargetAsmBackend &TAB,
|
||||
MCAsmBackend &TAB,
|
||||
raw_ostream &_OS,
|
||||
MCCodeEmitter *_Emitter,
|
||||
bool RelaxAll,
|
||||
@ -115,7 +114,7 @@ namespace llvm {
|
||||
bool useCFI,
|
||||
MCInstPrinter *InstPrint,
|
||||
MCCodeEmitter *CE,
|
||||
TargetAsmBackend *TAB,
|
||||
MCAsmBackend *TAB,
|
||||
bool ShowInst);
|
||||
|
||||
private:
|
||||
@ -160,9 +159,9 @@ namespace llvm {
|
||||
/// TargetMachine, if registered.
|
||||
TargetMachineCtorTy TargetMachineCtorFn;
|
||||
|
||||
/// AsmBackendCtorFn - Construction function for this target's
|
||||
/// TargetAsmBackend, if registered.
|
||||
AsmBackendCtorTy AsmBackendCtorFn;
|
||||
/// MCAsmBackendCtorFn - Construction function for this target's
|
||||
/// MCAsmBackend, if registered.
|
||||
MCAsmBackendCtorTy MCAsmBackendCtorFn;
|
||||
|
||||
/// AsmLexerCtorFn - Construction function for this target's TargetAsmLexer,
|
||||
/// if registered.
|
||||
@ -221,8 +220,8 @@ namespace llvm {
|
||||
/// hasTargetMachine - Check if this target supports code generation.
|
||||
bool hasTargetMachine() const { return TargetMachineCtorFn != 0; }
|
||||
|
||||
/// hasAsmBackend - Check if this target supports .o generation.
|
||||
bool hasAsmBackend() const { return AsmBackendCtorFn != 0; }
|
||||
/// hasMCAsmBackend - Check if this target supports .o generation.
|
||||
bool hasMCAsmBackend() const { return MCAsmBackendCtorFn != 0; }
|
||||
|
||||
/// hasAsmLexer - Check if this target supports .s lexing.
|
||||
bool hasAsmLexer() const { return AsmLexerCtorFn != 0; }
|
||||
@ -322,14 +321,14 @@ namespace llvm {
|
||||
return TargetMachineCtorFn(*this, Triple, CPU, Features, RM, CM);
|
||||
}
|
||||
|
||||
/// createAsmBackend - Create a target specific assembly parser.
|
||||
/// createMCAsmBackend - Create a target specific assembly parser.
|
||||
///
|
||||
/// \arg Triple - The target triple string.
|
||||
/// \arg Backend - The target independent assembler object.
|
||||
TargetAsmBackend *createAsmBackend(const std::string &Triple) const {
|
||||
if (!AsmBackendCtorFn)
|
||||
MCAsmBackend *createMCAsmBackend(StringRef Triple) const {
|
||||
if (!MCAsmBackendCtorFn)
|
||||
return 0;
|
||||
return AsmBackendCtorFn(*this, Triple);
|
||||
return MCAsmBackendCtorFn(*this, Triple);
|
||||
}
|
||||
|
||||
/// createAsmLexer - Create a target specific assembly lexer.
|
||||
@ -393,7 +392,7 @@ namespace llvm {
|
||||
/// \arg RelaxAll - Relax all fixups?
|
||||
/// \arg NoExecStack - Mark file as not needing a executable stack.
|
||||
MCStreamer *createObjectStreamer(const std::string &TT, MCContext &Ctx,
|
||||
TargetAsmBackend &TAB,
|
||||
MCAsmBackend &TAB,
|
||||
raw_ostream &_OS,
|
||||
MCCodeEmitter *_Emitter,
|
||||
bool RelaxAll,
|
||||
@ -412,7 +411,7 @@ namespace llvm {
|
||||
bool useCFI,
|
||||
MCInstPrinter *InstPrint,
|
||||
MCCodeEmitter *CE,
|
||||
TargetAsmBackend *TAB,
|
||||
MCAsmBackend *TAB,
|
||||
bool ShowInst) const {
|
||||
// AsmStreamerCtorFn is default to llvm::createAsmStreamer
|
||||
return AsmStreamerCtorFn(Ctx, OS, isVerboseAsm, useLoc, useCFI,
|
||||
@ -605,7 +604,7 @@ namespace llvm {
|
||||
T.TargetMachineCtorFn = Fn;
|
||||
}
|
||||
|
||||
/// RegisterAsmBackend - Register a TargetAsmBackend implementation for the
|
||||
/// RegisterMCAsmBackend - Register a MCAsmBackend implementation for the
|
||||
/// given target.
|
||||
///
|
||||
/// Clients are responsible for ensuring that registration doesn't occur
|
||||
@ -614,9 +613,9 @@ namespace llvm {
|
||||
///
|
||||
/// @param T - The target being registered.
|
||||
/// @param Fn - A function to construct an AsmBackend for the target.
|
||||
static void RegisterAsmBackend(Target &T, Target::AsmBackendCtorTy Fn) {
|
||||
if (!T.AsmBackendCtorFn)
|
||||
T.AsmBackendCtorFn = Fn;
|
||||
static void RegisterMCAsmBackend(Target &T, Target::MCAsmBackendCtorTy Fn) {
|
||||
if (!T.MCAsmBackendCtorFn)
|
||||
T.MCAsmBackendCtorFn = Fn;
|
||||
}
|
||||
|
||||
/// RegisterAsmLexer - Register a TargetAsmLexer implementation for the
|
||||
@ -956,23 +955,22 @@ namespace llvm {
|
||||
}
|
||||
};
|
||||
|
||||
/// RegisterAsmBackend - Helper template for registering a target specific
|
||||
/// RegisterMCAsmBackend - Helper template for registering a target specific
|
||||
/// assembler backend. Usage:
|
||||
///
|
||||
/// extern "C" void LLVMInitializeFooAsmBackend() {
|
||||
/// extern "C" void LLVMInitializeFooMCAsmBackend() {
|
||||
/// extern Target TheFooTarget;
|
||||
/// RegisterAsmBackend<FooAsmLexer> X(TheFooTarget);
|
||||
/// RegisterMCAsmBackend<FooAsmLexer> X(TheFooTarget);
|
||||
/// }
|
||||
template<class AsmBackendImpl>
|
||||
struct RegisterAsmBackend {
|
||||
RegisterAsmBackend(Target &T) {
|
||||
TargetRegistry::RegisterAsmBackend(T, &Allocator);
|
||||
template<class MCAsmBackendImpl>
|
||||
struct RegisterMCAsmBackend {
|
||||
RegisterMCAsmBackend(Target &T) {
|
||||
TargetRegistry::RegisterMCAsmBackend(T, &Allocator);
|
||||
}
|
||||
|
||||
private:
|
||||
static TargetAsmBackend *Allocator(const Target &T,
|
||||
const std::string &Triple) {
|
||||
return new AsmBackendImpl(T, Triple);
|
||||
static MCAsmBackend *Allocator(const Target &T, StringRef Triple) {
|
||||
return new MCAsmBackendImpl(T, Triple);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -137,11 +137,11 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
||||
|
||||
// Create a code emitter if asked to show the encoding.
|
||||
MCCodeEmitter *MCE = 0;
|
||||
TargetAsmBackend *TAB = 0;
|
||||
MCAsmBackend *MAB = 0;
|
||||
if (ShowMCEncoding) {
|
||||
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
||||
MCE = getTarget().createCodeEmitter(*getInstrInfo(), STI, *Context);
|
||||
TAB = getTarget().createAsmBackend(getTargetTriple());
|
||||
MAB = getTarget().createMCAsmBackend(getTargetTriple());
|
||||
}
|
||||
|
||||
MCStreamer *S = getTarget().createAsmStreamer(*Context, Out,
|
||||
@ -149,7 +149,7 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
||||
hasMCUseLoc(),
|
||||
hasMCUseCFI(),
|
||||
InstPrinter,
|
||||
MCE, TAB,
|
||||
MCE, MAB,
|
||||
ShowMCInst);
|
||||
AsmStreamer.reset(S);
|
||||
break;
|
||||
@ -160,12 +160,12 @@ bool LLVMTargetMachine::addPassesToEmitFile(PassManagerBase &PM,
|
||||
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
||||
MCCodeEmitter *MCE = getTarget().createCodeEmitter(*getInstrInfo(), STI,
|
||||
*Context);
|
||||
TargetAsmBackend *TAB = getTarget().createAsmBackend(getTargetTriple());
|
||||
if (MCE == 0 || TAB == 0)
|
||||
MCAsmBackend *MAB = getTarget().createMCAsmBackend(getTargetTriple());
|
||||
if (MCE == 0 || MAB == 0)
|
||||
return true;
|
||||
|
||||
AsmStreamer.reset(getTarget().createObjectStreamer(getTargetTriple(),
|
||||
*Context, *TAB, Out, MCE,
|
||||
*Context, *MAB, Out, MCE,
|
||||
hasMCRelaxAll(),
|
||||
hasMCNoExecStack()));
|
||||
AsmStreamer.get()->InitSections();
|
||||
@ -237,13 +237,13 @@ bool LLVMTargetMachine::addPassesToEmitMC(PassManagerBase &PM,
|
||||
// emission fails.
|
||||
const MCSubtargetInfo &STI = getSubtarget<MCSubtargetInfo>();
|
||||
MCCodeEmitter *MCE = getTarget().createCodeEmitter(*getInstrInfo(),STI, *Ctx);
|
||||
TargetAsmBackend *TAB = getTarget().createAsmBackend(getTargetTriple());
|
||||
if (MCE == 0 || TAB == 0)
|
||||
MCAsmBackend *MAB = getTarget().createMCAsmBackend(getTargetTriple());
|
||||
if (MCE == 0 || MAB == 0)
|
||||
return true;
|
||||
|
||||
OwningPtr<MCStreamer> AsmStreamer;
|
||||
AsmStreamer.reset(getTarget().createObjectStreamer(getTargetTriple(), *Ctx,
|
||||
*TAB, Out, MCE,
|
||||
*MAB, Out, MCE,
|
||||
hasMCRelaxAll(),
|
||||
hasMCNoExecStack()));
|
||||
AsmStreamer.get()->InitSections();
|
||||
|
@ -15,12 +15,12 @@
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmLayout.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCSectionELF.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/ELF.h"
|
||||
|
@ -1,4 +1,4 @@
|
||||
//===-- TargetAsmBackend.cpp - Target Assembly Backend ---------------------==//
|
||||
//===-- MCAsmBackend.cpp - Target MC Assembly Backend ----------------------==//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
@ -7,19 +7,19 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
using namespace llvm;
|
||||
|
||||
TargetAsmBackend::TargetAsmBackend()
|
||||
MCAsmBackend::MCAsmBackend()
|
||||
: HasReliableSymbolDifference(false)
|
||||
{
|
||||
}
|
||||
|
||||
TargetAsmBackend::~TargetAsmBackend() {
|
||||
MCAsmBackend::~MCAsmBackend() {
|
||||
}
|
||||
|
||||
const MCFixupKindInfo &
|
||||
TargetAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
|
||||
MCAsmBackend::getFixupKindInfo(MCFixupKind Kind) const {
|
||||
static const MCFixupKindInfo Builtins[] = {
|
||||
{ "FK_Data_1", 0, 8, 0 },
|
||||
{ "FK_Data_2", 0, 16, 0 },
|
@ -19,7 +19,7 @@
|
||||
#include "llvm/MC/MCSectionCOFF.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/ADT/OwningPtr.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
@ -41,7 +41,7 @@ protected:
|
||||
private:
|
||||
OwningPtr<MCInstPrinter> InstPrinter;
|
||||
OwningPtr<MCCodeEmitter> Emitter;
|
||||
OwningPtr<TargetAsmBackend> AsmBackend;
|
||||
OwningPtr<MCAsmBackend> AsmBackend;
|
||||
|
||||
SmallString<128> CommentToEmit;
|
||||
raw_svector_ostream CommentStream;
|
||||
@ -64,7 +64,7 @@ public:
|
||||
MCAsmStreamer(MCContext &Context, formatted_raw_ostream &os,
|
||||
bool isVerboseAsm, bool useLoc, bool useCFI,
|
||||
MCInstPrinter *printer, MCCodeEmitter *emitter,
|
||||
TargetAsmBackend *asmbackend,
|
||||
MCAsmBackend *asmbackend,
|
||||
bool showInst)
|
||||
: MCStreamer(Context), OS(os), MAI(Context.getAsmInfo()),
|
||||
InstPrinter(printer), Emitter(emitter), AsmBackend(asmbackend),
|
||||
@ -1262,8 +1262,8 @@ MCStreamer *llvm::createAsmStreamer(MCContext &Context,
|
||||
formatted_raw_ostream &OS,
|
||||
bool isVerboseAsm, bool useLoc,
|
||||
bool useCFI, MCInstPrinter *IP,
|
||||
MCCodeEmitter *CE, TargetAsmBackend *TAB,
|
||||
MCCodeEmitter *CE, MCAsmBackend *MAB,
|
||||
bool ShowInst) {
|
||||
return new MCAsmStreamer(Context, OS, isVerboseAsm, useLoc, useCFI,
|
||||
IP, CE, TAB, ShowInst);
|
||||
IP, CE, MAB, ShowInst);
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/MCDwarf.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/ADT/OwningPtr.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
@ -194,7 +194,7 @@ MCSymbolData::MCSymbolData(const MCSymbol &_Symbol, MCFragment *_Fragment,
|
||||
|
||||
/* *** */
|
||||
|
||||
MCAssembler::MCAssembler(MCContext &Context_, TargetAsmBackend &Backend_,
|
||||
MCAssembler::MCAssembler(MCContext &Context_, MCAsmBackend &Backend_,
|
||||
MCCodeEmitter &Emitter_, MCObjectWriter &Writer_,
|
||||
raw_ostream &OS_)
|
||||
: Context(Context_), Backend(Backend_), Emitter(Emitter_), Writer(Writer_),
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCELFSymbolFlags.h"
|
||||
#include "llvm/MC/MCFixupKindInfo.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/Support/ELF.h"
|
||||
|
||||
namespace llvm {
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "llvm/MC/MCSection.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/ELF.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@ -374,10 +374,10 @@ void MCELFStreamer::Finish() {
|
||||
this->MCObjectStreamer::Finish();
|
||||
}
|
||||
|
||||
MCStreamer *llvm::createELFStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCStreamer *llvm::createELFStreamer(MCContext &Context, MCAsmBackend &MAB,
|
||||
raw_ostream &OS, MCCodeEmitter *CE,
|
||||
bool RelaxAll, bool NoExecStack) {
|
||||
MCELFStreamer *S = new MCELFStreamer(Context, TAB, OS, CE);
|
||||
MCELFStreamer *S = new MCELFStreamer(Context, MAB, OS, CE);
|
||||
if (RelaxAll)
|
||||
S->getAssembler().setRelaxAll(true);
|
||||
if (NoExecStack)
|
||||
|
@ -25,11 +25,11 @@ namespace llvm {
|
||||
|
||||
class MCELFStreamer : public MCObjectStreamer {
|
||||
public:
|
||||
MCELFStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCELFStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter)
|
||||
: MCObjectStreamer(Context, TAB, OS, Emitter) {}
|
||||
|
||||
MCELFStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCELFStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter,
|
||||
MCAssembler *Assembler)
|
||||
: MCObjectStreamer(Context, TAB, OS, Emitter, Assembler) {}
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
using namespace llvm;
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "llvm/MC/MCMachOSymbolFlags.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/MCDwarf.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
@ -34,9 +34,9 @@ private:
|
||||
virtual void EmitInstToData(const MCInst &Inst);
|
||||
|
||||
public:
|
||||
MCMachOStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCMachOStreamer(MCContext &Context, MCAsmBackend &MAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter)
|
||||
: MCObjectStreamer(Context, TAB, OS, Emitter) {}
|
||||
: MCObjectStreamer(Context, MAB, OS, Emitter) {}
|
||||
|
||||
/// @name MCStreamer Interface
|
||||
/// @{
|
||||
@ -410,10 +410,10 @@ void MCMachOStreamer::Finish() {
|
||||
this->MCObjectStreamer::Finish();
|
||||
}
|
||||
|
||||
MCStreamer *llvm::createMachOStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCStreamer *llvm::createMachOStreamer(MCContext &Context, MCAsmBackend &MAB,
|
||||
raw_ostream &OS, MCCodeEmitter *CE,
|
||||
bool RelaxAll) {
|
||||
MCMachOStreamer *S = new MCMachOStreamer(Context, TAB, OS, CE);
|
||||
MCMachOStreamer *S = new MCMachOStreamer(Context, MAB, OS, CE);
|
||||
if (RelaxAll)
|
||||
S->getAssembler().setRelaxAll(true);
|
||||
return S;
|
||||
|
@ -17,10 +17,10 @@
|
||||
#include "llvm/MC/MCDwarf.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
using namespace llvm;
|
||||
|
||||
MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCObjectStreamer::MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter_)
|
||||
: MCStreamer(Context),
|
||||
Assembler(new MCAssembler(Context, TAB,
|
||||
@ -30,7 +30,7 @@ MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
{
|
||||
}
|
||||
|
||||
MCObjectStreamer::MCObjectStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCObjectStreamer::MCObjectStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter_,
|
||||
MCAssembler *_Assembler)
|
||||
: MCStreamer(Context), Assembler(_Assembler), CurSectionData(0)
|
||||
|
@ -28,7 +28,7 @@ private:
|
||||
virtual void EmitInstToData(const MCInst &Inst);
|
||||
|
||||
public:
|
||||
MCPureStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCPureStreamer(MCContext &Context, MCAsmBackend &TAB,
|
||||
raw_ostream &OS, MCCodeEmitter *Emitter)
|
||||
: MCObjectStreamer(Context, TAB, OS, Emitter) {}
|
||||
|
||||
@ -228,7 +228,7 @@ void MCPureStreamer::Finish() {
|
||||
this->MCObjectStreamer::Finish();
|
||||
}
|
||||
|
||||
MCStreamer *llvm::createPureStreamer(MCContext &Context, TargetAsmBackend &TAB,
|
||||
MCStreamer *llvm::createPureStreamer(MCContext &Context, MCAsmBackend &MAB,
|
||||
raw_ostream &OS, MCCodeEmitter *CE) {
|
||||
return new MCPureStreamer(Context, TAB, OS, CE);
|
||||
return new MCPureStreamer(Context, MAB, OS, CE);
|
||||
}
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmLayout.h"
|
||||
#include "llvm/MC/MCExpr.h"
|
||||
#include "llvm/MC/MCObjectWriter.h"
|
||||
@ -19,7 +20,6 @@
|
||||
#include "llvm/MC/MCSymbol.h"
|
||||
#include "llvm/MC/MCMachOSymbolFlags.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/Object/MachOFormat.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "llvm/MC/MCCodeEmitter.h"
|
||||
#include "llvm/MC/MCSectionCOFF.h"
|
||||
#include "llvm/MC/MCWin64EH.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/ADT/StringMap.h"
|
||||
|
||||
@ -40,7 +40,7 @@ public:
|
||||
MCSymbol const *CurSymbol;
|
||||
|
||||
WinCOFFStreamer(MCContext &Context,
|
||||
TargetAsmBackend &TAB,
|
||||
MCAsmBackend &MAB,
|
||||
MCCodeEmitter &CE,
|
||||
raw_ostream &OS);
|
||||
|
||||
@ -123,10 +123,10 @@ private:
|
||||
} // end anonymous namespace.
|
||||
|
||||
WinCOFFStreamer::WinCOFFStreamer(MCContext &Context,
|
||||
TargetAsmBackend &TAB,
|
||||
MCAsmBackend &MAB,
|
||||
MCCodeEmitter &CE,
|
||||
raw_ostream &OS)
|
||||
: MCObjectStreamer(Context, TAB, OS, &CE)
|
||||
: MCObjectStreamer(Context, MAB, OS, &CE)
|
||||
, CurSymbol(NULL) {
|
||||
}
|
||||
|
||||
@ -395,11 +395,11 @@ void WinCOFFStreamer::Finish() {
|
||||
namespace llvm
|
||||
{
|
||||
MCStreamer *createWinCOFFStreamer(MCContext &Context,
|
||||
TargetAsmBackend &TAB,
|
||||
MCAsmBackend &MAB,
|
||||
MCCodeEmitter &CE,
|
||||
raw_ostream &OS,
|
||||
bool RelaxAll) {
|
||||
WinCOFFStreamer *S = new WinCOFFStreamer(Context, TAB, CE, OS);
|
||||
WinCOFFStreamer *S = new WinCOFFStreamer(Context, MAB, CE, OS);
|
||||
S->getAssembler().setRelaxAll(RelaxAll);
|
||||
return S;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "llvm/MC/MCObjectWriter.h"
|
||||
#include "llvm/MC/MCSectionELF.h"
|
||||
#include "llvm/MC/MCSectionMachO.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/Object/MachOFormat.h"
|
||||
#include "llvm/Support/ELF.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
@ -34,10 +34,10 @@ public:
|
||||
/*HasRelocationAddend*/ false) {}
|
||||
};
|
||||
|
||||
class ARMAsmBackend : public TargetAsmBackend {
|
||||
class ARMAsmBackend : public MCAsmBackend {
|
||||
bool isThumbMode; // Currently emitting Thumb code.
|
||||
public:
|
||||
ARMAsmBackend(const Target &T) : TargetAsmBackend(), isThumbMode(false) {}
|
||||
ARMAsmBackend(const Target &T) : MCAsmBackend(), isThumbMode(false) {}
|
||||
|
||||
unsigned getNumFixupKinds() const { return ARM::NumTargetFixupKinds; }
|
||||
|
||||
@ -80,7 +80,7 @@ public:
|
||||
};
|
||||
|
||||
if (Kind < FirstTargetFixupKind)
|
||||
return TargetAsmBackend::getFixupKindInfo(Kind);
|
||||
return MCAsmBackend::getFixupKindInfo(Kind);
|
||||
|
||||
assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() &&
|
||||
"Invalid kind!");
|
||||
@ -491,8 +491,7 @@ void DarwinARMAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data,
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
TargetAsmBackend *llvm::createARMAsmBackend(const Target &T,
|
||||
const std::string &TT) {
|
||||
MCAsmBackend *llvm::createARMAsmBackend(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSDarwin()) {
|
||||
|
@ -133,7 +133,7 @@ static MCCodeGenInfo *createARMMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
|
||||
// This is duplicated code. Refactor this.
|
||||
static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCContext &Ctx, MCAsmBackend &MAB,
|
||||
raw_ostream &OS,
|
||||
MCCodeEmitter *Emitter,
|
||||
bool RelaxAll,
|
||||
@ -141,14 +141,14 @@ static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSDarwin())
|
||||
return createMachOStreamer(Ctx, TAB, OS, Emitter, RelaxAll);
|
||||
return createMachOStreamer(Ctx, MAB, OS, Emitter, RelaxAll);
|
||||
|
||||
if (TheTriple.isOSWindows()) {
|
||||
llvm_unreachable("ARM does not support Windows COFF format");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return createELFStreamer(Ctx, TAB, OS, Emitter, RelaxAll, NoExecStack);
|
||||
return createELFStreamer(Ctx, MAB, OS, Emitter, RelaxAll, NoExecStack);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createARMMCInstPrinter(const Target &T,
|
||||
@ -189,8 +189,8 @@ extern "C" void LLVMInitializeARMTargetMC() {
|
||||
TargetRegistry::RegisterCodeEmitter(TheThumbTarget, createARMMCCodeEmitter);
|
||||
|
||||
// Register the asm backend.
|
||||
TargetRegistry::RegisterAsmBackend(TheARMTarget, createARMAsmBackend);
|
||||
TargetRegistry::RegisterAsmBackend(TheThumbTarget, createARMAsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(TheARMTarget, createARMAsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(TheThumbTarget, createARMAsmBackend);
|
||||
|
||||
// Register the object streamer.
|
||||
TargetRegistry::RegisterObjectStreamer(TheARMTarget, createMCStreamer);
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmBackend;
|
||||
class MCCodeEmitter;
|
||||
class MCContext;
|
||||
class MCInstrInfo;
|
||||
@ -25,7 +26,6 @@ class MCObjectWriter;
|
||||
class MCSubtargetInfo;
|
||||
class StringRef;
|
||||
class Target;
|
||||
class TargetAsmBackend;
|
||||
class raw_ostream;
|
||||
|
||||
extern Target TheARMTarget, TheThumbTarget;
|
||||
@ -44,7 +44,7 @@ MCCodeEmitter *createARMMCCodeEmitter(const MCInstrInfo &MCII,
|
||||
const MCSubtargetInfo &STI,
|
||||
MCContext &Ctx);
|
||||
|
||||
TargetAsmBackend *createARMAsmBackend(const Target&, const std::string &);
|
||||
MCAsmBackend *createARMAsmBackend(const Target &T, StringRef TT);
|
||||
|
||||
/// createARMMachObjectWriter - Construct an ARM Mach-O object writer.
|
||||
MCObjectWriter *createARMMachObjectWriter(raw_ostream &OS,
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include "llvm/MC/MCFixup.h"
|
||||
#include "llvm/MC/MCFixupKindInfo.h"
|
||||
#include "llvm/MC/MCValue.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/Object/MachOFormat.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
using namespace llvm;
|
||||
|
@ -8,7 +8,7 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "MCTargetDesc/MBlazeMCTargetDesc.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/MC/MCAssembler.h"
|
||||
#include "llvm/MC/MCAsmLayout.h"
|
||||
#include "llvm/MC/MCELFObjectWriter.h"
|
||||
@ -46,10 +46,10 @@ public:
|
||||
/*HasRelocationAddend*/ true) {}
|
||||
};
|
||||
|
||||
class MBlazeAsmBackend : public TargetAsmBackend {
|
||||
class MBlazeAsmBackend : public MCAsmBackend {
|
||||
public:
|
||||
MBlazeAsmBackend(const Target &T)
|
||||
: TargetAsmBackend() {
|
||||
: MCAsmBackend() {
|
||||
}
|
||||
|
||||
unsigned getNumFixupKinds() const {
|
||||
@ -146,8 +146,7 @@ void ELFMBlazeAsmBackend::ApplyFixup(const MCFixup &Fixup, char *Data,
|
||||
}
|
||||
} // end anonymous namespace
|
||||
|
||||
TargetAsmBackend *llvm::createMBlazeAsmBackend(const Target &T,
|
||||
const std::string &TT) {
|
||||
MCAsmBackend *llvm::createMBlazeAsmBackend(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSDarwin())
|
||||
|
@ -72,7 +72,7 @@ static MCCodeGenInfo *createMBlazeMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
}
|
||||
|
||||
static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCContext &Ctx, MCAsmBackend &MAB,
|
||||
raw_ostream &_OS,
|
||||
MCCodeEmitter *_Emitter,
|
||||
bool RelaxAll,
|
||||
@ -89,7 +89,7 @@ static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return createELFStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll, NoExecStack);
|
||||
return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createMBlazeMCInstPrinter(const Target &T,
|
||||
@ -125,8 +125,8 @@ extern "C" void LLVMInitializeMBlazeTargetMC() {
|
||||
llvm::createMBlazeMCCodeEmitter);
|
||||
|
||||
// Register the asm backend
|
||||
TargetRegistry::RegisterAsmBackend(TheMBlazeTarget,
|
||||
createMBlazeAsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(TheMBlazeTarget,
|
||||
createMBlazeAsmBackend);
|
||||
|
||||
// Register the object streamer
|
||||
TargetRegistry::RegisterObjectStreamer(TheMBlazeTarget,
|
||||
|
@ -14,15 +14,13 @@
|
||||
#ifndef MBLAZEMCTARGETDESC_H
|
||||
#define MBLAZEMCTARGETDESC_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmBackend;
|
||||
class MCContext;
|
||||
class MCCodeEmitter;
|
||||
class MCInstrInfo;
|
||||
class MCSubtargetInfo;
|
||||
class Target;
|
||||
class TargetAsmBackend;
|
||||
class StringRef;
|
||||
class formatted_raw_ostream;
|
||||
|
||||
@ -32,7 +30,7 @@ MCCodeEmitter *createMBlazeMCCodeEmitter(const MCInstrInfo &MCII,
|
||||
const MCSubtargetInfo &STI,
|
||||
MCContext &Ctx);
|
||||
|
||||
TargetAsmBackend *createMBlazeAsmBackend(const Target &, const std::string &);
|
||||
MCAsmBackend *createMBlazeAsmBackend(const Target &T, StringRef TT);
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
|
@ -533,7 +533,7 @@ namespace llvm {
|
||||
formatted_raw_ostream &OS,
|
||||
bool isVerboseAsm, bool useLoc, bool useCFI,
|
||||
MCInstPrinter *IP,
|
||||
MCCodeEmitter *CE, TargetAsmBackend *TAB,
|
||||
MCCodeEmitter *CE, MCAsmBackend *MAB,
|
||||
bool ShowInst) {
|
||||
return new PTXMCAsmStreamer(Context, OS, isVerboseAsm, useLoc,
|
||||
IP, CE, ShowInst);
|
||||
|
@ -25,7 +25,7 @@ namespace llvm {
|
||||
bool useCFI,
|
||||
MCInstPrinter *InstPrint,
|
||||
MCCodeEmitter *CE,
|
||||
TargetAsmBackend *TAB,
|
||||
MCAsmBackend *MAB,
|
||||
bool ShowInst);
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "MCTargetDesc/PPCMCTargetDesc.h"
|
||||
#include "MCTargetDesc/PPCFixupKinds.h"
|
||||
#include "llvm/MC/MCMachObjectWriter.h"
|
||||
@ -31,10 +31,10 @@ public:
|
||||
MCValue Target, uint64_t &FixedValue) {}
|
||||
};
|
||||
|
||||
class PPCAsmBackend : public TargetAsmBackend {
|
||||
class PPCAsmBackend : public MCAsmBackend {
|
||||
const Target &TheTarget;
|
||||
public:
|
||||
PPCAsmBackend(const Target &T) : TargetAsmBackend(), TheTarget(T) {}
|
||||
PPCAsmBackend(const Target &T) : MCAsmBackend(), TheTarget(T) {}
|
||||
|
||||
unsigned getNumFixupKinds() const { return PPC::NumTargetFixupKinds; }
|
||||
|
||||
@ -49,7 +49,7 @@ public:
|
||||
};
|
||||
|
||||
if (Kind < FirstTargetFixupKind)
|
||||
return TargetAsmBackend::getFixupKindInfo(Kind);
|
||||
return MCAsmBackend::getFixupKindInfo(Kind);
|
||||
|
||||
assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() &&
|
||||
"Invalid kind!");
|
||||
@ -114,8 +114,7 @@ namespace {
|
||||
|
||||
|
||||
|
||||
TargetAsmBackend *llvm::createPPCAsmBackend(const Target &T,
|
||||
const std::string &TT) {
|
||||
MCAsmBackend *llvm::createPPCAsmBackend(const Target &T, StringRef TT) {
|
||||
if (Triple(TT).isOSDarwin())
|
||||
return new DarwinPPCAsmBackend(T);
|
||||
|
||||
|
@ -91,13 +91,13 @@ static MCCodeGenInfo *createPPCMCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
|
||||
// This is duplicated code. Refactor this.
|
||||
static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCContext &Ctx, MCAsmBackend &MAB,
|
||||
raw_ostream &OS,
|
||||
MCCodeEmitter *Emitter,
|
||||
bool RelaxAll,
|
||||
bool NoExecStack) {
|
||||
if (Triple(TT).isOSDarwin())
|
||||
return createMachOStreamer(Ctx, TAB, OS, Emitter, RelaxAll);
|
||||
return createMachOStreamer(Ctx, MAB, OS, Emitter, RelaxAll);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
@ -136,8 +136,8 @@ extern "C" void LLVMInitializePowerPCTargetMC() {
|
||||
TargetRegistry::RegisterCodeEmitter(ThePPC64Target, createPPCMCCodeEmitter);
|
||||
|
||||
// Register the asm backend.
|
||||
TargetRegistry::RegisterAsmBackend(ThePPC32Target, createPPCAsmBackend);
|
||||
TargetRegistry::RegisterAsmBackend(ThePPC64Target, createPPCAsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(ThePPC32Target, createPPCAsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(ThePPC64Target, createPPCAsmBackend);
|
||||
|
||||
// Register the object streamer.
|
||||
TargetRegistry::RegisterObjectStreamer(ThePPC32Target, createMCStreamer);
|
||||
|
@ -14,15 +14,13 @@
|
||||
#ifndef PPCMCTARGETDESC_H
|
||||
#define PPCMCTARGETDESC_H
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmBackend;
|
||||
class MCCodeEmitter;
|
||||
class MCContext;
|
||||
class MCInstrInfo;
|
||||
class MCSubtargetInfo;
|
||||
class Target;
|
||||
class TargetAsmBackend;
|
||||
class StringRef;
|
||||
|
||||
extern Target ThePPC32Target;
|
||||
@ -32,7 +30,7 @@ MCCodeEmitter *createPPCMCCodeEmitter(const MCInstrInfo &MCII,
|
||||
const MCSubtargetInfo &STI,
|
||||
MCContext &Ctx);
|
||||
|
||||
TargetAsmBackend *createPPCAsmBackend(const Target &, const std::string &);
|
||||
MCAsmBackend *createPPCAsmBackend(const Target &T, StringRef TT);
|
||||
|
||||
} // End llvm namespace
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "MCTargetDesc/X86BaseInfo.h"
|
||||
#include "MCTargetDesc/X86FixupKinds.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
@ -62,10 +62,10 @@ public:
|
||||
: MCELFObjectTargetWriter(is64Bit, OSType, EMachine, HasRelocationAddend) {}
|
||||
};
|
||||
|
||||
class X86AsmBackend : public TargetAsmBackend {
|
||||
class X86AsmBackend : public MCAsmBackend {
|
||||
public:
|
||||
X86AsmBackend(const Target &T)
|
||||
: TargetAsmBackend() {}
|
||||
: MCAsmBackend() {}
|
||||
|
||||
unsigned getNumFixupKinds() const {
|
||||
return X86::NumTargetFixupKinds;
|
||||
@ -80,7 +80,7 @@ public:
|
||||
};
|
||||
|
||||
if (Kind < FirstTargetFixupKind)
|
||||
return TargetAsmBackend::getFixupKindInfo(Kind);
|
||||
return MCAsmBackend::getFixupKindInfo(Kind);
|
||||
|
||||
assert(unsigned(Kind - FirstTargetFixupKind) < getNumFixupKinds() &&
|
||||
"Invalid kind!");
|
||||
@ -425,8 +425,7 @@ public:
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
|
||||
const std::string &TT) {
|
||||
MCAsmBackend *llvm::createX86_32AsmBackend(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSDarwin() || TheTriple.getEnvironment() == Triple::MachO)
|
||||
@ -438,8 +437,7 @@ TargetAsmBackend *llvm::createX86_32AsmBackend(const Target &T,
|
||||
return new ELFX86_32AsmBackend(T, TheTriple.getOS());
|
||||
}
|
||||
|
||||
TargetAsmBackend *llvm::createX86_64AsmBackend(const Target &T,
|
||||
const std::string &TT) {
|
||||
MCAsmBackend *llvm::createX86_64AsmBackend(const Target &T, StringRef TT) {
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSDarwin() || TheTriple.getEnvironment() == Triple::MachO)
|
||||
|
@ -367,7 +367,7 @@ static MCCodeGenInfo *createX86MCCodeGenInfo(StringRef TT, Reloc::Model RM,
|
||||
}
|
||||
|
||||
static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
MCContext &Ctx, TargetAsmBackend &TAB,
|
||||
MCContext &Ctx, MCAsmBackend &MAB,
|
||||
raw_ostream &_OS,
|
||||
MCCodeEmitter *_Emitter,
|
||||
bool RelaxAll,
|
||||
@ -375,12 +375,12 @@ static MCStreamer *createMCStreamer(const Target &T, const std::string &TT,
|
||||
Triple TheTriple(TT);
|
||||
|
||||
if (TheTriple.isOSDarwin() || TheTriple.getEnvironment() == Triple::MachO)
|
||||
return createMachOStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll);
|
||||
return createMachOStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll);
|
||||
|
||||
if (TheTriple.isOSWindows())
|
||||
return createWinCOFFStreamer(Ctx, TAB, *_Emitter, _OS, RelaxAll);
|
||||
return createWinCOFFStreamer(Ctx, MAB, *_Emitter, _OS, RelaxAll);
|
||||
|
||||
return createELFStreamer(Ctx, TAB, _OS, _Emitter, RelaxAll, NoExecStack);
|
||||
return createELFStreamer(Ctx, MAB, _OS, _Emitter, RelaxAll, NoExecStack);
|
||||
}
|
||||
|
||||
static MCInstPrinter *createX86MCInstPrinter(const Target &T,
|
||||
@ -424,10 +424,10 @@ extern "C" void LLVMInitializeX86TargetMC() {
|
||||
createX86MCCodeEmitter);
|
||||
|
||||
// Register the asm backend.
|
||||
TargetRegistry::RegisterAsmBackend(TheX86_32Target,
|
||||
createX86_32AsmBackend);
|
||||
TargetRegistry::RegisterAsmBackend(TheX86_64Target,
|
||||
createX86_64AsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(TheX86_32Target,
|
||||
createX86_32AsmBackend);
|
||||
TargetRegistry::RegisterMCAsmBackend(TheX86_64Target,
|
||||
createX86_64AsmBackend);
|
||||
|
||||
// Register the object streamer.
|
||||
TargetRegistry::RegisterObjectStreamer(TheX86_32Target,
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <string>
|
||||
|
||||
namespace llvm {
|
||||
class MCAsmBackend;
|
||||
class MCCodeEmitter;
|
||||
class MCContext;
|
||||
class MCInstrInfo;
|
||||
@ -25,7 +26,6 @@ class MCObjectWriter;
|
||||
class MCRegisterInfo;
|
||||
class MCSubtargetInfo;
|
||||
class Target;
|
||||
class TargetAsmBackend;
|
||||
class StringRef;
|
||||
class raw_ostream;
|
||||
|
||||
@ -74,8 +74,8 @@ MCCodeEmitter *createX86MCCodeEmitter(const MCInstrInfo &MCII,
|
||||
const MCSubtargetInfo &STI,
|
||||
MCContext &Ctx);
|
||||
|
||||
TargetAsmBackend *createX86_32AsmBackend(const Target &, const std::string &);
|
||||
TargetAsmBackend *createX86_64AsmBackend(const Target &, const std::string &);
|
||||
MCAsmBackend *createX86_32AsmBackend(const Target &T, StringRef TT);
|
||||
MCAsmBackend *createX86_64AsmBackend(const Target &T, StringRef TT);
|
||||
|
||||
/// createX86MachObjectWriter - Construct an X86 Mach-O object writer.
|
||||
MCObjectWriter *createX86MachObjectWriter(raw_ostream &OS,
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "llvm/MC/MCParser/AsmLexer.h"
|
||||
#include "llvm/MC/MCParser/MCAsmLexer.h"
|
||||
#include "llvm/MC/MCAsmBackend.h"
|
||||
#include "llvm/MC/MCContext.h"
|
||||
#include "llvm/MC/MCCodeEmitter.h"
|
||||
#include "llvm/MC/MCInstPrinter.h"
|
||||
@ -24,7 +25,6 @@
|
||||
#include "llvm/MC/MCStreamer.h"
|
||||
#include "llvm/MC/MCSubtargetInfo.h"
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
#include "llvm/MC/TargetAsmBackend.h"
|
||||
#include "llvm/MC/TargetAsmParser.h"
|
||||
#include "llvm/Target/TargetRegistry.h"
|
||||
#include "llvm/Target/TargetSelect.h"
|
||||
@ -368,22 +368,22 @@ static int AssembleInput(const char *ProgName) {
|
||||
MCInstPrinter *IP =
|
||||
TheTarget->createMCInstPrinter(OutputAsmVariant, *MAI);
|
||||
MCCodeEmitter *CE = 0;
|
||||
TargetAsmBackend *TAB = 0;
|
||||
MCAsmBackend *MAB = 0;
|
||||
if (ShowEncoding) {
|
||||
CE = TheTarget->createCodeEmitter(*MCII, *STI, Ctx);
|
||||
TAB = TheTarget->createAsmBackend(TripleName);
|
||||
MAB = TheTarget->createMCAsmBackend(TripleName);
|
||||
}
|
||||
Str.reset(TheTarget->createAsmStreamer(Ctx, FOS, /*asmverbose*/true,
|
||||
/*useLoc*/ true,
|
||||
/*useCFI*/ true, IP, CE, TAB,
|
||||
/*useCFI*/ true, IP, CE, MAB,
|
||||
ShowInst));
|
||||
} else if (FileType == OFT_Null) {
|
||||
Str.reset(createNullStreamer(Ctx));
|
||||
} else {
|
||||
assert(FileType == OFT_ObjectFile && "Invalid file type!");
|
||||
MCCodeEmitter *CE = TheTarget->createCodeEmitter(*MCII, *STI, Ctx);
|
||||
TargetAsmBackend *TAB = TheTarget->createAsmBackend(TripleName);
|
||||
Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *TAB,
|
||||
MCAsmBackend *MAB = TheTarget->createMCAsmBackend(TripleName);
|
||||
Str.reset(TheTarget->createObjectStreamer(TripleName, Ctx, *MAB,
|
||||
FOS, CE, RelaxAll,
|
||||
NoExecStack));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user