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"
11 #include "llvm/MC/MCContext.h"
12 #include "llvm/MC/MCInst.h"
13 #include "llvm/MC/MCSectionMachO.h"
14 #include "llvm/MC/MCSymbol.h"
20 class MCNullStreamer : public MCStreamer {
22 MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
24 /// @name MCStreamer Interface
27 void ChangeSection(const MCSection *Section,
28 const MCExpr *Subsection) override {
31 void EmitLabel(MCSymbol *Symbol) override {
32 assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
33 assert(getCurrentSection().first &&"Cannot emit before setting section!");
34 AssignSection(Symbol, getCurrentSection().first);
36 void EmitDebugLabel(MCSymbol *Symbol) override {
39 void EmitAssemblerFlag(MCAssemblerFlag Flag) override {}
40 void EmitThumbFunc(MCSymbol *Func) override {}
42 void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override {}
43 void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override {}
44 void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
45 const MCSymbol *LastLabel,
46 const MCSymbol *Label,
47 unsigned PointerSize) override {}
49 bool EmitSymbolAttribute(MCSymbol *Symbol,
50 MCSymbolAttr Attribute) override {
54 void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override {}
56 void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
57 void EmitCOFFSymbolStorageClass(int StorageClass) override {}
58 void EmitCOFFSymbolType(int Type) override {}
59 void EndCOFFSymbolDef() override {}
60 void EmitCOFFSecRel32(MCSymbol const *Symbol) override {}
62 void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) override {}
63 void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
64 unsigned ByteAlignment) override {}
65 void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
66 unsigned ByteAlignment) override {}
67 void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = nullptr,
68 uint64_t Size = 0, unsigned ByteAlignment = 0) override {}
69 void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
70 uint64_t Size, unsigned ByteAlignment) override {}
71 void EmitBytes(StringRef Data) override {}
73 void EmitValueImpl(const MCExpr *Value, unsigned Size,
74 const SMLoc &Loc = SMLoc()) override {}
75 void EmitULEB128Value(const MCExpr *Value) override {}
76 void EmitSLEB128Value(const MCExpr *Value) override {}
77 void EmitGPRel32Value(const MCExpr *Value) override {}
78 void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
79 unsigned ValueSize = 1,
80 unsigned MaxBytesToEmit = 0) override {}
82 void EmitCodeAlignment(unsigned ByteAlignment,
83 unsigned MaxBytesToEmit = 0) override {}
85 bool EmitValueToOffset(const MCExpr *Offset,
86 unsigned char Value = 0) override { return false; }
88 void EmitFileDirective(StringRef Filename) override {}
89 unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
91 unsigned CUID = 0) override {
94 void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
95 unsigned Column, unsigned Flags,
96 unsigned Isa, unsigned Discriminator,
97 StringRef FileName) override {}
98 void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo&) override {}
100 void EmitBundleAlignMode(unsigned AlignPow2) override {}
101 void EmitBundleLock(bool AlignToEnd) override {}
102 void EmitBundleUnlock() override {}
104 void FinishImpl() override {}
106 void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) override {
107 RecordProcEnd(Frame);
113 MCStreamer *llvm::createNullStreamer(MCContext &Context) {
114 return new MCNullStreamer(Context);