diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-08-27 00:51:57 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-08-27 00:51:57 +0000 |
commit | 12266adfd9dc571aafb7ec7f8b69d85c7a6e352a (patch) | |
tree | aa5e672bdfb25a08c7310a64502a34a753511554 /include/llvm/MC | |
parent | adb77e4c37d183af9a2f29b6df8b0dfee562bbba (diff) | |
download | external_llvm-12266adfd9dc571aafb7ec7f8b69d85c7a6e352a.zip external_llvm-12266adfd9dc571aafb7ec7f8b69d85c7a6e352a.tar.gz external_llvm-12266adfd9dc571aafb7ec7f8b69d85c7a6e352a.tar.bz2 |
Sketch TargetRegistry support for MCCodeEmitter abstract interface.
- Of course, nothing actually can provide this interface yet.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/MC')
-rw-r--r-- | include/llvm/MC/MCCodeEmitter.h | 32 | ||||
-rw-r--r-- | include/llvm/MC/MCStreamer.h | 8 |
2 files changed, 37 insertions, 3 deletions
diff --git a/include/llvm/MC/MCCodeEmitter.h b/include/llvm/MC/MCCodeEmitter.h new file mode 100644 index 0000000..fdacb94 --- /dev/null +++ b/include/llvm/MC/MCCodeEmitter.h @@ -0,0 +1,32 @@ +//===-- llvm/MC/MCCodeEmitter.h - Instruction Encoding ----------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_MC_MCCODEEMITTER_H +#define LLVM_MC_MCCODEEMITTER_H + +namespace llvm { + +/// MCCodeEmitter - Generic instruction encoding interface. +class MCCodeEmitter { + MCCodeEmitter(const MCCodeEmitter &); // DO NOT IMPLEMENT + void operator=(const MCCodeEmitter &); // DO NOT IMPLEMENT +protected: // Can only create subclasses. + MCCodeEmitter(); + +public: + virtual ~MCCodeEmitter(); + + /// EncodeInstruction - Encode the given \arg Inst to bytes on the output + /// stream \arg OS. + virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS) = 0; +}; + +} // End llvm namespace + +#endif diff --git a/include/llvm/MC/MCStreamer.h b/include/llvm/MC/MCStreamer.h index e774104..bc7f543 100644 --- a/include/llvm/MC/MCStreamer.h +++ b/include/llvm/MC/MCStreamer.h @@ -18,14 +18,15 @@ namespace llvm { class AsmPrinter; + class MCAsmInfo; + class MCCodeEmitter; class MCContext; - class MCValue; class MCInst; class MCSection; class MCSymbol; + class MCValue; class StringRef; class raw_ostream; - class MCAsmInfo; /// MCStreamer - Streaming machine code generation interface. This interface /// is intended to provide a programatic interface that is very similar to the @@ -241,7 +242,8 @@ namespace llvm { /// /// \arg AP - If given, an AsmPrinter to use for printing instructions. MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS, - const MCAsmInfo &MAI, AsmPrinter *AP = 0); + const MCAsmInfo &MAI, AsmPrinter *AP = 0, + MCCodeEmitter *CE = 0); // FIXME: These two may end up getting rolled into a single // createObjectStreamer interface, which implements the assembler backend, and |