[llvm-commits] [llvm] r80193 - in /llvm/trunk: include/llvm/MC/MCCodeEmitter.h include/llvm/Target/TargetRegistry.h lib/MC/MCCodeEmitter.cpp tools/llvm-mc/llvm-mc.cpp
Daniel Dunbar
daniel at zuster.org
Wed Aug 26 18:34:23 PDT 2009
Author: ddunbar
Date: Wed Aug 26 20:34:22 2009
New Revision: 80193
URL: http://llvm.org/viewvc/llvm-project?rev=80193&view=rev
Log:
llvm-mc: Tweak MCCodeEmitter skeleton.
Added:
llvm/trunk/lib/MC/MCCodeEmitter.cpp
Modified:
llvm/trunk/include/llvm/MC/MCCodeEmitter.h
llvm/trunk/include/llvm/Target/TargetRegistry.h
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Modified: llvm/trunk/include/llvm/MC/MCCodeEmitter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCCodeEmitter.h?rev=80193&r1=80192&r2=80193&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCCodeEmitter.h (original)
+++ llvm/trunk/include/llvm/MC/MCCodeEmitter.h Wed Aug 26 20:34:22 2009
@@ -26,7 +26,7 @@
/// 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
Modified: llvm/trunk/include/llvm/Target/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegistry.h?rev=80193&r1=80192&r2=80193&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRegistry.h Wed Aug 26 20:34:22 2009
@@ -59,8 +59,7 @@
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 @@
}
/// 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 @@
}
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);
}
};
Added: llvm/trunk/lib/MC/MCCodeEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCCodeEmitter.cpp?rev=80193&view=auto
==============================================================================
--- llvm/trunk/lib/MC/MCCodeEmitter.cpp (added)
+++ llvm/trunk/lib/MC/MCCodeEmitter.cpp Wed Aug 26 20:34:22 2009
@@ -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() {
+}
Modified: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mc/llvm-mc.cpp?rev=80193&r1=80192&r2=80193&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp (original)
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp Wed Aug 26 20:34:22 2009
@@ -244,7 +244,7 @@
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!");
More information about the llvm-commits
mailing list