1 //===- MCStreamer.h - High-level Streaming Machine Code Output --*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_MC_MCSTREAMER_H
11 #define LLVM_MC_MCSTREAMER_H
22 /// MCStreamer - Streaming machine code generation interface.
34 MCStreamer(const MCStreamer&); // DO NOT IMPLEMENT
35 MCStreamer &operator=(const MCStreamer&); // DO NOT IMPLEMENT
38 MCStreamer(MCContext &Ctx);
39 virtual ~MCStreamer();
41 MCContext &getContext() const { return Context; }
43 virtual void SwitchSection(MCSection *Sect) = 0;
45 virtual void EmitSymbol(MCSymbol *Sym);
46 virtual void EmitSymbolAssignment(MCSymbol *Sym, const MCImm &Value) = 0;
47 virtual void EmitSymbolAttribute(MCSymbol *Sym,
50 virtual void EmitBytes(const char *Data, unsigned Length) = 0;
51 virtual void EmitValue(const MCImm &Value, unsigned Size) = 0;
52 virtual void EmitInstruction(const MCInst &Inst) = 0;
55 MCStreamer *createAsmStreamer(MCContext &Ctx, raw_ostream &OS);
56 MCStreamer *createMachOStreamer(MCContext &Ctx, raw_ostream &OS);
57 MCStreamer *createELFStreamer(MCContext &Ctx, raw_ostream &OS);
59 } // end namespace llvm