1 //===- MCWinCOFFStreamer.h - COFF Object File Interface ---------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_MC_MCWINCOFFSTREAMER_H
10 #define LLVM_MC_MCWINCOFFSTREAMER_H
12 #include "llvm/MC/MCDirectives.h"
13 #include "llvm/MC/MCObjectStreamer.h"
22 class MCSubtargetInfo
;
25 class raw_pwrite_stream
;
27 class MCWinCOFFStreamer
: public MCObjectStreamer
{
29 MCWinCOFFStreamer(MCContext
&Context
, std::unique_ptr
<MCAsmBackend
> MAB
,
30 std::unique_ptr
<MCCodeEmitter
> CE
,
31 std::unique_ptr
<MCObjectWriter
> OW
);
34 void reset() override
{
36 MCObjectStreamer::reset();
39 /// \name MCStreamer interface
42 void InitSections(bool NoExecStack
) override
;
43 void EmitLabel(MCSymbol
*Symbol
, SMLoc Loc
= SMLoc()) override
;
44 void EmitAssemblerFlag(MCAssemblerFlag Flag
) override
;
45 void EmitThumbFunc(MCSymbol
*Func
) override
;
46 bool EmitSymbolAttribute(MCSymbol
*Symbol
, MCSymbolAttr Attribute
) override
;
47 void EmitSymbolDesc(MCSymbol
*Symbol
, unsigned DescValue
) override
;
48 void BeginCOFFSymbolDef(MCSymbol
const *Symbol
) override
;
49 void EmitCOFFSymbolStorageClass(int StorageClass
) override
;
50 void EmitCOFFSymbolType(int Type
) override
;
51 void EndCOFFSymbolDef() override
;
52 void EmitCOFFSafeSEH(MCSymbol
const *Symbol
) override
;
53 void EmitCOFFSymbolIndex(MCSymbol
const *Symbol
) override
;
54 void EmitCOFFSectionIndex(MCSymbol
const *Symbol
) override
;
55 void EmitCOFFSecRel32(MCSymbol
const *Symbol
, uint64_t Offset
) override
;
56 void EmitCOFFImgRel32(MCSymbol
const *Symbol
, int64_t Offset
) override
;
57 void EmitCommonSymbol(MCSymbol
*Symbol
, uint64_t Size
,
58 unsigned ByteAlignment
) override
;
59 void EmitLocalCommonSymbol(MCSymbol
*Symbol
, uint64_t Size
,
60 unsigned ByteAlignment
) override
;
61 void EmitZerofill(MCSection
*Section
, MCSymbol
*Symbol
, uint64_t Size
,
62 unsigned ByteAlignment
, SMLoc Loc
= SMLoc()) override
;
63 void EmitTBSSSymbol(MCSection
*Section
, MCSymbol
*Symbol
, uint64_t Size
,
64 unsigned ByteAlignment
) override
;
65 void EmitIdent(StringRef IdentString
) override
;
66 void EmitWinEHHandlerData(SMLoc Loc
) override
;
67 void FinishImpl() override
;
72 const MCSymbol
*CurSymbol
;
74 void EmitInstToData(const MCInst
&Inst
, const MCSubtargetInfo
&STI
) override
;
77 void Error(const Twine
&Msg
) const;
80 } // end namespace llvm
82 #endif // LLVM_MC_MCWINCOFFSTREAMER_H