Line data Source code
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"
14 : #include "llvm/MC/MCObjectStreamer.h"
15 :
16 : namespace llvm {
17 :
18 : class MCAsmBackend;
19 : class MCContext;
20 : class MCCodeEmitter;
21 : class MCInst;
22 : class MCSection;
23 : class MCSubtargetInfo;
24 : class MCSymbol;
25 : class StringRef;
26 : class raw_pwrite_stream;
27 :
28 : class MCWinCOFFStreamer : public MCObjectStreamer {
29 : public:
30 : MCWinCOFFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
31 : std::unique_ptr<MCCodeEmitter> CE,
32 : std::unique_ptr<MCObjectWriter> OW);
33 :
34 : /// state management
35 198 : void reset() override {
36 198 : CurSymbol = nullptr;
37 198 : MCObjectStreamer::reset();
38 198 : }
39 :
40 : /// \name MCStreamer interface
41 : /// \{
42 :
43 : void InitSections(bool NoExecStack) override;
44 : void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override;
45 : void EmitAssemblerFlag(MCAssemblerFlag Flag) override;
46 : void EmitThumbFunc(MCSymbol *Func) override;
47 : bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) 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 EmitCOFFSymbolIndex(MCSymbol const *Symbol) override;
55 : void EmitCOFFSectionIndex(MCSymbol const *Symbol) override;
56 : void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset) override;
57 : void EmitCOFFImgRel32(MCSymbol const *Symbol, int64_t Offset) override;
58 : void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
59 : unsigned ByteAlignment) override;
60 : void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
61 : unsigned ByteAlignment) override;
62 : void EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
63 : unsigned ByteAlignment, SMLoc Loc = SMLoc()) override;
64 : void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size,
65 : unsigned ByteAlignment) override;
66 : void EmitIdent(StringRef IdentString) override;
67 : void EmitWinEHHandlerData(SMLoc Loc) override;
68 : void FinishImpl() override;
69 :
70 : /// \}
71 :
72 : protected:
73 : const MCSymbol *CurSymbol;
74 :
75 : void EmitInstToData(const MCInst &Inst, const MCSubtargetInfo &STI) override;
76 :
77 : private:
78 : void Error(const Twine &Msg) const;
79 : };
80 :
81 : } // end namespace llvm
82 :
83 : #endif // LLVM_MC_MCWINCOFFSTREAMER_H
|