Use the new script to sort the includes of every file under lib.
[oota-llvm.git] / lib / MC / MCNullStreamer.cpp
1 //===- 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 #include "llvm/MC/MCContext.h"
12 #include "llvm/MC/MCInst.h"
13 #include "llvm/MC/MCSectionMachO.h"
14 #include "llvm/MC/MCSymbol.h"
15
16 using namespace llvm;
17
18 namespace {
19
20   class MCNullStreamer : public MCStreamer {
21   public:
22     MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
23
24     /// @name MCStreamer Interface
25     /// @{
26
27     virtual void InitSections() {
28     }
29
30     virtual void ChangeSection(const MCSection *Section) {
31     }
32
33     virtual void EmitLabel(MCSymbol *Symbol) {
34       assert(Symbol->isUndefined() && "Cannot define a symbol twice!");
35       assert(getCurrentSection() && "Cannot emit before setting section!");
36       Symbol->setSection(*getCurrentSection());
37     }
38
39     virtual void EmitAssemblerFlag(MCAssemblerFlag Flag) {}
40     virtual void EmitThumbFunc(MCSymbol *Func) {}
41
42     virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) {}
43     virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol){}
44     virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
45                                           const MCSymbol *LastLabel,
46                                           const MCSymbol *Label,
47                                           unsigned PointerSize) {}
48
49     virtual void EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute){}
50
51     virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) {}
52
53     virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol) {}
54     virtual void EmitCOFFSymbolStorageClass(int StorageClass) {}
55     virtual void EmitCOFFSymbolType(int Type) {}
56     virtual void EndCOFFSymbolDef() {}
57     virtual void EmitCOFFSecRel32(MCSymbol const *Symbol) {}
58
59     virtual void EmitELFSize(MCSymbol *Symbol, const MCExpr *Value) {}
60     virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
61                                   unsigned ByteAlignment) {}
62     virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
63                                        unsigned ByteAlignment) {}
64     virtual void EmitZerofill(const MCSection *Section, MCSymbol *Symbol = 0,
65                               uint64_t Size = 0, unsigned ByteAlignment = 0) {}
66     virtual void EmitTBSSSymbol(const MCSection *Section, MCSymbol *Symbol,
67                                 uint64_t Size, unsigned ByteAlignment) {}
68     virtual void EmitBytes(StringRef Data, unsigned AddrSpace) {}
69
70     virtual void EmitValueImpl(const MCExpr *Value, unsigned Size,
71                                unsigned AddrSpace) {}
72     virtual void EmitULEB128Value(const MCExpr *Value) {}
73     virtual void EmitSLEB128Value(const MCExpr *Value) {}
74     virtual void EmitGPRel32Value(const MCExpr *Value) {}
75     virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0,
76                                       unsigned ValueSize = 1,
77                                       unsigned MaxBytesToEmit = 0) {}
78
79     virtual void EmitCodeAlignment(unsigned ByteAlignment,
80                                    unsigned MaxBytesToEmit = 0) {}
81
82     virtual bool EmitValueToOffset(const MCExpr *Offset,
83                                    unsigned char Value = 0) { return false; }
84
85     virtual void EmitFileDirective(StringRef Filename) {}
86     virtual bool EmitDwarfFileDirective(unsigned FileNo, StringRef Directory,
87                                         StringRef Filename) {
88       return false;
89     }
90     virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
91                                        unsigned Column, unsigned Flags,
92                                        unsigned Isa, unsigned Discriminator,
93                                        StringRef FileName) {}
94     virtual void EmitInstruction(const MCInst &Inst) {}
95
96     virtual void FinishImpl() {}
97
98     virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &Frame) {
99       RecordProcEnd(Frame);
100     }
101
102     /// @}
103   };
104
105 }
106
107 MCStreamer *llvm::createNullStreamer(MCContext &Context) {
108   return new MCNullStreamer(Context);
109 }