blob: 46e9ebfa8868f505b9eb7889826e8f31a79a04ce [file] [log] [blame]
Shih-wei Liaoe264f622010-02-10 11:10:31 -08001//===- lib/MC/MCNullStreamer.cpp - Dummy Streamer Implementation ----------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10#include "llvm/MC/MCStreamer.h"
11
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
17using namespace llvm;
18
19namespace {
20
21 class MCNullStreamer : public MCStreamer {
22 public:
23 MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
24
25 /// @name MCStreamer Interface
26 /// @{
27
28 virtual void SwitchSection(const MCSection *Section) {
29 CurSection = Section;
30 }
31
32 virtual void EmitLabel(MCSymbol *Symbol) {}
33
34 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
35
36 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
37
38 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){}
39
40 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
41 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
42 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
43 unsigned ByteAlignment) {}
44 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) {}
45
46 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
47 unsigned Size = 0, unsigned ByteAlignment = 0) {}
48
49 virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
50
51 virtual void EmitValue(const MCExpr *Value, unsigned Size,
52 unsigned AddrSpace) {}
53 virtual void EmitGPRel32Value(const MCExpr *Value) {}
54 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
55 unsigned ValueSize = 1,
56 unsigned MaxBytesToEmit = 0) {}
57
58 virtual void EmitValueToOffset(const MCExpr *Offset,
59 unsigned char Value = 0) {}
60
61 virtual void EmitFileDirective(StringRef Filename) {}
62 virtual void EmitDwarfFileDirective(unsigned FileNo,StringRef Filename) {}
63 virtual void EmitInstruction(const MCInst &Inst) {}
64
65 virtual void Finish() {}
66
67 /// @}
68 };
69
70}
71
72MCStreamer *llvm::createNullStreamer(MCContext &Context) {
73 return new MCNullStreamer(Context);
74}