blob: 1d2b778ffcbcfcfae170b2f5715266bc79488602 [file] [log] [blame]
Daniel Dunbar011e4db2009-08-13 23:36:34 +00001//===- 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"
Daniel Dunbar011e4db2009-08-13 23:36:34 +000016
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
Chris Lattner4d35fce2009-08-18 16:46:29 +000028 virtual void SwitchSection(const MCSection *Section) {
29 CurSection = Section;
30 }
Daniel Dunbar011e4db2009-08-13 23:36:34 +000031
32 virtual void EmitLabel(MCSymbol *Symbol) {}
33
Chris Lattnera5ad93a2010-01-23 06:39:22 +000034 virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000035
Daniel Dunbar821e3332009-08-31 08:09:28 +000036 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000037
Chris Lattnera5ad93a2010-01-23 06:39:22 +000038 virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000039
40 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
Chris Lattner99328ad2010-01-25 07:52:13 +000041 virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
Chris Lattner9eb158d2010-01-23 07:47:02 +000042 virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +000043 unsigned ByteAlignment) {}
Chris Lattner9eb158d2010-01-23 07:47:02 +000044 virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000045
Daniel Dunbar8751b942009-08-28 05:48:22 +000046 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +000047 unsigned Size = 0, unsigned ByteAlignment = 0) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000048
Chris Lattneraaec2052010-01-19 19:46:13 +000049 virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000050
Chris Lattneraaec2052010-01-19 19:46:13 +000051 virtual void EmitValue(const MCExpr *Value, unsigned Size,
52 unsigned AddrSpace) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000053
54 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
55 unsigned ValueSize = 1,
56 unsigned MaxBytesToEmit = 0) {}
57
Daniel Dunbar821e3332009-08-31 08:09:28 +000058 virtual void EmitValueToOffset(const MCExpr *Offset,
Daniel Dunbar011e4db2009-08-13 23:36:34 +000059 unsigned char Value = 0) {}
60
61 virtual void EmitInstruction(const MCInst &Inst) {}
62
63 virtual void Finish() {}
64
65 /// @}
66 };
67
68}
69
70MCStreamer *llvm::createNullStreamer(MCContext &Context) {
71 return new MCNullStreamer(Context);
72}