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"
16 #include "llvm/MC/MCValue.h"
22 class MCNullStreamer
: public MCStreamer
{
24 MCNullStreamer(MCContext
&Context
) : MCStreamer(Context
) {}
26 /// @name MCStreamer Interface
29 virtual void SwitchSection(MCSection
*Section
) {}
31 virtual void EmitLabel(MCSymbol
*Symbol
) {}
33 virtual void EmitAssemblerFlag(AssemblerFlag Flag
) {}
35 virtual void EmitAssignment(MCSymbol
*Symbol
, const MCValue
&Value
,
36 bool MakeAbsolute
= false) {}
38 virtual void EmitSymbolAttribute(MCSymbol
*Symbol
, SymbolAttr Attribute
) {}
40 virtual void EmitSymbolDesc(MCSymbol
*Symbol
, unsigned DescValue
) {}
42 virtual void EmitLocalSymbol(MCSymbol
*Symbol
, const MCValue
&Value
) {}
44 virtual void EmitCommonSymbol(MCSymbol
*Symbol
, unsigned Size
,
45 unsigned Pow2Alignment
, bool IsLocal
) {}
47 virtual void EmitZerofill(MCSection
*Section
, MCSymbol
*Symbol
= NULL
,
48 unsigned Size
= 0, unsigned Pow2Alignment
= 0) {}
50 virtual void EmitBytes(const StringRef
&Data
) {}
52 virtual void EmitValue(const MCValue
&Value
, unsigned Size
) {}
54 virtual void EmitValueToAlignment(unsigned ByteAlignment
, int64_t Value
= 0,
55 unsigned ValueSize
= 1,
56 unsigned MaxBytesToEmit
= 0) {}
58 virtual void EmitValueToOffset(const MCValue
&Offset
,
59 unsigned char Value
= 0) {}
61 virtual void EmitInstruction(const MCInst
&Inst
) {}
63 virtual void Finish() {}
70 MCStreamer
*llvm::createNullStreamer(MCContext
&Context
) {
71 return new MCNullStreamer(Context
);