1 //===- lib/MC/MCNullStreamer.cpp - Dummy Streamer Implementation ----------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #include "llvm/ADT/StringRef.h"
10 #include "llvm/MC/MCInst.h"
11 #include "llvm/MC/MCStreamer.h"
12 #include "llvm/MC/MCSymbol.h"
13 
14 using namespace llvm;
15 
16 namespace {
17 
18   class MCNullStreamer : public MCStreamer {
19   public:
MCNullStreamer(MCContext & Context)20     MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
21 
22     /// @name MCStreamer Interface
23     /// @{
24 
hasRawTextSupport() const25     bool hasRawTextSupport() const override { return true; }
emitRawTextImpl(StringRef String)26     void emitRawTextImpl(StringRef String) override {}
27 
emitSymbolAttribute(MCSymbol * Symbol,MCSymbolAttr Attribute)28     bool emitSymbolAttribute(MCSymbol *Symbol,
29                              MCSymbolAttr Attribute) override {
30       return true;
31     }
32 
emitCommonSymbol(MCSymbol * Symbol,uint64_t Size,unsigned ByteAlignment,TailPaddingAmount TailPadding)33     void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
34                           unsigned ByteAlignment,
35                           TailPaddingAmount TailPadding) override {}
emitZerofill(MCSection * Section,MCSymbol * Symbol,uint64_t Size,unsigned ByteAlignment,TailPaddingAmount TailPadding,SMLoc Loc=SMLoc ())36     void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
37                       unsigned ByteAlignment, TailPaddingAmount TailPadding,
38                       SMLoc Loc = SMLoc()) override {}
emitGPRel32Value(const MCExpr * Value)39     void emitGPRel32Value(const MCExpr *Value) override {}
BeginCOFFSymbolDef(const MCSymbol * Symbol)40     void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
EmitCOFFSymbolStorageClass(int StorageClass)41     void EmitCOFFSymbolStorageClass(int StorageClass) override {}
EmitCOFFSymbolType(int Type)42     void EmitCOFFSymbolType(int Type) override {}
EndCOFFSymbolDef()43     void EndCOFFSymbolDef() override {}
44   };
45 
46 }
47 
createNullStreamer(MCContext & Context)48 MCStreamer *llvm::createNullStreamer(MCContext &Context) {
49   return new MCNullStreamer(Context);
50 }
51