LLVM API Documentation

Public Types | Public Member Functions | Protected Member Functions
llvm::MCStreamer Class Reference

#include <MCStreamer.h>

Inheritance diagram for llvm::MCStreamer:
Inheritance graph
[legend]

List of all members.

Public Types

enum  StreamerKind {
  SK_AsmStreamer, SK_NullStreamer, SK_RecordStreamer, SK_ELFStreamer,
  SK_ARMELFStreamer, SK_MachOStreamer, SK_PureStreamer, SK_MipsELFStreamer,
  SK_WinCOFFStreamer
}

Public Member Functions

virtual ~MCStreamer ()
StreamerKind getKind () const
virtual void reset ()
MCContextgetContext () const
unsigned getNumFrameInfos ()
const MCDwarfFrameInfogetFrameInfo (unsigned i)
ArrayRef< MCDwarfFrameInfogetFrameInfos ()
unsigned getNumW64UnwindInfos ()
MCWin64EHUnwindInfogetW64UnwindInfo (unsigned i)
virtual void EmitFileDirective (StringRef Filename)=0
virtual bool EmitDwarfFileDirective (unsigned FileNo, StringRef Directory, StringRef Filename, unsigned CUID=0)
virtual void EmitDwarfLocDirective (unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName)
 EmitDwarfLocDirective - This implements the DWARF2.
virtual void EmitDwarfAdvanceLineAddr (int64_t LineDelta, const MCSymbol *LastLabel, const MCSymbol *Label, unsigned PointerSize)=0
virtual void EmitDwarfAdvanceFrameAddr (const MCSymbol *LastLabel, const MCSymbol *Label)
void EmitDwarfSetLineAddr (int64_t LineDelta, const MCSymbol *Label, int PointerSize)
virtual void EmitCompactUnwindEncoding (uint32_t CompactUnwindEncoding)
virtual void EmitCFISections (bool EH, bool Debug)
void EmitCFIStartProc ()
void EmitCFIEndProc ()
virtual void EmitCFIDefCfa (int64_t Register, int64_t Offset)
virtual void EmitCFIDefCfaOffset (int64_t Offset)
virtual void EmitCFIDefCfaRegister (int64_t Register)
virtual void EmitCFIOffset (int64_t Register, int64_t Offset)
virtual void EmitCFIPersonality (const MCSymbol *Sym, unsigned Encoding)
virtual void EmitCFILsda (const MCSymbol *Sym, unsigned Encoding)
virtual void EmitCFIRememberState ()
virtual void EmitCFIRestoreState ()
virtual void EmitCFISameValue (int64_t Register)
virtual void EmitCFIRestore (int64_t Register)
virtual void EmitCFIRelOffset (int64_t Register, int64_t Offset)
virtual void EmitCFIAdjustCfaOffset (int64_t Adjustment)
virtual void EmitCFIEscape (StringRef Values)
virtual void EmitCFISignalFrame ()
virtual void EmitCFIUndefined (int64_t Register)
virtual void EmitCFIRegister (int64_t Register1, int64_t Register2)
virtual void EmitWin64EHStartProc (const MCSymbol *Symbol)
virtual void EmitWin64EHEndProc ()
virtual void EmitWin64EHStartChained ()
virtual void EmitWin64EHEndChained ()
virtual void EmitWin64EHHandler (const MCSymbol *Sym, bool Unwind, bool Except)
virtual void EmitWin64EHHandlerData ()
virtual void EmitWin64EHPushReg (unsigned Register)
virtual void EmitWin64EHSetFrame (unsigned Register, unsigned Offset)
virtual void EmitWin64EHAllocStack (unsigned Size)
virtual void EmitWin64EHSaveReg (unsigned Register, unsigned Offset)
virtual void EmitWin64EHSaveXMM (unsigned Register, unsigned Offset)
virtual void EmitWin64EHPushFrame (bool Code)
virtual void EmitWin64EHEndProlog ()
virtual void EmitInstruction (const MCInst &Inst)=0
virtual void EmitBundleAlignMode (unsigned AlignPow2)=0
 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.
virtual void EmitBundleLock (bool AlignToEnd)=0
 The following instructions are a bundle-locked group.
virtual void EmitBundleUnlock ()=0
 Ends a bundle-locked group.
virtual void EmitRawText (StringRef String)
void EmitRawText (const Twine &String)
virtual void EmitFnStart ()
virtual void EmitFnEnd ()
virtual void EmitCantUnwind ()
virtual void EmitPersonality (const MCSymbol *Personality)
virtual void EmitHandlerData ()
virtual void EmitSetFP (unsigned FpReg, unsigned SpReg, int64_t Offset=0)
virtual void EmitPad (int64_t Offset)
virtual void EmitRegSave (const SmallVectorImpl< unsigned > &RegList, bool isVector)
virtual void EmitTCEntry (const MCSymbol &S)
virtual void FinishImpl ()=0
 FinishImpl - Streamer specific finalization.
void Finish ()
 Finish - Finish emission of machine code.
Assembly File Formatting.
virtual bool isVerboseAsm () const
virtual bool hasRawTextSupport () const
virtual void AddComment (const Twine &T)
virtual raw_ostreamGetCommentOS ()
virtual void AddBlankLine ()
 AddBlankLine - Emit a blank line to a .s file to pretty it up.
Symbol & Section Management
MCSectionSubPair getCurrentSection () const
MCSectionSubPair getPreviousSection () const
virtual void ChangeSection (const MCSection *, const MCExpr *)=0
void PushSection ()
bool PopSection ()
bool SubSection (const MCExpr *Subsection)
void SwitchSection (const MCSection *Section, const MCExpr *Subsection=0)
void SwitchSectionNoChange (const MCSection *Section, const MCExpr *Subsection=0)
void InitStreamer ()
 Initialize the streamer.
void setAutoInitSections (bool AutoInitSections)
 Tell this MCStreamer to call InitSections upon initialization.
virtual void InitSections ()=0
 InitSections - Create the default sections and set the initial one.
virtual void InitToTextSection ()=0
 InitToTextSection - Create a text section and switch the streamer to it.
virtual void EmitLabel (MCSymbol *Symbol)
virtual void EmitDebugLabel (MCSymbol *Symbol)
virtual void EmitEHSymAttributes (const MCSymbol *Symbol, MCSymbol *EHSymbol)
virtual void EmitAssemblerFlag (MCAssemblerFlag Flag)=0
 EmitAssemblerFlag - Note in the output the specified Flag.
virtual void EmitLinkerOptions (ArrayRef< std::string > Kind)
virtual void EmitDataRegion (MCDataRegionType Kind)
 EmitDataRegion - Note in the output the specified region Kind.
virtual void EmitThumbFunc (MCSymbol *Func)=0
virtual MCSymbolDatagetOrCreateSymbolData (MCSymbol *Symbol)
 getOrCreateSymbolData - Get symbol data for given symbol.
virtual void EmitAssignment (MCSymbol *Symbol, const MCExpr *Value)=0
virtual void EmitWeakReference (MCSymbol *Alias, const MCSymbol *Symbol)=0
virtual void EmitSymbolAttribute (MCSymbol *Symbol, MCSymbolAttr Attribute)=0
 EmitSymbolAttribute - Add the given Attribute to Symbol.
virtual void EmitSymbolDesc (MCSymbol *Symbol, unsigned DescValue)=0
virtual void BeginCOFFSymbolDef (const MCSymbol *Symbol)=0
virtual void EmitCOFFSymbolStorageClass (int StorageClass)=0
virtual void EmitCOFFSymbolType (int Type)=0
virtual void EndCOFFSymbolDef ()=0
 EndCOFFSymbolDef - Marks the end of the symbol definition.
virtual void EmitCOFFSecRel32 (MCSymbol const *Symbol)
virtual void EmitELFSize (MCSymbol *Symbol, const MCExpr *Value)=0
virtual void EmitCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)=0
virtual void EmitLocalCommonSymbol (MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment)=0
virtual void EmitZerofill (const MCSection *Section, MCSymbol *Symbol=0, uint64_t Size=0, unsigned ByteAlignment=0)=0
virtual void EmitTBSSSymbol (const MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment=0)=0
Generating Data
virtual void EmitBytes (StringRef Data, unsigned AddrSpace=0)=0
virtual void EmitValueImpl (const MCExpr *Value, unsigned Size, unsigned AddrSpace)=0
void EmitValue (const MCExpr *Value, unsigned Size, unsigned AddrSpace=0)
virtual void EmitIntValue (uint64_t Value, unsigned Size, unsigned AddrSpace=0)
void EmitAbsValue (const MCExpr *Value, unsigned Size, unsigned AddrSpace=0)
virtual void EmitULEB128Value (const MCExpr *Value)=0
virtual void EmitSLEB128Value (const MCExpr *Value)=0
void EmitULEB128IntValue (uint64_t Value, unsigned Padding=0, unsigned AddrSpace=0)
void EmitSLEB128IntValue (int64_t Value, unsigned AddrSpace=0)
void EmitSymbolValue (const MCSymbol *Sym, unsigned Size, unsigned AddrSpace=0)
virtual void EmitGPRel64Value (const MCExpr *Value)
virtual void EmitGPRel32Value (const MCExpr *Value)
virtual void EmitFill (uint64_t NumBytes, uint8_t FillValue, unsigned AddrSpace=0)
void EmitZeros (uint64_t NumBytes, unsigned AddrSpace=0)
virtual void EmitValueToAlignment (unsigned ByteAlignment, int64_t Value=0, unsigned ValueSize=1, unsigned MaxBytesToEmit=0)=0
virtual void EmitCodeAlignment (unsigned ByteAlignment, unsigned MaxBytesToEmit=0)=0
virtual bool EmitValueToOffset (const MCExpr *Offset, unsigned char Value=0)=0

Protected Member Functions

 MCStreamer (StreamerKind Kind, MCContext &Ctx)
const MCExprBuildSymbolDiff (MCContext &Context, const MCSymbol *A, const MCSymbol *B)
const MCExprForceExpAbs (const MCExpr *Expr)
void RecordProcStart (MCDwarfFrameInfo &Frame)
virtual void EmitCFIStartProcImpl (MCDwarfFrameInfo &Frame)
void RecordProcEnd (MCDwarfFrameInfo &Frame)
virtual void EmitCFIEndProcImpl (MCDwarfFrameInfo &CurFrame)
void EmitFrames (bool usingCFI)
MCWin64EHUnwindInfogetCurrentW64UnwindInfo ()
void EmitW64Tables ()

Detailed Description

MCStreamer - Streaming machine code generation interface. This interface is intended to provide a programatic interface that is very similar to the level that an assembler .s file provides. It has callbacks to emit bytes, handle directives, etc. The implementation of this interface retains state to know what the current section is etc.

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 51 of file MCStreamer.h.


Member Enumeration Documentation

Enumerator:
SK_AsmStreamer 
SK_NullStreamer 
SK_RecordStreamer 
SK_ELFStreamer 
SK_ARMELFStreamer 
SK_MachOStreamer 
SK_PureStreamer 
SK_MipsELFStreamer 
SK_WinCOFFStreamer 

Definition at line 53 of file MCStreamer.h.


Constructor & Destructor Documentation

MCStreamer::MCStreamer ( StreamerKind  Kind,
MCContext Ctx 
) [protected]
MCStreamer::~MCStreamer ( ) [virtual]

Definition at line 30 of file MCStreamer.cpp.

References getNumW64UnwindInfos().


Member Function Documentation

virtual void llvm::MCStreamer::AddBlankLine ( ) [inline, virtual]
virtual void llvm::MCStreamer::AddComment ( const Twine T) [inline, virtual]

AddComment - Add a comment that can be emitted to the generated .s file if applicable as a QoI issue to make the output of the compiler more readable. This only affects the MCAsmStreamer, and only when verbose assembly output is enabled.

If the comment includes embedded
's, they will each get the comment prefix as appropriate. The added comment should not end with a
.

Definition at line 161 of file MCStreamer.h.

Referenced by llvm::AsmPrinter::doInitialization(), emitBasicBlockLoopComments(), llvm::AsmPrinter::EmitBasicBlockStart(), llvm::AsmPrinter::EmitCFAByte(), llvm::ARMAsmPrinter::EmitDwarfRegOp(), llvm::AsmPrinter::EmitDwarfRegOp(), llvm::AsmPrinter::EmitEncodingByte(), EmitEncodingByte(), llvm::DwarfException::EmitExceptionTable(), llvm::AsmPrinter::EmitFunctionBody(), llvm::AsmPrinter::EmitFunctionHeader(), emitImplicitDef(), llvm::X86AsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitInstruction(), emitKill(), llvm::AsmPrinter::EmitSLEB128(), EmitSymbol(), llvm::DwarfException::EmitTypeInfos(), and llvm::AsmPrinter::EmitULEB128().

virtual void llvm::MCStreamer::BeginCOFFSymbolDef ( const MCSymbol Symbol) [pure virtual]

BeginCOFFSymbolDef - Start emitting COFF symbol definition

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

Implemented in llvm::MCELFStreamer.

Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile(), and llvm::X86AsmPrinter::runOnMachineFunction().

const MCExpr * MCStreamer::BuildSymbolDiff ( MCContext Context,
const MCSymbol A,
const MCSymbol B 
) [protected]
virtual void llvm::MCStreamer::ChangeSection ( const MCSection ,
const MCExpr  
) [pure virtual]

ChangeSection - Update streamer for a new active section.

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

Implemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Referenced by PopSection(), and SwitchSection().

void MCStreamer::EmitAbsValue ( const MCExpr Value,
unsigned  Size,
unsigned  AddrSpace = 0 
)

EmitAbsValue - Emit the Value, but try to avoid relocations. On MachO this is done by producing foo = value .long foo

Definition at line 122 of file MCStreamer.cpp.

References EmitValue(), and ForceExpAbs().

Referenced by llvm::EmitAbsDifference(), llvm::MCDwarfFileTable::EmitCU(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), and EmitSymbol().

virtual void llvm::MCStreamer::EmitAssemblerFlag ( MCAssemblerFlag  Flag) [pure virtual]
virtual void llvm::MCStreamer::EmitAssignment ( MCSymbol Symbol,
const MCExpr Value 
) [pure virtual]

EmitAssignment - Emit an assignment of Value to Symbol.

This corresponds to an assembler statement such as: symbol = value

The assignment generates no code, but has the side effect of binding the value in the current context. For the assembly streamer, this prints the binding into the .s file.

Parameters:
Symbol- The symbol being assigned to.
Value- The value for the symbol.

Implemented in llvm::MCObjectStreamer.

Referenced by llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::AsmPrinter::EmitLabelDifference(), llvm::AsmPrinter::EmitLabelOffsetDifference(), and ForceExpAbs().

virtual void llvm::MCStreamer::EmitBundleAlignMode ( unsigned  AlignPow2) [pure 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.

Implemented in llvm::MCObjectStreamer.

virtual void llvm::MCStreamer::EmitBundleLock ( bool  AlignToEnd) [pure virtual]

The following instructions are a bundle-locked group.

Parameters:
AlignToEnd- If true, the bundle-locked group will be aligned to the end of a bundle.

Implemented in llvm::MCObjectStreamer.

virtual void llvm::MCStreamer::EmitBundleUnlock ( ) [pure virtual]

Ends a bundle-locked group.

Implemented in llvm::MCObjectStreamer.

virtual void llvm::MCStreamer::EmitBytes ( StringRef  Data,
unsigned  AddrSpace = 0 
) [pure virtual]
void MCStreamer::EmitCantUnwind ( ) [virtual]

Definition at line 549 of file MCStreamer.cpp.

References llvm::errs().

Referenced by llvm::ARMException::EndFunction().

void MCStreamer::EmitCFIAdjustCfaOffset ( int64_t  Adjustment) [virtual]
void MCStreamer::EmitCFIDefCfa ( int64_t  Register,
int64_t  Offset 
) [virtual]
void MCStreamer::EmitCFIDefCfaOffset ( int64_t  Offset) [virtual]
void MCStreamer::EmitCFIDefCfaRegister ( int64_t  Register) [virtual]
void MCStreamer::EmitCFIEndProc ( )

Definition at line 241 of file MCStreamer.cpp.

References EmitCFIEndProcImpl().

Referenced by llvm::DwarfCFIException::EndFunction().

void MCStreamer::EmitCFIEndProcImpl ( MCDwarfFrameInfo CurFrame) [protected, virtual]

Definition at line 247 of file MCStreamer.cpp.

Referenced by EmitCFIEndProc().

void MCStreamer::EmitCFIEscape ( StringRef  Values) [virtual]
void MCStreamer::EmitCFILsda ( const MCSymbol Sym,
unsigned  Encoding 
) [virtual]
void MCStreamer::EmitCFIOffset ( int64_t  Register,
int64_t  Offset 
) [virtual]
void MCStreamer::EmitCFIPersonality ( const MCSymbol Sym,
unsigned  Encoding 
) [virtual]
void MCStreamer::EmitCFIRegister ( int64_t  Register1,
int64_t  Register2 
) [virtual]
void MCStreamer::EmitCFIRelOffset ( int64_t  Register,
int64_t  Offset 
) [virtual]
void MCStreamer::EmitCFIRememberState ( ) [virtual]
void MCStreamer::EmitCFIRestore ( int64_t  Register) [virtual]
void MCStreamer::EmitCFIRestoreState ( ) [virtual]
void MCStreamer::EmitCFISameValue ( int64_t  Register) [virtual]
void MCStreamer::EmitCFISections ( bool  EH,
bool  Debug 
) [virtual]

Definition at line 208 of file MCStreamer.cpp.

References llvm::RegState::Debug.

Referenced by llvm::DwarfCFIException::EndModule().

void MCStreamer::EmitCFISignalFrame ( ) [virtual]

Definition at line 363 of file MCStreamer.cpp.

References llvm::MCDwarfFrameInfo::IsSignalFrame.

void MCStreamer::EmitCFIStartProc ( )
void MCStreamer::EmitCFIStartProcImpl ( MCDwarfFrameInfo Frame) [protected, virtual]

Definition at line 225 of file MCStreamer.cpp.

Referenced by EmitCFIStartProc().

void MCStreamer::EmitCFIUndefined ( int64_t  Register) [virtual]
virtual void llvm::MCStreamer::EmitCodeAlignment ( unsigned  ByteAlignment,
unsigned  MaxBytesToEmit = 0 
) [pure virtual]

EmitCodeAlignment - Emit nops until the byte alignment ByteAlignment is reached.

This used to align code where the alignment bytes may be executed. This can emit different bytes for different sizes to optimize execution.

Parameters:
ByteAlignment- The alignment to reach. This must be a power of two on some targets.
MaxBytesToEmit- The maximum numbers of bytes to emit, or 0. If the alignment cannot be reached in this many bytes, no bytes are emitted.

Implemented in llvm::MCObjectStreamer.

Referenced by llvm::AsmPrinter::EmitAlignment().

void MCStreamer::EmitCOFFSecRel32 ( MCSymbol const *  Symbol) [virtual]

EmitCOFFSecRel32 - Emits a COFF section relative relocation.

Parameters:
Symbol- Symbol the section relative realocation should point to.

Definition at line 535 of file MCStreamer.cpp.

References llvm_unreachable.

Referenced by llvm::AsmPrinter::EmitSectionOffset().

virtual void llvm::MCStreamer::EmitCOFFSymbolStorageClass ( int  StorageClass) [pure virtual]

EmitCOFFSymbolStorageClass - Emit the storage class of the symbol.

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

Implemented in llvm::MCELFStreamer.

Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile(), and llvm::X86AsmPrinter::runOnMachineFunction().

virtual void llvm::MCStreamer::EmitCOFFSymbolType ( int  Type) [pure virtual]

EmitCOFFSymbolType - Emit the type of the symbol.

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

Implemented in llvm::MCELFStreamer.

Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile(), and llvm::X86AsmPrinter::runOnMachineFunction().

virtual void llvm::MCStreamer::EmitCommonSymbol ( MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment 
) [pure virtual]

EmitCommonSymbol - Emit a common symbol.

Parameters:
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.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::AsmPrinter::EmitGlobalVariable().

void MCStreamer::EmitCompactUnwindEncoding ( uint32_t  CompactUnwindEncoding) [virtual]
virtual void llvm::MCStreamer::EmitDataRegion ( MCDataRegionType  Kind) [inline, virtual]
void MCStreamer::EmitDebugLabel ( MCSymbol Symbol) [virtual]
virtual void llvm::MCStreamer::EmitDwarfAdvanceFrameAddr ( const MCSymbol LastLabel,
const MCSymbol Label 
) [inline, virtual]

Reimplemented in llvm::MCObjectStreamer.

Definition at line 553 of file MCStreamer.h.

virtual void llvm::MCStreamer::EmitDwarfAdvanceLineAddr ( int64_t  LineDelta,
const MCSymbol LastLabel,
const MCSymbol Label,
unsigned  PointerSize 
) [pure virtual]

Implemented in llvm::MCObjectStreamer.

Referenced by EmitDwarfLineTable().

bool MCStreamer::EmitDwarfFileDirective ( unsigned  FileNo,
StringRef  Directory,
StringRef  Filename,
unsigned  CUID = 0 
) [virtual]

EmitDwarfFileDirective - Associate a filename with a specified logical file number. This implements the DWARF2 '.file 4 "foo.c"' assembler directive.

Definition at line 157 of file MCStreamer.cpp.

References getContext(), and llvm::MCContext::GetDwarfFile().

Referenced by llvm::DwarfDebug::getOrCreateSourceID().

void MCStreamer::EmitDwarfLocDirective ( unsigned  FileNo,
unsigned  Line,
unsigned  Column,
unsigned  Flags,
unsigned  Isa,
unsigned  Discriminator,
StringRef  FileName 
) [virtual]

EmitDwarfLocDirective - This implements the DWARF2.

Definition at line 163 of file MCStreamer.cpp.

References getContext(), and llvm::MCContext::setCurrentDwarfLoc().

void MCStreamer::EmitDwarfSetLineAddr ( int64_t  LineDelta,
const MCSymbol Label,
int  PointerSize 
)
void MCStreamer::EmitEHSymAttributes ( const MCSymbol Symbol,
MCSymbol EHSymbol 
) [virtual]

Definition at line 184 of file MCStreamer.cpp.

virtual void llvm::MCStreamer::EmitELFSize ( MCSymbol Symbol,
const MCExpr Value 
) [pure virtual]

EmitELFSize - Emit an ELF .size directive.

This corresponds to an assembler statement such as: .size symbol, expression

Implemented in llvm::MCELFStreamer.

Referenced by llvm::AsmPrinter::EmitFunctionBody(), llvm::AsmPrinter::EmitGlobalVariable(), and llvm::TargetLoweringObjectFileELF::emitPersonalityValue().

virtual void llvm::MCStreamer::EmitFileDirective ( StringRef  Filename) [pure virtual]

EmitFileDirective - Switch to a new logical file. This is used to implement the '.file "foo.c"' assembler directive.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::AsmPrinter::doInitialization().

void MCStreamer::EmitFill ( uint64_t  NumBytes,
uint8_t  FillValue,
unsigned  AddrSpace = 0 
) [virtual]

EmitFill - Emit NumBytes bytes worth of the value specified by FillValue. This implements directives such as '.space'.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 150 of file MCStreamer.cpp.

References llvm::MCConstantExpr::Create(), EmitValue(), and getContext().

Referenced by emitGlobalConstantArray(), emitGlobalConstantDataSequential(), and EmitZeros().

void MCStreamer::EmitFnEnd ( ) [virtual]

Definition at line 544 of file MCStreamer.cpp.

References llvm::errs().

Referenced by llvm::ARMException::EndFunction().

void MCStreamer::EmitFnStart ( ) [virtual]

ARM-related methods. FIXME: Eventually we should have some "target MC streamer" and move these methods there.

Definition at line 539 of file MCStreamer.cpp.

References llvm::errs().

Referenced by llvm::ARMException::BeginFunction().

void MCStreamer::EmitFrames ( bool  usingCFI) [protected]
void MCStreamer::EmitGPRel32Value ( const MCExpr Value) [virtual]

EmitGPRel32Value - Emit the expression Value into the output as a gprel32 (32-bit GP relative) value.

This is used to implement assembler directives such as .gprel32 on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 144 of file MCStreamer.cpp.

References llvm::report_fatal_error().

void MCStreamer::EmitGPRel64Value ( const MCExpr Value) [virtual]

EmitGPRel64Value - Emit the expression Value into the output as a gprel64 (64-bit GP relative) value.

This is used to implement assembler directives such as .gpdword on targets that support them.

Reimplemented in llvm::MCObjectStreamer.

Definition at line 140 of file MCStreamer.cpp.

References llvm::report_fatal_error().

void MCStreamer::EmitHandlerData ( ) [virtual]

Definition at line 554 of file MCStreamer.cpp.

References llvm::errs().

Referenced by llvm::ARMException::EndFunction().

virtual void llvm::MCStreamer::EmitInstruction ( const MCInst Inst) [pure virtual]
void MCStreamer::EmitIntValue ( uint64_t  Value,
unsigned  Size,
unsigned  AddrSpace = 0 
) [virtual]
void MCStreamer::EmitLabel ( MCSymbol Symbol) [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 in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Definition at line 188 of file MCStreamer.cpp.

References getCurrentSection(), llvm::MCSymbol::isVariable(), llvm::MCSymbol::setSection(), and ARMBuildAttrs::Symbol.

Referenced by llvm::ARMException::BeginFunction(), llvm::Win64Exception::BeginFunction(), llvm::MCGenDwarfInfo::Emit(), llvm::MCDwarfFrameEmitter::Emit(), llvm::AsmPrinter::EmitBasicBlockStart(), EmitCamlGlobal(), llvm::AsmPrinter::EmitConstantPool(), llvm::MCDwarfFileTable::EmitCU(), EmitDwarfLineTable(), llvm::X86AsmPrinter::EmitEndOfAsmFile(), llvm::SystemZAsmPrinter::EmitEndOfAsmFile(), llvm::AArch64AsmPrinter::EmitEndOfAsmFile(), llvm::ARMAsmPrinter::EmitEndOfAsmFile(), llvm::DwarfException::EmitExceptionTable(), llvm::AsmPrinter::EmitFunctionBody(), llvm::MipsAsmPrinter::EmitFunctionEntryLabel(), llvm::ARMAsmPrinter::EmitFunctionEntryLabel(), llvm::AsmPrinter::EmitFunctionEntryLabel(), llvm::AsmPrinter::EmitFunctionHeader(), EmitGenDwarfAranges(), EmitGenDwarfInfo(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::X86AsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitJump2Table(), llvm::ARMAsmPrinter::EmitJumpTable(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::ARMAsmPrinter::EmitMachineConstantPoolValue(), llvm::TargetLoweringObjectFileMachO::emitModuleFlags(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), emitSectionSym(), llvm::EmitUnwindInfo(), EmitWin64EHAllocStack(), EmitWin64EHEndChained(), EmitWin64EHEndProc(), EmitWin64EHEndProlog(), EmitWin64EHPushFrame(), EmitWin64EHPushReg(), EmitWin64EHSaveReg(), EmitWin64EHSaveXMM(), EmitWin64EHStartChained(), EmitWin64EHStartProc(), llvm::DwarfCFIException::EndFunction(), llvm::ARMException::EndFunction(), llvm::Win64Exception::EndFunction(), llvm::MCAsmInfo::getExprForFDESymbol(), llvm::TargetLoweringObjectFile::getTTypeReference(), llvm::MCLineEntry::Make(), llvm::MCGenDwarfLabelEntry::Make(), RecordProcEnd(), and RecordProcStart().

virtual void llvm::MCStreamer::EmitLinkerOptions ( ArrayRef< std::string >  Kind) [inline, virtual]

EmitLinkerOptions - Emit the given list Options of strings as linker options into the output.

Definition at line 291 of file MCStreamer.h.

Referenced by llvm::TargetLoweringObjectFileMachO::emitModuleFlags().

virtual void llvm::MCStreamer::EmitLocalCommonSymbol ( MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment 
) [pure 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.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::AsmPrinter::EmitGlobalVariable().

void MCStreamer::EmitPad ( int64_t  Offset) [virtual]

Definition at line 569 of file MCStreamer.cpp.

References llvm::errs().

void MCStreamer::EmitPersonality ( const MCSymbol Personality) [virtual]

Definition at line 559 of file MCStreamer.cpp.

References llvm::errs().

Referenced by llvm::ARMException::EndFunction().

void MCStreamer::EmitRawText ( StringRef  String) [virtual]

EmitRawText - If this file is backed by a assembly streamer, this dumps the specified string in the output .s file. This capability is indicated by the hasRawTextSupport() predicate. By default this aborts.

EmitRawText - If this file is backed by an assembly streamer, this dumps the specified string in the output .s file. This capability is indicated by the hasRawTextSupport() predicate.

Definition at line 586 of file MCStreamer.cpp.

References llvm::errs().

Referenced by llvm::HexagonAsmPrinter::EmitAlignment(), llvm::AsmPrinter::EmitBasicBlockStart(), emitDebugValueComment(), llvm::MipsAsmPrinter::emitFrameDirective(), llvm::AsmPrinter::EmitFunctionBody(), llvm::MipsAsmPrinter::EmitFunctionBodyEnd(), llvm::MipsAsmPrinter::EmitFunctionBodyStart(), llvm::MipsAsmPrinter::EmitFunctionEntryLabel(), llvm::X86AsmPrinter::EmitInstruction(), llvm::AArch64AsmPrinter::EmitInstruction(), llvm::ARMAsmPrinter::EmitInstruction(), EmitRawText(), llvm::MipsAsmPrinter::EmitStartOfAsmFile(), llvm::DIEInteger::EmitValue(), and llvm::AMDGPUAsmPrinter::runOnMachineFunction().

void MCStreamer::EmitRawText ( const Twine String)
void MCStreamer::EmitRegSave ( const SmallVectorImpl< unsigned > &  RegList,
bool  isVector 
) [virtual]

Definition at line 574 of file MCStreamer.cpp.

References llvm::errs().

void MCStreamer::EmitSetFP ( unsigned  FpReg,
unsigned  SpReg,
int64_t  Offset = 0 
) [virtual]

Definition at line 564 of file MCStreamer.cpp.

References llvm::errs().

void MCStreamer::EmitSLEB128IntValue ( int64_t  Value,
unsigned  AddrSpace = 0 
)

EmitSLEB128Value - Special case of EmitSLEB128Value that avoids the client having to pass in a MCExpr for constant integers.

Definition at line 115 of file MCStreamer.cpp.

References EmitBytes(), llvm::encodeSLEB128(), and llvm::raw_svector_ostream::str().

Referenced by llvm::AsmPrinter::EmitSLEB128(), and llvm::MCObjectStreamer::EmitSLEB128Value().

virtual void llvm::MCStreamer::EmitSLEB128Value ( const MCExpr Value) [pure virtual]

Implemented in llvm::MCObjectStreamer.

virtual void llvm::MCStreamer::EmitSymbolAttribute ( MCSymbol Symbol,
MCSymbolAttr  Attribute 
) [pure virtual]
virtual void llvm::MCStreamer::EmitSymbolDesc ( MCSymbol Symbol,
unsigned  DescValue 
) [pure 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.

Implemented in llvm::MCELFStreamer.

void MCStreamer::EmitSymbolValue ( const MCSymbol Sym,
unsigned  Size,
unsigned  AddrSpace = 0 
)
virtual void llvm::MCStreamer::EmitTBSSSymbol ( const MCSection Section,
MCSymbol Symbol,
uint64_t  Size,
unsigned  ByteAlignment = 0 
) [pure 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.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::AsmPrinter::EmitGlobalVariable().

void MCStreamer::EmitTCEntry ( const MCSymbol S) [virtual]

PPC-related methods. FIXME: Eventually replace it with some "target MC streamer" and move these methods there.

Reimplemented in llvm::MCELFStreamer.

Definition at line 579 of file MCStreamer.cpp.

References llvm_unreachable.

virtual void llvm::MCStreamer::EmitThumbFunc ( MCSymbol Func) [pure virtual]

EmitThumbFunc - Note in the output that the specified Func is a Thumb mode function (ARM target only).

Implemented in llvm::MCELFStreamer.

Referenced by llvm::ARMAsmPrinter::EmitFunctionEntryLabel().

void MCStreamer::EmitULEB128IntValue ( uint64_t  Value,
unsigned  Padding = 0,
unsigned  AddrSpace = 0 
)

EmitULEB128Value - Special case of EmitULEB128Value that avoids the client having to pass in a MCExpr for constant integers.

Definition at line 105 of file MCStreamer.cpp.

References EmitBytes(), llvm::encodeULEB128(), and llvm::raw_svector_ostream::str().

Referenced by EmitAbbrev(), llvm::MCDwarfFileTable::EmitCU(), EmitDwarfLineTable(), EmitDwarfSetLineAddr(), EmitGenDwarfAbbrev(), EmitGenDwarfInfo(), llvm::AsmPrinter::EmitULEB128(), and llvm::MCObjectStreamer::EmitULEB128Value().

virtual void llvm::MCStreamer::EmitULEB128Value ( const MCExpr Value) [pure virtual]

Implemented in llvm::MCObjectStreamer.

void MCStreamer::EmitValue ( const MCExpr Value,
unsigned  Size,
unsigned  AddrSpace = 0 
)
virtual void llvm::MCStreamer::EmitValueImpl ( const MCExpr Value,
unsigned  Size,
unsigned  AddrSpace 
) [pure 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.

Implemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Referenced by EmitSymbolValue(), and EmitValue().

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.

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.

Implemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Referenced by llvm::MCDwarfFrameEmitter::Emit(), llvm::AsmPrinter::EmitAlignment(), llvm::TargetLoweringObjectFileELF::emitPersonalityValue(), llvm::EmitRuntimeFunction(), and llvm::EmitUnwindInfo().

virtual bool llvm::MCStreamer::EmitValueToOffset ( const MCExpr Offset,
unsigned char  Value = 0 
) [pure virtual]

EmitValueToOffset - Emit some number of copies of Value until the byte offset Offset is reached.

This is used to implement assembler directives such as .org.

Parameters:
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.
Returns:
false on success, true if the offset was invalid.

Implemented in llvm::MCObjectStreamer.

void MCStreamer::EmitW64Tables ( ) [protected]

Definition at line 609 of file MCStreamer.cpp.

References llvm::MCWin64EHUnwindEmitter::Emit(), and getNumW64UnwindInfos().

virtual void llvm::MCStreamer::EmitWeakReference ( MCSymbol Alias,
const MCSymbol Symbol 
) [pure 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.

Implemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

void MCStreamer::EmitWin64EHAllocStack ( unsigned  Size) [virtual]
void MCStreamer::EmitWin64EHEndChained ( ) [virtual]
void MCStreamer::EmitWin64EHEndProc ( ) [virtual]
void MCStreamer::EmitWin64EHEndProlog ( ) [virtual]
void MCStreamer::EmitWin64EHHandler ( const MCSymbol Sym,
bool  Unwind,
bool  Except 
) [virtual]
void MCStreamer::EmitWin64EHHandlerData ( ) [virtual]
void MCStreamer::EmitWin64EHPushFrame ( bool  Code) [virtual]
void MCStreamer::EmitWin64EHPushReg ( unsigned  Register) [virtual]
void MCStreamer::EmitWin64EHSaveReg ( unsigned  Register,
unsigned  Offset 
) [virtual]
void MCStreamer::EmitWin64EHSaveXMM ( unsigned  Register,
unsigned  Offset 
) [virtual]
void MCStreamer::EmitWin64EHSetFrame ( unsigned  Register,
unsigned  Offset 
) [virtual]
void MCStreamer::EmitWin64EHStartChained ( ) [virtual]
void MCStreamer::EmitWin64EHStartProc ( const MCSymbol Symbol) [virtual]
virtual void llvm::MCStreamer::EmitZerofill ( const MCSection Section,
MCSymbol Symbol = 0,
uint64_t  Size = 0,
unsigned  ByteAlignment = 0 
) [pure 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.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::AsmPrinter::EmitGlobalVariable().

void llvm::MCStreamer::EmitZeros ( uint64_t  NumBytes,
unsigned  AddrSpace = 0 
) [inline]

EmitZeros - Emit NumBytes worth of zeros. This is a convenience function that just wraps EmitFill.

Definition at line 477 of file MCStreamer.h.

References EmitFill().

Referenced by llvm::AsmPrinter::EmitConstantPool(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantImpl(), emitGlobalConstantStruct(), and emitGlobalConstantVector().

virtual void llvm::MCStreamer::EndCOFFSymbolDef ( ) [pure virtual]

EndCOFFSymbolDef - Marks the end of the symbol definition.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile(), and llvm::X86AsmPrinter::runOnMachineFunction().

void MCStreamer::Finish ( )

Finish - Finish emission of machine code.

Definition at line 616 of file MCStreamer.cpp.

References FinishImpl(), and llvm::report_fatal_error().

Referenced by llvm::AsmPrinter::doFinalization().

virtual void llvm::MCStreamer::FinishImpl ( ) [pure virtual]

FinishImpl - Streamer specific finalization.

Implemented in llvm::MCObjectStreamer, and llvm::MCELFStreamer.

Referenced by Finish().

const MCExpr * MCStreamer::ForceExpAbs ( const MCExpr Expr) [protected]
raw_ostream & MCStreamer::GetCommentOS ( ) [virtual]

GetCommentOS - Return a raw_ostream that comments can be written to. Unlike AddComment, you are required to terminate comments with
if you use this method.

Definition at line 70 of file MCStreamer.cpp.

References llvm::nulls().

Referenced by emitBasicBlockLoopComments(), llvm::AsmPrinter::EmitFunctionBody(), llvm::AsmPrinter::EmitFunctionHeader(), emitGlobalConstantDataSequential(), emitGlobalConstantFP(), emitGlobalConstantImpl(), and llvm::AsmPrinter::EmitGlobalVariable().

MCContext& llvm::MCStreamer::getContext ( ) const [inline]
MCSectionSubPair llvm::MCStreamer::getCurrentSection ( ) const [inline]
MCWin64EHUnwindInfo* llvm::MCStreamer::getCurrentW64UnwindInfo ( ) [inline, protected]

Definition at line 109 of file MCStreamer.h.

const MCDwarfFrameInfo& llvm::MCStreamer::getFrameInfo ( unsigned  i) [inline]

Definition at line 127 of file MCStreamer.h.

ArrayRef<MCDwarfFrameInfo> llvm::MCStreamer::getFrameInfos ( ) [inline]

Definition at line 131 of file MCStreamer.h.

Referenced by llvm::MCDwarfFrameEmitter::Emit().

StreamerKind llvm::MCStreamer::getKind ( ) const [inline]
unsigned llvm::MCStreamer::getNumFrameInfos ( ) [inline]

Definition at line 123 of file MCStreamer.h.

Referenced by EmitFrames().

unsigned llvm::MCStreamer::getNumW64UnwindInfos ( ) [inline]
MCSymbolData & MCStreamer::getOrCreateSymbolData ( MCSymbol Symbol) [virtual]

getOrCreateSymbolData - Get symbol data for given symbol.

Reimplemented in llvm::MCELFStreamer.

Definition at line 623 of file MCStreamer.cpp.

References llvm::report_fatal_error().

MCSectionSubPair llvm::MCStreamer::getPreviousSection ( ) const [inline]

getPreviousSection - Return the previous section that the streamer is emitting code to.

Definition at line 186 of file MCStreamer.h.

References llvm::SmallVectorTemplateCommon< T, typename >::back(), and llvm::SmallVectorBase::empty().

Referenced by PushSection().

MCWin64EHUnwindInfo& llvm::MCStreamer::getW64UnwindInfo ( unsigned  i) [inline]

Definition at line 139 of file MCStreamer.h.

Referenced by llvm::MCWin64EHUnwindEmitter::Emit().

virtual bool llvm::MCStreamer::hasRawTextSupport ( ) const [inline, virtual]
virtual void llvm::MCStreamer::InitSections ( ) [pure virtual]

InitSections - Create the default sections and set the initial one.

Implemented in llvm::MCELFStreamer.

Referenced by llvm::LLVMTargetMachine::addPassesToEmitMC(), and InitStreamer().

void llvm::MCStreamer::InitStreamer ( ) [inline]

Initialize the streamer.

Definition at line 255 of file MCStreamer.h.

References InitSections().

Referenced by llvm::AsmPrinter::doInitialization().

virtual void llvm::MCStreamer::InitToTextSection ( ) [pure virtual]

InitToTextSection - Create a text section and switch the streamer to it.

Implemented in llvm::MCELFStreamer.

virtual bool llvm::MCStreamer::isVerboseAsm ( ) const [inline, virtual]

isVerboseAsm - Return true if this streamer supports verbose assembly and if it is enabled.

Definition at line 148 of file MCStreamer.h.

Referenced by llvm::AsmPrinter::AsmPrinter(), EmitEncodingByte(), llvm::DwarfException::EmitExceptionTable(), EmitSymbol(), and llvm::DwarfException::EmitTypeInfos().

bool llvm::MCStreamer::PopSection ( ) [inline]

popSection - Restore the current and previous section from the section stack. Calls ChangeSection as needed.

Returns false if the stack was empty.

Definition at line 209 of file MCStreamer.h.

References llvm::SmallVectorTemplateCommon< T, typename >::back(), ChangeSection(), llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateCommon< T, typename >::size().

Referenced by llvm::Win64Exception::EndFunction().

void llvm::MCStreamer::PushSection ( ) [inline]

pushSection - Save the current and previous section on the section stack.

Definition at line 200 of file MCStreamer.h.

References getCurrentSection(), getPreviousSection(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by llvm::Win64Exception::EndFunction().

void MCStreamer::RecordProcEnd ( MCDwarfFrameInfo Frame) [protected]
void MCStreamer::RecordProcStart ( MCDwarfFrameInfo Frame) [protected]
void MCStreamer::reset ( ) [virtual]
void llvm::MCStreamer::setAutoInitSections ( bool  AutoInitSections) [inline]

Tell this MCStreamer to call InitSections upon initialization.

Definition at line 261 of file MCStreamer.h.

bool llvm::MCStreamer::SubSection ( const MCExpr Subsection) [inline]
void llvm::MCStreamer::SwitchSection ( const MCSection Section,
const MCExpr Subsection = 0 
) [inline]
void llvm::MCStreamer::SwitchSectionNoChange ( const MCSection Section,
const MCExpr Subsection = 0 
) [inline]

SwitchSectionNoChange - Set the current section where code is being emitted to Section. This is required to update CurSection. This version does not call ChangeSection.

Definition at line 245 of file MCStreamer.h.

References llvm::SmallVectorTemplateCommon< T, typename >::back().


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