LLVM  3.7.0
MCWinCOFFStreamer.h
Go to the documentation of this file.
1 //===- MCWinCOFFStreamer.h - COFF Object File Interface ---------*- C++ -*-===//
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 #ifndef LLVM_MC_MCWINCOFFSTREAMER_H
11 #define LLVM_MC_MCWINCOFFSTREAMER_H
12 
13 #include "llvm/MC/MCDirectives.h"
15 
16 namespace llvm {
17 class MCAsmBackend;
18 class MCContext;
19 class MCCodeEmitter;
20 class MCExpr;
21 class MCInst;
22 class MCSection;
23 class MCSubtargetInfo;
24 class MCSymbol;
25 class StringRef;
26 class raw_ostream;
27 class raw_pwrite_stream;
28 
30 public:
32  raw_pwrite_stream &OS);
33 
34  /// state management
35  void reset() override {
36  CurSymbol = nullptr;
38  }
39 
40  /// \name MCStreamer interface
41  /// \{
42 
43  void InitSections(bool NoExecStack) override;
44  void EmitLabel(MCSymbol *Symbol) override;
45  void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
46  void EmitThumbFunc(MCSymbol *Func) override;
48  void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override;
49  void BeginCOFFSymbolDef(MCSymbol const *Symbol) override;
50  void EmitCOFFSymbolStorageClass(int StorageClass) override;
51  void EmitCOFFSymbolType(int Type) override;
52  void EndCOFFSymbolDef() override;
53  void EmitCOFFSafeSEH(MCSymbol const *Symbol) override;
54  void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
55  void EmitCOFFSecRel32(MCSymbol const *Symbol) override;
56  void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
57  unsigned ByteAlignment) override;
58  void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
59  unsigned ByteAlignment) override;
60  void EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
61  unsigned ByteAlignment) override;
62  void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
63  unsigned ByteAlignment) override;
64  void EmitFileDirective(StringRef Filename) override;
65  void EmitIdent(StringRef IdentString) override;
66  void EmitWinEHHandlerData() override;
67  void FinishImpl() override;
68 
69  /// \}
70 
71 protected:
73  void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override;
74 
75 private:
76  LLVM_ATTRIBUTE_NORETURN void FatalError(const Twine &Msg) const;
77 };
78 }
79 
80 #endif
81 
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition: MCSection.h:48
void InitSections(bool NoExecStack) override
Create the default sections and set the initial one.
void EmitThumbFunc(MCSymbol *Func) override
Note in the output that the specified Func is a Thumb mode function (ARM target only).
void EmitCOFFSectionIndex(MCSymbol const *Symbol) override
Emits a COFF section index.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
void EmitWinEHHandlerData() override
const MCSymbol * CurSymbol
void EmitAssemblerFlag(MCAssemblerFlag Flag) override
Note in the output the specified Flag.
void EmitCOFFSymbolStorageClass(int StorageClass) override
Emit the storage class of the symbol.
COFF::SymbolStorageClass StorageClass
Definition: COFFYAML.cpp:294
bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:79
void EmitFileDirective(StringRef Filename) override
Switch to a new logical file.
Context object for machine code objects.
Definition: MCContext.h:48
Streaming object file generation interface.
void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue) override
Set the DescValue for the Symbol.
void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a local common (.lcomm) symbol.
Instances of this class represent a single low-level machine instruction.
Definition: MCInst.h:150
Flag
These should be considered private to the implementation of the MCInstrDesc class.
Definition: MCInstrDesc.h:97
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
The instances of the Type class are immutable: once they are created, they are never changed...
Definition: Type.h:45
MCCodeEmitter - Generic instruction encoding interface.
Definition: MCCodeEmitter.h:23
void reset() override
state management
void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a thread local bss (.tbss) symbol.
void EmitCOFFSymbolType(int Type) override
Emit the type of the symbol.
#define LLVM_ATTRIBUTE_NORETURN
Definition: Compiler.h:204
MCSymbolAttr
Definition: MCDirectives.h:19
void EndCOFFSymbolDef() override
Marks the end of the symbol definition.
void EmitCOFFSecRel32(MCSymbol const *Symbol) override
Emits a COFF section relative relocation.
MCAssemblerFlag
Definition: MCDirectives.h:47
void reset() override
state management
MCWinCOFFStreamer(MCContext &Context, MCAsmBackend &MAB, MCCodeEmitter &CE, raw_pwrite_stream &OS)
void EmitLabel(MCSymbol *Symbol) override
Emit a label for Symbol into the current section.
MCSubtargetInfo - Generic base class for all target subtargets.
void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override
void BeginCOFFSymbolDef(MCSymbol const *Symbol) override
Start emitting COFF symbol definition.
An abstract base class for streams implementations that also support a pwrite operation.
Definition: raw_ostream.h:321
void EmitIdent(StringRef IdentString) override
Emit the "identifiers" directive.
void EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit the zerofill section and an optional symbol.
Generic interface to target specific assembler backends.
Definition: MCAsmBackend.h:34
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
void EmitCOFFSafeSEH(MCSymbol const *Symbol) override
void FinishImpl() override
Streamer specific finalization.