mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-04 17:56:53 +00:00
llvm-mc: Tweak MCCodeEmitter skeleton.
llvm-svn: 80193
This commit is contained in:
parent
1725fdd25d
commit
4316774ac1
@ -26,7 +26,7 @@ public:
|
||||
|
||||
/// EncodeInstruction - Encode the given \arg Inst to bytes on the output
|
||||
/// stream \arg OS.
|
||||
virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS) = 0;
|
||||
virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS) const = 0;
|
||||
};
|
||||
|
||||
} // End llvm namespace
|
||||
|
@ -59,8 +59,7 @@ namespace llvm {
|
||||
typedef TargetAsmParser *(*AsmParserCtorTy)(const Target &T,
|
||||
MCAsmParser &P);
|
||||
typedef MCCodeEmitter *(*CodeEmitterCtorTy)(const Target &T,
|
||||
TargetMachine &TM,
|
||||
const MCAsmInfo &MAI);
|
||||
TargetMachine &TM);
|
||||
|
||||
private:
|
||||
/// Next - The next registered target in the linked list, maintained by the
|
||||
@ -180,11 +179,10 @@ namespace llvm {
|
||||
}
|
||||
|
||||
/// createCodeEmitter - Create a target specific code emitter.
|
||||
MCCodeEmitter *createCodeEmitter(TargetMachine &TM,
|
||||
const MCAsmInfo *MAI) const {
|
||||
MCCodeEmitter *createCodeEmitter(TargetMachine &TM) const {
|
||||
if (!CodeEmitterCtorFn)
|
||||
return 0;
|
||||
return CodeEmitterCtorFn(*this, TM, *MAI);
|
||||
return CodeEmitterCtorFn(*this, TM);
|
||||
}
|
||||
|
||||
/// @}
|
||||
@ -493,9 +491,8 @@ namespace llvm {
|
||||
}
|
||||
|
||||
private:
|
||||
static MCCodeEmitter *Allocator(const Target &T, TargetMachine &TM,
|
||||
const MCAsmInfo &MAI) {
|
||||
return new CodeEmitterImpl(T, TM, MAI);
|
||||
static MCCodeEmitter *Allocator(const Target &T, TargetMachine &TM) {
|
||||
return new CodeEmitterImpl(T, TM);
|
||||
}
|
||||
};
|
||||
|
||||
|
18
lib/MC/MCCodeEmitter.cpp
Normal file
18
lib/MC/MCCodeEmitter.cpp
Normal file
@ -0,0 +1,18 @@
|
||||
//===-- MCCodeEmitter.cpp - Instruction Encoding --------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/MC/MCCodeEmitter.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
MCCodeEmitter::MCCodeEmitter() {
|
||||
}
|
||||
|
||||
MCCodeEmitter::~MCCodeEmitter() {
|
||||
}
|
@ -244,7 +244,7 @@ static int AssembleInput(const char *ProgName) {
|
||||
assert(TAI && "Unable to create target asm info!");
|
||||
|
||||
AP.reset(TheTarget->createAsmPrinter(*Out, *TM, TAI, true));
|
||||
CE.reset(TheTarget->createCodeEmitter(*TM, TAI));
|
||||
CE.reset(TheTarget->createCodeEmitter(*TM));
|
||||
Str.reset(createAsmStreamer(Ctx, *Out, *TAI, AP.get(), CE.get()));
|
||||
} else {
|
||||
assert(FileType == OFT_ObjectFile && "Invalid file type!");
|
||||
|
Loading…
Reference in New Issue
Block a user