LLVM API Documentation

Classes | Public Member Functions
llvm::MCELFStreamer Class Reference

#include <MCELFStreamer.h>

Inheritance diagram for llvm::MCELFStreamer:
Inheritance graph
[legend]
Collaboration diagram for llvm::MCELFStreamer:
Collaboration graph
[legend]

List of all members.

Classes

struct  LocalCommon

Public Member Functions

 MCELFStreamer (MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *Emitter)
 MCELFStreamer (MCContext &Context, MCAsmBackend &TAB, raw_ostream &OS, MCCodeEmitter *Emitter, MCAssembler *Assembler)
virtual ~MCELFStreamer ()
void reset () override
 state management

MCStreamer Interface

void InitSections () override
 Create the default sections and set the initial one.
void ChangeSection (const MCSection *Section, const MCExpr *Subsection) override
void EmitLabel (MCSymbol *Symbol) override
void EmitAssemblerFlag (MCAssemblerFlag Flag) override
 EmitAssemblerFlag - Note in the output the specified Flag.
void EmitThumbFunc (MCSymbol *Func) override
void EmitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol) override
bool EmitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute) override
 EmitSymbolAttribute - Add the given Attribute to Symbol.
void EmitSymbolDesc (MCSymbol *Symbol, unsigned DescValue) override
void EmitCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
void BeginCOFFSymbolDef (const MCSymbol *Symbol) override
void EmitCOFFSymbolStorageClass (int StorageClass) override
void EmitCOFFSymbolType (int Type) override
void EndCOFFSymbolDef () override
 EndCOFFSymbolDef - Marks the end of the symbol definition.
void EmitELFSize (MCSymbol *Symbol, const MCExpr *Value) override
void EmitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
void EmitZerofill (const MCSection *Section, MCSymbol *Symbol=nullptr, uint64_t Size=0, unsigned ByteAlignment=0) override
void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0) override
void EmitValueImpl (const MCExpr *Value, unsigned Size, const SMLoc &Loc=SMLoc()) override
void EmitFileDirective (StringRef Filename) override
void EmitIdent (StringRef IdentString) override
void EmitValueToAlignment (unsigned, int64_t, unsigned, unsigned) override
void Flush () override
 Flush - Causes any cached state to be written out.
void FinishImpl () override
 FinishImpl - Streamer specific finalization.
void EmitBundleAlignMode (unsigned AlignPow2) override
 Set the bundle alignment mode from now on in the section. The argument is the power of 2 to which the alignment is set. The value 0 means turn the bundle alignment off.
void EmitBundleLock (bool AlignToEnd) override
 The following instructions are a bundle-locked group.
void EmitBundleUnlock () override
 Ends a bundle-locked group.

Detailed Description

Definition at line 30 of file MCELFStreamer.h.


Constructor & Destructor Documentation

llvm::MCELFStreamer::MCELFStreamer ( MCContext Context,
MCAsmBackend TAB,
raw_ostream OS,
MCCodeEmitter Emitter 
) [inline]

Definition at line 32 of file MCELFStreamer.h.

llvm::MCELFStreamer::MCELFStreamer ( MCContext Context,
MCAsmBackend TAB,
raw_ostream OS,
MCCodeEmitter Emitter,
MCAssembler Assembler 
) [inline]

Definition at line 37 of file MCELFStreamer.h.

Definition at line 38 of file MCELFStreamer.cpp.


Member Function Documentation

void MCELFStreamer::BeginCOFFSymbolDef ( const MCSymbol Symbol) [override, virtual]

BeginCOFFSymbolDef - Start emitting COFF symbol definition

Parameters:
Symbol- The symbol to have its External & Type fields set.

Reimplemented from llvm::MCStreamer.

Definition at line 563 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::ChangeSection ( const MCSection ,
const MCExpr  
) [override, virtual]

ChangeSection - Update streamer for a new active section.

This is called by PopSection and SwitchSection, if the current section changes.

Reimplemented from llvm::MCObjectStreamer.

Definition at line 85 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::getAssembler(), llvm::MCObjectStreamer::getCurrentSectionData(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSectionData::isBundleLocked(), llvm::report_fatal_error(), and llvm::ARMBuildAttrs::Section.

void MCELFStreamer::EmitAssemblerFlag ( MCAssemblerFlag  Flag) [override, virtual]
void MCELFStreamer::EmitBundleAlignMode ( unsigned  AlignPow2) [override, virtual]

Set the bundle alignment mode from now on in the section. The argument is the power of 2 to which the alignment is set. The value 0 means turn the bundle alignment off.

Reimplemented from llvm::MCObjectStreamer.

Definition at line 474 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getBundleAlignSize(), llvm::report_fatal_error(), and llvm::MCAssembler::setBundleAlignSize().

void MCELFStreamer::EmitBundleLock ( bool  AlignToEnd) [override, virtual]
void MCELFStreamer::EmitBundleUnlock ( ) [override, virtual]
void MCELFStreamer::EmitCOFFSymbolStorageClass ( int  StorageClass) [override, virtual]

EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.

Parameters:
StorageClass- The storage class the symbol should have.

Reimplemented from llvm::MCStreamer.

Definition at line 567 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::EmitCOFFSymbolType ( int  Type) [override, virtual]

EmitCOFFSymbolType - Emit the type of the symbol.

Parameters:
Type- A COFF type identifier (see COFF::SymbolType in X86COFF.h)

Reimplemented from llvm::MCStreamer.

Definition at line 571 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::EmitCommonSymbol ( MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment 
) [override, virtual]
void MCELFStreamer::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 259 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), and llvm::MCSymbolData::setSize().

void MCELFStreamer::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 295 of file MCELFStreamer.cpp.

References llvm::MCAssembler::addFileName(), and llvm::MCObjectStreamer::getAssembler().

void MCELFStreamer::EmitIdent ( StringRef  IdentString) [override, virtual]
void MCELFStreamer::EmitLabel ( MCSymbol Symbol) [override, virtual]

EmitLabel - Emit a label for Symbol into the current section.

This corresponds to an assembler statement such as: foo:

Parameters:
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 56 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::getAssembler(), llvm::MCSectionELF::getFlags(), llvm::MCSymbol::getSection(), llvm::MCAssembler::getSymbolData(), llvm::MCSymbol::isUndefined(), llvm::ARMBuildAttrs::Section, llvm::MCELF::SetType(), llvm::ELF::SHF_TLS, and llvm::ELF::STT_TLS.

void MCELFStreamer::EmitLocalCommonSymbol ( MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment 
) [override, virtual]

EmitLocalCommonSymbol - Emit a local common (.lcomm) symbol.

Parameters:
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 264 of file MCELFStreamer.cpp.

References EmitCommonSymbol(), llvm::MCObjectStreamer::getAssembler(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::MCELF::SetBinding(), llvm::MCSymbolData::setExternal(), and llvm::ELF::STB_LOCAL.

bool MCELFStreamer::EmitSymbolAttribute ( MCSymbol Symbol,
MCSymbolAttr  Attribute 
) [override, virtual]
void MCELFStreamer::EmitSymbolDesc ( MCSymbol Symbol,
unsigned  DescValue 
) [override, virtual]

EmitSymbolDesc - Set the DescValue for the Symbol.

Parameters:
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 559 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::EmitTBSSSymbol ( const MCSection Section,
MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment = 0 
) [override, virtual]

EmitTBSSSymbol - Emit a thread local bss (.tbss) symbol.

Parameters:
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 584 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::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 555 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::EmitValueImpl ( const MCExpr Value,
unsigned  Size,
const SMLoc Loc = SMLoc() 
) [override, virtual]

EmitValue - Emit the expression Value into the output as a native integer of the given Size bytes.

This is used to implement assembler directives such as .word, .quad, etc.

Parameters:
Value- The value to emit.
Size- The size of the integer (in bytes) to emit. This must match a native machine width.
Loc- The location of the expression for error reporting.

Reimplemented from llvm::MCObjectStreamer.

Definition at line 274 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::getCurrentSectionData(), and llvm::report_fatal_error().

void MCELFStreamer::EmitValueToAlignment ( unsigned  ByteAlignment,
int64_t  Value,
unsigned  ValueSize,
unsigned  MaxBytesToEmit 
) [override, virtual]

EmitValueToAlignment - Emit some number of copies of Value until the byte alignment ByteAlignment is reached.

If the number of bytes need to emit for the alignment is not a multiple of ValueSize, then the contents of the emitted fill bytes is undefined.

This used to implement the .align assembler directive.

Parameters:
ByteAlignment- The alignment to reach. This must be a power of two on some targets.
Value- The value to use when filling bytes.
ValueSize- The size of the integer (in bytes) to emit for Value. This must match a native machine width.
MaxBytesToEmit- The maximum numbers of bytes to emit, or 0. If the alignment cannot be reached in this many bytes, no bytes are emitted.

Reimplemented from llvm::MCObjectStreamer.

Definition at line 282 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::getCurrentSectionData(), and llvm::report_fatal_error().

void MCELFStreamer::EmitWeakReference ( MCSymbol Alias,
const MCSymbol Symbol 
) [override, virtual]

EmitWeakReference - Emit an weak reference from Alias to Symbol.

This corresponds to an assembler statement such as: .weakref alias, symbol

Parameters:
Alias- The alias that is being created.
Symbol- The symbol being aliased.

Reimplemented from llvm::MCObjectStreamer.

Definition at line 96 of file MCELFStreamer.cpp.

References llvm::MCSymbolRefExpr::Create(), llvm::MCObjectStreamer::getAssembler(), llvm::MCStreamer::getContext(), llvm::MCAssembler::getOrCreateSymbolData(), llvm::MCSymbol::setVariableValue(), and llvm::MCSymbolRefExpr::VK_WEAKREF.

void MCELFStreamer::EmitZerofill ( const MCSection Section,
MCSymbol Symbol = nullptr,
uint64_t  Size = 0,
unsigned  ByteAlignment = 0 
) [override, virtual]

EmitZerofill - Emit the zerofill section and an optional symbol.

Parameters:
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 579 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::EndCOFFSymbolDef ( ) [override, virtual]

EndCOFFSymbolDef - Marks the end of the symbol definition.

Reimplemented from llvm::MCStreamer.

Definition at line 575 of file MCELFStreamer.cpp.

References llvm_unreachable.

void MCELFStreamer::FinishImpl ( ) [override, virtual]

FinishImpl - Streamer specific finalization.

Reimplemented from llvm::MCObjectStreamer.

Definition at line 536 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::EmitFrames(), and Flush().

void MCELFStreamer::Flush ( ) [override, virtual]
void MCELFStreamer::InitSections ( ) [override, virtual]

Create the default sections and set the initial one.

Reimplemented from llvm::MCStreamer.

Definition at line 41 of file MCELFStreamer.cpp.

References llvm::MCObjectStreamer::EmitCodeAlignment(), llvm::MCStreamer::getContext(), and llvm::MCStreamer::SwitchSection().

void llvm::MCELFStreamer::reset ( ) [inline, override, virtual]

state management

Reimplemented from llvm::MCObjectStreamer.

Definition at line 45 of file MCELFStreamer.h.

References llvm::SmallPtrSetImplBase::clear().


The documentation for this class was generated from the following files: