blob: b1357926f1fd7ccac33005423751c56b00a5280f [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
34 virtual void EmitAssemblerFlag(AssemblerFlag Flag) {}
35
Daniel Dunbar821e3332009-08-31 08:09:28 +000036 virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000037
38 virtual void EmitSymbolAttribute(MCSymbol *Symbol, SymbolAttr Attribute) {}
39
40 virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
41
Daniel Dunbar011e4db2009-08-13 23:36:34 +000042 virtual void EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +000043 unsigned ByteAlignment) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000044
Daniel Dunbar8751b942009-08-28 05:48:22 +000045 virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
Daniel Dunbar7092c7e2009-08-30 06:17:16 +000046 unsigned Size = 0, unsigned ByteAlignment = 0) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000047
Chris Lattneraaec2052010-01-19 19:46:13 +000048 virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000049
Chris Lattneraaec2052010-01-19 19:46:13 +000050 virtual void EmitValue(const MCExpr *Value, unsigned Size,
51 unsigned AddrSpace) {}
Daniel Dunbar011e4db2009-08-13 23:36:34 +000052
53 virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
54 unsigned ValueSize = 1,
55 unsigned MaxBytesToEmit = 0) {}
56
Daniel Dunbar821e3332009-08-31 08:09:28 +000057 virtual void EmitValueToOffset(const MCExpr *Offset,
Daniel Dunbar011e4db2009-08-13 23:36:34 +000058 unsigned char Value = 0) {}
59
60 virtual void EmitInstruction(const MCInst &Inst) {}
61
62 virtual void Finish() {}
63
64 /// @}
65 };
66
67}
68
69MCStreamer *llvm::createNullStreamer(MCContext &Context) {
70 return new MCNullStreamer(Context);
71}