LLVM API Documentation
#include <MCStreamer.h>
Public Types | |
| enum | SymbolAttr { Global, Hidden, IndirectSymbol, Internal, LazyReference, NoDeadStrip, PrivateExtern, Protected, Reference, Weak, WeakDefinition, WeakReference, SymbolAttrFirst = Global, SymbolAttrLast = WeakReference } |
| enum | AssemblerFlag { SubsectionsViaSymbols } |
Public Member Functions | |
| virtual | ~MCStreamer () |
| MCContext & | getContext () const |
| virtual void | EmitInstruction (const MCInst &Inst)=0 |
| virtual void | Finish ()=0 |
| Finish - Finish emission of machine code and flush any output. | |
Symbol & Section Management | |
| virtual void | SwitchSection (const MCSection *Section)=0 |
| const MCSection * | getCurrentSection () const |
| virtual void | EmitLabel (MCSymbol *Symbol)=0 |
| virtual void | EmitAssemblerFlag (AssemblerFlag Flag)=0 |
| EmitAssemblerFlag - Note in the output the specified. | |
| virtual void | EmitAssignment (MCSymbol *Symbol, const MCValue &Value, bool MakeAbsolute=false)=0 |
| virtual void | EmitSymbolAttribute (MCSymbol *Symbol, SymbolAttr Attribute)=0 |
| EmitSymbolAttribute - Add the given. | |
| virtual void | EmitSymbolDesc (MCSymbol *Symbol, unsigned DescValue)=0 |
| virtual void | EmitLocalSymbol (MCSymbol *Symbol, const MCValue &Value)=0 |
| virtual void | EmitCommonSymbol (MCSymbol *Symbol, unsigned Size, unsigned Pow2Alignment, bool IsLocal)=0 |
| virtual void | EmitZerofill (MCSection *Section, MCSymbol *Symbol=0, unsigned Size=0, unsigned Pow2Alignment=0)=0 |
Generating Data | |
| virtual void | EmitBytes (const StringRef &Data)=0 |
| virtual void | EmitValue (const MCValue &Value, unsigned Size)=0 |
| virtual void | EmitValueToAlignment (unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)=0 |
| virtual void | EmitValueToOffset (const MCValue &Offset, unsigned char Value=0)=0 |
Protected Member Functions | |
| MCStreamer (MCContext &Ctx) | |
Protected Attributes | |
| const MCSection * | CurSection |
There are multiple implementations of this interface: one for writing out a .s file, and implementations that write out .o files of various formats.
Definition at line 39 of file MCStreamer.h.
| Global | |
| Hidden | .globl |
| IndirectSymbol | .hidden (ELF) |
| Internal | .indirect_symbol (Apple) |
| LazyReference | .internal (ELF) |
| NoDeadStrip | .lazy_reference (Apple) |
| PrivateExtern | .no_dead_strip (Apple) |
| Protected | .private_extern (Apple) |
| Reference | .protected (ELF) |
| Weak | .reference (Apple) |
| WeakDefinition | .weak |
| WeakReference | .weak_definition (Apple) |
| SymbolAttrFirst | .weak_reference (Apple) |
| SymbolAttrLast |
Definition at line 41 of file MCStreamer.h.
Definition at line 59 of file MCStreamer.h.
| MCStreamer::MCStreamer | ( | MCContext & | Ctx | ) | [protected] |
Definition at line 14 of file MCStreamer.cpp.
| MCStreamer::~MCStreamer | ( | ) | [virtual] |
Definition at line 17 of file MCStreamer.cpp.
| MCContext& llvm::MCStreamer::getContext | ( | ) | const [inline] |
Definition at line 78 of file MCStreamer.h.
| virtual void llvm::MCStreamer::SwitchSection | ( | const MCSection * | Section | ) | [pure virtual] |
SwitchSection - Set the current section where code is being emitted to
| Section. | This is required to update CurSection. |
Referenced by llvm::X86ATTAsmPrinter::doFinalization(), llvm::AsmPrinter::EmitConstantPool(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::DwarfDebug::EndModule(), llvm::X86IntelAsmPrinter::PrintGlobalVariable(), llvm::X86ATTAsmPrinter::PrintGlobalVariable(), and llvm::X86IntelAsmPrinter::runOnMachineFunction().
| const MCSection* llvm::MCStreamer::getCurrentSection | ( | ) | const [inline] |
getCurrentSection - Return the current seciton that the streamer is emitting code to.
Definition at line 92 of file MCStreamer.h.
References CurSection.
Referenced by llvm::AsmPrinter::getCurrentSection().
| virtual void llvm::MCStreamer::EmitLabel | ( | MCSymbol * | Symbol | ) | [pure virtual] |
EmitLabel - Emit a label for
| Symbol | into the current section. |
| 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. |
Referenced by llvm::X86ATTAsmPrinter::printMachineInstruction().
| virtual void llvm::MCStreamer::EmitAssemblerFlag | ( | AssemblerFlag | Flag | ) | [pure virtual] |
EmitAssemblerFlag - Note in the output the specified.
| Flag |
| virtual void llvm::MCStreamer::EmitAssignment | ( | MCSymbol * | Symbol, | |
| const MCValue & | Value, | |||
| bool | MakeAbsolute = false | |||
| ) | [pure virtual] |
EmitAssignment - Emit an assignment of
| Value | to | |
| Symbol. | This corresponds to an assembler statement such as: symbol = value |
| virtual void llvm::MCStreamer::EmitSymbolAttribute | ( | MCSymbol * | Symbol, | |
| SymbolAttr | Attribute | |||
| ) | [pure virtual] |
| virtual void llvm::MCStreamer::EmitSymbolDesc | ( | MCSymbol * | Symbol, | |
| unsigned | DescValue | |||
| ) | [pure 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. |
| virtual void llvm::MCStreamer::EmitCommonSymbol | ( | MCSymbol * | Symbol, | |
| unsigned | Size, | |||
| unsigned | Pow2Alignment, | |||
| bool | IsLocal | |||
| ) | [pure virtual] |
EmitCommonSymbol - Emit a common or local common symbol of
| Size | with the | |
| Pow2Alignment | if non-zero. | |
| Symbol | - The common symbol to emit. | |
| Size | - The size of the common symbol. | |
| Pow2Alignment | - The alignment of the common symbol if non-zero. | |
| IsLocal | - If true, then the symbol is to be a local common |
| virtual void llvm::MCStreamer::EmitZerofill | ( | MCSection * | Section, | |
| MCSymbol * | Symbol = 0, |
|||
| unsigned | Size = 0, |
|||
| unsigned | Pow2Alignment = 0 | |||
| ) | [pure virtual] |
EmitZerofill - Emit a the zerofill section and possiblity a symbol, if
| Symbol | is non-NULL, for | |
| Size | and with the | |
| Pow2Alignment | if non-zero. | |
| 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. | |
| Pow2Alignment | - The alignment of the zerofill symbol if non-zero. |
| virtual void llvm::MCStreamer::EmitBytes | ( | const StringRef & | Data | ) | [pure virtual] |
EmitBytes - Emit the bytes in
| Data | into the output. |
EmitValue - Emit the expression
| Value | into the output as a native integer of the given | |
| Size | bytes. |
| Value | - The value to emit. | |
| Size | - The size of the integer (in bytes) to emit. This must match a native machine width. |
| virtual void llvm::MCStreamer::EmitValueToAlignment | ( | unsigned | ByteAlignment, | |
| int64_t | Value = 0, |
|||
| unsigned | ValueSize = 1, |
|||
| unsigned | MaxBytesToEmit = 0 | |||
| ) | [pure virtual] |
EmitValueToAlignment - Emit some number of copies of
| Value | until the byte alignment | |
| ByteAlignment | is reached. |
| ValueSize,then | the contents of the emitted fill bytes is undefined. |
| ByteAlignment | - The alignment to reach. This must be a power of two on some targets. | |
| Value | - The value to use when filling bytes. | |
| Size | - 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. |
Referenced by llvm::AsmPrinter::EmitAlignment().
| virtual void llvm::MCStreamer::EmitValueToOffset | ( | const MCValue & | Offset, | |
| unsigned char | Value = 0 | |||
| ) | [pure virtual] |
EmitValueToOffset - Emit some number of copies of
| Value | until the byte offset | |
| Offset | is reached. |
| Offset | - The offset to reach.This may be an expression, but the expression must be associated with the current section. | |
| Value | - The value to use when filling bytes. |
| virtual void llvm::MCStreamer::EmitInstruction | ( | const MCInst & | Inst | ) | [pure virtual] |
EmitInstruction - Emit the given
| Instruction | into the current section. |
| virtual void llvm::MCStreamer::Finish | ( | ) | [pure virtual] |
Finish - Finish emission of machine code and flush any output.
Referenced by llvm::AsmPrinter::doFinalization().
const MCSection* llvm::MCStreamer::CurSection [protected] |
CurSection - This is the current section code is being emitted to, it is kept up to date by SwitchSection.
Definition at line 74 of file MCStreamer.h.
Referenced by getCurrentSection().