LLVM  8.0.1
MCNullStreamer.cpp
Go to the documentation of this file.
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/ADT/StringRef.h"
11 #include "llvm/MC/MCInst.h"
12 #include "llvm/MC/MCStreamer.h"
13 #include "llvm/MC/MCSymbol.h"
14 
15 using namespace llvm;
16 
17 namespace {
18 
19  class MCNullStreamer : public MCStreamer {
20  public:
21  MCNullStreamer(MCContext &Context) : MCStreamer(Context) {}
22 
23  /// @name MCStreamer Interface
24  /// @{
25 
26  bool hasRawTextSupport() const override { return true; }
27  void EmitRawTextImpl(StringRef String) override {}
28 
29  bool EmitSymbolAttribute(MCSymbol *Symbol,
30  MCSymbolAttr Attribute) override {
31  return true;
32  }
33 
34  void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
35  unsigned ByteAlignment) override {}
36  void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr,
37  uint64_t Size = 0, unsigned ByteAlignment = 0,
38  SMLoc Loc = SMLoc()) override {}
39  void EmitGPRel32Value(const MCExpr *Value) override {}
40  void BeginCOFFSymbolDef(const MCSymbol *Symbol) override {}
41  void EmitCOFFSymbolStorageClass(int StorageClass) override {}
42  void EmitCOFFSymbolType(int Type) override {}
43  void EndCOFFSymbolDef() override {}
44  };
45 
46 }
47 
49  return new MCNullStreamer(Context);
50 }
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:39
LLVMContext & Context
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
MCStreamer * createNullStreamer(MCContext &Ctx)
Create a dummy machine code streamer, which does nothing.
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:354
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
Context object for machine code objects.
Definition: MCContext.h:63
Streaming machine code generation interface.
Definition: MCStreamer.h:189
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:46
MCSymbolAttr
Definition: MCDirectives.h:19
uint32_t Size
Definition: Profile.cpp:47
LLVM Value Representation.
Definition: Value.h:73
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
Represents a location in source code.
Definition: SMLoc.h:24