LLVM: lib/MC/MCXCOFFStreamer.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
24
25using namespace llvm;
26
28 std::unique_ptr MAB,
29 std::unique_ptr OW,
30 std::unique_ptr Emitter)
33
37
40 auto *Sec = static_cast<const MCSectionXCOFF *>(Section);
41
42
43
44
45
46
47
48 if (Sec->isDwarfSect() || Sec->getMappingClass() == XCOFF::XMC_PR)
50}
51
56
58
60 return false;
61
65 Symbol->setExternal(true);
66 break;
69 Symbol->setExternal(true);
70 break;
73 Symbol->setExternal(true);
74 break;
77 break;
80 break;
83 break;
84 default:
86 }
87 return true;
88}
89
92
94
95
97 return;
98
100}
101
108
111 auto *Symbol = static_cast<const MCSymbolXCOFF *>(Name);
112 if (!Symbol->hasRename())
114}
115
118 unsigned Lang, unsigned Reason,
119 unsigned FunctionSize,
120 bool hasDebug) {
122 hasDebug);
123}
124
128
130 Align ByteAlignment) {
131 auto &Sym = static_cast<MCSymbolXCOFF &>(*Symbol);
133 Sym.setExternal(Sym.getStorageClass() != XCOFF::C_HIDEXT);
134 Symbol->setCommon(Size, ByteAlignment);
135
136
137
138 Sym.getRepresentedCsect()->setAlignment(ByteAlignment);
139
140
143}
144
148 Align Alignment) {
150}
dxil DXContainer Global Emitter
Functions, function parameters, and return types can have attributes to indicate how they should be t...
MCObjectWriter & getWriter() const
LLVM_ABI bool registerSymbol(const MCSymbol &Symbol)
Context object for machine code objects.
void emitValueToAlignment(Align Alignment, int64_t Fill=0, uint8_t FillLen=1, unsigned MaxBytesToEmit=0) override
Emit some number of copies of Value until the byte alignment ByteAlignment is reached.
MCAssembler & getAssembler()
void addFixup(const MCExpr *Value, MCFixupKind Kind)
MCObjectStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
void changeSection(MCSection *Section, uint32_t Subsection=0) override
This is called by popSection and switchSection, if the current section changes.
MCSymbolXCOFF * getQualNameSymbol() const
Instances of this class represent a uniqued identifier for a section in the current translation unit.
MCContext & getContext() const
void emitZeros(uint64_t NumBytes)
Emit NumBytes worth of zeros.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
void setFragment(MCFragment *F) const
Mark the symbol as defined in the fragment F.
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment) override
Emit a common symbol.
Definition MCXCOFFStreamer.cpp:129
XCOFFObjectWriter & getWriter()
Definition MCXCOFFStreamer.cpp:34
void emitXCOFFLocalCommonSymbol(MCSymbol *LabelSym, uint64_t Size, MCSymbol *CsectSym, Align Alignment) override
Emits an lcomm directive with XCOFF csect information.
Definition MCXCOFFStreamer.cpp:145
void emitXCOFFRefDirective(const MCSymbol *Symbol) override
Emit a XCOFF .ref directive which creates R_REF type entry in the relocation table for one or more sy...
Definition MCXCOFFStreamer.cpp:102
MCXCOFFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
Definition MCXCOFFStreamer.cpp:27
void changeSection(MCSection *Section, uint32_t Subsection=0) override
This is called by popSection and switchSection, if the current section changes.
Definition MCXCOFFStreamer.cpp:38
void emitXCOFFExceptDirective(const MCSymbol *Symbol, const MCSymbol *Trap, unsigned Lang, unsigned Reason, unsigned FunctionSize, bool hasDebug) override
Emit an XCOFF .except directive which adds information about a trap instruction to the object file ex...
Definition MCXCOFFStreamer.cpp:116
void emitXCOFFRenameDirective(const MCSymbol *Name, StringRef Rename) override
Emit a XCOFF .rename directive which creates a synonym for an illegal or undesirable name.
Definition MCXCOFFStreamer.cpp:109
void emitXCOFFCInfoSym(StringRef Name, StringRef Metadata) override
Emit a C_INFO symbol with XCOFF embedded metadata to the .info section.
Definition MCXCOFFStreamer.cpp:125
void emitXCOFFSymbolLinkageWithVisibility(MCSymbol *Symbol, MCSymbolAttr Linkage, MCSymbolAttr Visibility) override
Emit a symbol's linkage and visibility with a linkage directive for XCOFF.
Definition MCXCOFFStreamer.cpp:90
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
Definition MCXCOFFStreamer.cpp:52
StringRef - Represent a constant reference to a string, i.e.
virtual void addExceptionEntry(const MCSymbol *Symbol, const MCSymbol *Trap, unsigned LanguageCode, unsigned ReasonCode, unsigned FunctionSize, bool hasDebug)=0
virtual void addCInfoSymEntry(StringRef Name, StringRef Metadata)=0
@ R_REF
A non-relocating relocation.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
@ MCSA_Protected
.protected (ELF)
@ MCSA_Exported
.globl _foo, exported (XCOFF)
@ MCSA_Global
.type _foo, @gnu_unique_object
@ MCSA_Extern
.extern (XCOFF)
@ MCSA_Hidden
.hidden (ELF)
@ MCSA_LGlobal
.lglobl (XCOFF)
@ MCSA_Invalid
Not a valid directive.
Implement std::hash so that hash_code can be used in STL containers.
This struct is a compact representation of a valid (non-zero power of two) alignment.