LLVM 24.0.0git
MCWinCOFFStreamer.h
Go to the documentation of this file.
1//===- MCWinCOFFStreamer.h - COFF Object File Interface ---------*- C++ -*-===//
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#ifndef LLVM_MC_MCWINCOFFSTREAMER_H
10#define LLVM_MC_MCWINCOFFSTREAMER_H
11
14
15namespace llvm {
16
17class MCAsmBackend;
18class MCContext;
19class MCCodeEmitter;
20class MCSection;
21class MCSubtargetInfo;
22class MCSymbol;
23class StringRef;
25
27public:
28 MCWinCOFFStreamer(MCContext &Context, std::unique_ptr<MCAsmBackend> MAB,
29 std::unique_ptr<MCCodeEmitter> CE,
30 std::unique_ptr<MCObjectWriter> OW);
31
32 /// state management
33 void reset() override {
34 CurSymbol = nullptr;
36 }
37
38 WinCOFFObjectWriter &getWriter();
39
40 /// \name MCStreamer interface
41 /// \{
42
43 void initSections(const MCSubtargetInfo &STI) override;
44 void changeSection(MCSection *Section, uint32_t Subsection = 0) override;
45 void emitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) 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 emitCOFFSecNumber(MCSymbol const *Symbol) override;
58 void emitCOFFSecOffset(MCSymbol const *Symbol) override;
59 void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size,
60 Align ByteAlignment) override;
61 void emitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size,
62 Align ByteAlignment) override;
63 void emitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol) override;
64 void emitIdent(StringRef IdentString) override;
65 void emitWinEHHandlerData(SMLoc Loc) override;
66 void emitCGProfileEntry(const MCSymbolRefExpr *From,
67 const MCSymbolRefExpr *To, uint64_t Count) override;
68 void finishImpl() override;
69
70 /// \}
71
72protected:
74
76
77private:
78 void Error(const Twine &Msg) const;
79};
80
81} // end namespace llvm
82
83#endif // LLVM_MC_MCWINCOFFSTREAMER_H
uint64_t uint64_t
#define LLVM_ABI
Definition Compiler.h:211
const char * Msg
Functions, function parameters, and return types can have attributes to indicate how they should be t...
Definition Attributes.h:106
Generic interface to target specific assembler backends.
MCCodeEmitter - Generic instruction encoding interface.
Context object for machine code objects.
Definition MCContext.h:84
void reset() override
state management
MCObjectStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Definition MCSection.h:577
Generic base class for all target subtargets.
Represent a reference to a symbol from inside an expression.
Definition MCExpr.h:187
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
void finalizeCGProfileEntry(const MCSymbolRefExpr *&S)
MCWinCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCCodeEmitter > CE, std::unique_ptr< MCObjectWriter > OW)
void reset() override
state management
Represents a location in source code.
Definition SMLoc.h:22
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
The instances of the Type class are immutable: once they are created, they are never changed.
Definition Type.h:46
This is an optimization pass for GlobalISel generic memory operations.
@ Offset
Definition DWP.cpp:577
RelativeUniformCounterPtr ValuesPtrExpr VTableAddr Count
Definition InstrProf.h:145
This struct is a compact representation of a valid (non-zero power of two) alignment.
Definition Alignment.h:39