1 //===- lib/MC/MCNullStreamer.cpp - Dummy Streamer Implementation ----------===//
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 #include "llvm/MC/MCStreamer.h"
12 #include "llvm/MC/MCContext.h"
13 #include "llvm/MC/MCInst.h"
14 #include "llvm/MC/MCSectionMachO.h"
15 #include "llvm/MC/MCSymbol.h"
21 class MCNullStreamer
: public MCStreamer
{
23 MCNullStreamer(MCContext
&Context
) : MCStreamer(Context
) {}
25 /// @name MCStreamer Interface
28 virtual void SwitchSection(const MCSection
*Section
) {
32 virtual void EmitLabel(MCSymbol
*Symbol
) {}
34 virtual void EmitAssemblerFlag(AssemblerFlag Flag
) {}
36 virtual void EmitAssignment(MCSymbol
*Symbol
, const MCExpr
*Value
) {}
38 virtual void EmitSymbolAttribute(MCSymbol
*Symbol
, SymbolAttr Attribute
) {}
40 virtual void EmitSymbolDesc(MCSymbol
*Symbol
, unsigned DescValue
) {}
42 virtual void EmitCommonSymbol(MCSymbol
*Symbol
, unsigned Size
,
43 unsigned ByteAlignment
) {}
45 virtual void EmitZerofill(const MCSection
*Section
, MCSymbol
*Symbol
= 0,
46 unsigned Size
= 0, unsigned ByteAlignment
= 0) {}
48 virtual void EmitBytes(const StringRef
&Data
) {}
50 virtual void EmitValue(const MCExpr
*Value
, unsigned Size
) {}
52 virtual void EmitValueToAlignment(unsigned ByteAlignment
, int64_t Value
= 0,
53 unsigned ValueSize
= 1,
54 unsigned MaxBytesToEmit
= 0) {}
56 virtual void EmitValueToOffset(const MCExpr
*Offset
,
57 unsigned char Value
= 0) {}
59 virtual void EmitInstruction(const MCInst
&Inst
) {}
61 virtual void Finish() {}
68 MCStreamer
*llvm::createNullStreamer(MCContext
&Context
) {
69 return new MCNullStreamer(Context
);