LLVM API Documentation
#include <MCWinCOFFStreamer.h>
Public Member Functions | |
MCWinCOFFStreamer (MCContext &Context, MCAsmBackend &MAB, MCCodeEmitter &CE, raw_ostream &OS) | |
void | reset () override |
state management | |
MCStreamer interface | |
void | InitSections () override |
Create the default sections and set the initial one. | |
void | EmitLabel (MCSymbol *Symbol) override |
void | EmitAssemblerFlag (MCAssemblerFlag Flag) override |
EmitAssemblerFlag - Note in the output the specified Flag . | |
void | EmitThumbFunc (MCSymbol *Func) override |
bool | EmitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute) override |
EmitSymbolAttribute - Add the given Attribute to Symbol . | |
void | EmitSymbolDesc (MCSymbol *Symbol, unsigned DescValue) override |
void | BeginCOFFSymbolDef (MCSymbol const *Symbol) override |
void | EmitCOFFSymbolStorageClass (int StorageClass) override |
void | EmitCOFFSymbolType (int Type) override |
void | EndCOFFSymbolDef () override |
EndCOFFSymbolDef - Marks the end of the symbol definition. | |
void | EmitCOFFSectionIndex (MCSymbol const *Symbol) override |
void | EmitCOFFSecRel32 (MCSymbol const *Symbol) override |
void | EmitELFSize (MCSymbol *Symbol, const MCExpr *Value) override |
void | EmitCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override |
void | EmitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override |
void | EmitZerofill (const MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override |
void | EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override |
void | EmitFileDirective (StringRef Filename) override |
void | EmitIdent (StringRef IdentString) override |
void | EmitWinEHHandlerData () override |
void | FinishImpl () override |
FinishImpl - Streamer specific finalization. | |
Protected Member Functions | |
void | EmitInstToData (const MCInst &Inst, const MCSubtargetInfo &STI) override |
Protected Attributes | |
const MCSymbol * | CurSymbol |
Definition at line 28 of file MCWinCOFFStreamer.h.
llvm::MCWinCOFFStreamer::MCWinCOFFStreamer | ( | MCContext & | Context, |
MCAsmBackend & | MAB, | ||
MCCodeEmitter & | CE, | ||
raw_ostream & | OS | ||
) |
Definition at line 40 of file WinCOFFStreamer.cpp.
void llvm::MCWinCOFFStreamer::BeginCOFFSymbolDef | ( | MCSymbol const * | Symbol | ) | [override, virtual] |
BeginCOFFSymbolDef - Start emitting COFF symbol definition
Symbol | - The symbol to have its External & Type fields set. |
Reimplemented from llvm::MCStreamer.
Definition at line 120 of file WinCOFFStreamer.cpp.
References CurSymbol, llvm::MCSymbol::getSection(), llvm::MCSection::getVariant(), llvm::MCSymbol::isInSection(), llvm::MCSection::SV_COFF, and llvm::ARMBuildAttrs::Symbol.
void llvm::MCWinCOFFStreamer::EmitAssemblerFlag | ( | MCAssemblerFlag | Flag | ) | [override, virtual] |
EmitAssemblerFlag - Note in the output the specified Flag
.
Reimplemented from llvm::MCStreamer.
Definition at line 84 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitCOFFSecRel32 | ( | MCSymbol const * | Symbol | ) | [override, virtual] |
EmitCOFFSecRel32 - Emits a COFF section relative relocation.
Symbol | - Symbol the section relative relocation should point to. |
Reimplemented from llvm::MCStreamer.
Definition at line 168 of file WinCOFFStreamer.cpp.
References llvm::MCFixup::Create(), llvm::MCSymbolRefExpr::Create(), llvm::FK_SecRel_4, llvm::MCDataFragment::getContents(), llvm::MCStreamer::getContext(), llvm::MCDataFragment::getFixups(), llvm::MCObjectStreamer::getOrCreateDataFragment(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorImpl< T >::resize(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
void llvm::MCWinCOFFStreamer::EmitCOFFSectionIndex | ( | MCSymbol const * | Symbol | ) | [override, virtual] |
EmitCOFFSectionIndex - Emits a COFF section index.
Symbol | - Symbol the section number relocation should point to. |
Reimplemented from llvm::MCStreamer.
Definition at line 160 of file WinCOFFStreamer.cpp.
References llvm::MCFixup::Create(), llvm::MCSymbolRefExpr::Create(), llvm::FK_SecRel_2, llvm::MCDataFragment::getContents(), llvm::MCStreamer::getContext(), llvm::MCDataFragment::getFixups(), llvm::MCObjectStreamer::getOrCreateDataFragment(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorImpl< T >::resize(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
void llvm::MCWinCOFFStreamer::EmitCOFFSymbolStorageClass | ( | int | StorageClass | ) | [override, virtual] |
EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.
StorageClass | - The storage class the symbol should have. |
Reimplemented from llvm::MCStreamer.
Definition at line 131 of file WinCOFFStreamer.cpp.
References CurSymbol, llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::itostr(), llvm::MCSymbolData::modifyFlags(), llvm::COFF::SF_ClassMask, and llvm::COFF::SF_ClassShift.
void llvm::MCWinCOFFStreamer::EmitCOFFSymbolType | ( | int | Type | ) | [override, virtual] |
EmitCOFFSymbolType - Emit the type of the symbol.
Reimplemented from llvm::MCStreamer.
Definition at line 143 of file WinCOFFStreamer.cpp.
References CurSymbol, llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::itostr(), llvm::MCSymbolData::modifyFlags(), llvm::COFF::SF_TypeMask, and llvm::COFF::SF_TypeShift.
void llvm::MCWinCOFFStreamer::EmitCommonSymbol | ( | MCSymbol * | Symbol, |
uint64_t | Size, | ||
unsigned | ByteAlignment | ||
) | [override, virtual] |
EmitCommonSymbol - Emit a common symbol.
Symbol | - The common symbol to emit. |
Size | - The size of the common symbol. |
ByteAlignment | - The alignment of the symbol if non-zero. This must be a power of 2. |
Implements llvm::MCStreamer.
Definition at line 180 of file WinCOFFStreamer.cpp.
References llvm::MCStreamer::AssignSection(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSymbol::getSection(), llvm::MCSection::getVariant(), llvm::MCSymbol::isInSection(), llvm::report_fatal_error(), llvm::MCSymbolData::setCommon(), llvm::MCSymbolData::setExternal(), and llvm::MCSection::SV_COFF.
void llvm::MCWinCOFFStreamer::EmitELFSize | ( | MCSymbol * | Symbol, |
const MCExpr * | Value | ||
) | [override, virtual] |
EmitELFSize - Emit an ELF .size directive.
This corresponds to an assembler statement such as: .size symbol, expression
Reimplemented from llvm::MCStreamer.
Definition at line 176 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitFileDirective | ( | StringRef | Filename | ) | [override, virtual] |
EmitFileDirective - Switch to a new logical file. This is used to implement the '.file "foo.c"' assembler directive.
Reimplemented from llvm::MCStreamer.
Definition at line 231 of file WinCOFFStreamer.cpp.
References llvm::MCAssembler::addFileName(), and llvm::MCObjectStreamer::getAssembler().
void llvm::MCWinCOFFStreamer::EmitIdent | ( | StringRef | IdentString | ) | [override, virtual] |
Emit the "identifiers" directive. This implements the '.ident "version foo"' assembler directive.
Reimplemented from llvm::MCStreamer.
Definition at line 236 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitInstToData | ( | const MCInst & | Inst, |
const MCSubtargetInfo & | STI | ||
) | [override, protected, virtual] |
Implements llvm::MCObjectStreamer.
Definition at line 44 of file WinCOFFStreamer.cpp.
References llvm::SmallVectorImpl< T >::append(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::tgtok::Code, llvm::MCCodeEmitter::EncodeInstruction(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::raw_ostream::flush(), llvm::MCObjectStreamer::getAssembler(), llvm::MCDataFragment::getContents(), llvm::MCAssembler::getEmitter(), llvm::MCDataFragment::getFixups(), llvm::getOffset(), llvm::MCObjectStreamer::getOrCreateDataFragment(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
void llvm::MCWinCOFFStreamer::EmitLabel | ( | MCSymbol * | Symbol | ) | [override, virtual] |
EmitLabel - Emit a label for Symbol
into the current section.
This corresponds to an assembler statement such as: foo:
Symbol | - The symbol to emit. A given symbol should only be emitted as a label once, and symbols emitted as a label should never be used in an assignment. |
Reimplemented from llvm::MCObjectStreamer.
Definition at line 79 of file WinCOFFStreamer.cpp.
References llvm::MCSymbol::isUndefined().
void llvm::MCWinCOFFStreamer::EmitLocalCommonSymbol | ( | MCSymbol * | Symbol, |
uint64_t | Size, | ||
unsigned | ByteAlignment | ||
) | [override, virtual] |
EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.
Symbol | - The common symbol to emit. |
Size | - The size of the common symbol. |
ByteAlignment | - The alignment of the common symbol in bytes. |
Reimplemented from llvm::MCStreamer.
Definition at line 196 of file WinCOFFStreamer.cpp.
References llvm::MCStreamer::AssignSection(), llvm::LCOMM::ByteAlignment, llvm::MCSectionData::getAlignment(), llvm::MCObjectStreamer::getAssembler(), llvm::MCObjectFileInfo::getBSSSection(), llvm::MCStreamer::getContext(), llvm::MCContext::getObjectFileInfo(), llvm::MCAssembler::getOrCreateSectionData(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSymbol::isInSection(), llvm::ARMBuildAttrs::Section, llvm::MCSectionData::setAlignment(), llvm::MCSymbolData::setExternal(), and llvm::MCSymbolData::setFragment().
bool llvm::MCWinCOFFStreamer::EmitSymbolAttribute | ( | MCSymbol * | Symbol, |
MCSymbolAttr | Attribute | ||
) | [override, virtual] |
EmitSymbolAttribute - Add the given Attribute
to Symbol
.
Implements llvm::MCStreamer.
Definition at line 92 of file WinCOFFStreamer.cpp.
References llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSymbol::getSection(), llvm::MCSection::getVariant(), llvm::MCSymbol::isInSection(), llvm::MCSA_Global, llvm::MCSA_Weak, llvm::MCSA_WeakReference, llvm::MCSymbolData::modifyFlags(), llvm::MCSymbolData::setExternal(), llvm::COFF::SF_WeakExternal, and llvm::MCSection::SV_COFF.
void llvm::MCWinCOFFStreamer::EmitSymbolDesc | ( | MCSymbol * | Symbol, |
unsigned | DescValue | ||
) | [override, virtual] |
EmitSymbolDesc - Set the DescValue
for the Symbol
.
Symbol | - The symbol to have its n_desc field set. |
DescValue | - The value to set into the n_desc field. |
Reimplemented from llvm::MCStreamer.
Definition at line 116 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitTBSSSymbol | ( | const MCSection * | Section, |
MCSymbol * | Symbol, | ||
uint64_t | Size, | ||
unsigned | ByteAlignment | ||
) | [override, virtual] |
EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.
Section | - The thread local common section. |
Symbol | - The thread local common symbol to emit. |
Size | - The size of the symbol. |
ByteAlignment | - The alignment of the thread local common symbol if non-zero. This must be a power of 2 on some targets. |
Reimplemented from llvm::MCStreamer.
Definition at line 225 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitThumbFunc | ( | MCSymbol * | Func | ) | [override, virtual] |
EmitThumbFunc - Note in the output that the specified Func
is a Thumb mode function (ARM target only).
Reimplemented from llvm::MCStreamer.
Definition at line 88 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitWinEHHandlerData | ( | ) | [override, virtual] |
Reimplemented from llvm::MCStreamer.
Definition at line 240 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EmitZerofill | ( | const MCSection * | Section, |
MCSymbol * | Symbol, | ||
uint64_t | Size, | ||
unsigned | ByteAlignment | ||
) | [override, virtual] |
EmitZerofill - Emit the zerofill section and an optional symbol.
Section | - The zerofill section to create and or to put the symbol |
Symbol | - The zerofill symbol to emit, if non-NULL. |
Size | - The size of the zerofill symbol. |
ByteAlignment | - The alignment of the zerofill symbol if non-zero. This must be a power of 2 on some targets. |
Implements llvm::MCStreamer.
Definition at line 219 of file WinCOFFStreamer.cpp.
References llvm_unreachable.
void llvm::MCWinCOFFStreamer::EndCOFFSymbolDef | ( | ) | [override, virtual] |
EndCOFFSymbolDef - Marks the end of the symbol definition.
Reimplemented from llvm::MCStreamer.
Definition at line 154 of file WinCOFFStreamer.cpp.
References CurSymbol.
void llvm::MCWinCOFFStreamer::FinishImpl | ( | ) | [override, virtual] |
FinishImpl - Streamer specific finalization.
Reimplemented from llvm::MCObjectStreamer.
Definition at line 244 of file WinCOFFStreamer.cpp.
void llvm::MCWinCOFFStreamer::InitSections | ( | ) | [override, virtual] |
Create the default sections and set the initial one.
Reimplemented from llvm::MCStreamer.
Definition at line 63 of file WinCOFFStreamer.cpp.
References llvm::MCObjectStreamer::EmitCodeAlignment(), llvm::MCStreamer::getContext(), and llvm::MCStreamer::SwitchSection().
void llvm::MCWinCOFFStreamer::reset | ( | ) | [inline, override, virtual] |
state management
Reimplemented from llvm::MCObjectStreamer.
Definition at line 34 of file MCWinCOFFStreamer.h.
References CurSymbol.
const MCSymbol* llvm::MCWinCOFFStreamer::CurSymbol [protected] |
Definition at line 71 of file MCWinCOFFStreamer.h.
Referenced by BeginCOFFSymbolDef(), EmitCOFFSymbolStorageClass(), EmitCOFFSymbolType(), EndCOFFSymbolDef(), and reset().