This is an instance of a target assembly language printer that converts an MCInst to valid target assembly syntax.

Synopsis

Declared in <llvm/MC/MCInstPrinter.h>

class MCInstPrinter;

Types

Name

Description

WithMarkup

RAII helper that wraps streamed output in markup and optional color.

Enums

Name

Description

Markup

Markup categories for colored or annotated assembly operands.

Member Functions

Name

Description

MCInstPrinter [constructor]

Construct an instruction printer for the given target descriptions.

~MCInstPrinter [destructor] [virtual]

Destroy the instruction printer.

applyTargetSpecificCLOption [virtual]

Customize the printer according to a command line option.

formatDec

Utility functions to print decimal/hexadecimal values.

formatHex

formatHex overloads

formatImm

Utility function to print immediates in decimal or hex.

getMnemonic [virtual]

Returns a pair containing the mnemonic for MI and the number of bits left for further processing by printInstruction (generated by tablegen).

getOpcodeName

Return the name of the specified opcode enum (e.g. "MOV32ri") or empty if we can't resolve it.

getPrintImmHex

Return whether immediates are printed in hexadecimal.

getUseColor

Return whether ANSI color is enabled for printed assembly.

getUseMarkup

Return whether markup is enabled for printed assembly.

markup

Begin a markup region of category M on OS.

printInst [virtual]

Print the specified MCInst to the specified raw_ostream.

printRegName [virtual]

Print the assembler register name.

setCommentStream

Specify a stream to emit comments to.

setMCInstrAnalysis

Set the optional instruction analysis helper used when printing.

setPrintBranchImmAsAddress

Enable or disable printing branch immediates as addresses.

setPrintHexStyle

Set the hexadecimal printing style.

setPrintImmHex

Enable or disable printing immediates as hexadecimal.

setSymbolizeOperands

Enable or disable symbolizing branch and memory operands.

setUseColor

Enable or disable ANSI color in printed assembly.

setUseMarkup

Enable or disable markup in printed assembly.

Protected Member Functions

Name

Description

matchAliasPatterns

Helper for matching MCInsts to alias patterns when printing instructions.

printAnnotation

Utility function for printing annotations.

Protected Data Members

Name

Description

ColorStack

Stack of active markup colors for nested colored output regions.

CommentStream

A stream that comments can be emitted to if desired. Each comment must end with a newline. This will be null if verbose assembly emission is disabled.

MAI

Target assembly information used when printing instructions.

MIA

Optional instruction analysis helper used when symbolizing operands.

MII

Target instruction information used when printing instructions.

MRI

Target register information used when printing register names.

PrintAliases

True if we prefer aliases (e.g. nop) to raw mnemonics.

PrintBranchImmAsAddress

If true, a branch immediate (e.g. bl 4) will be printed as a hexadecimal address (e.g. bl 0x20004). This is useful for a stream disassembler (llvm‐objdump ‐d).

PrintHexStyle

Which style to use for printing hexadecimal values.

PrintImmHex

True if we are printing immediates as hex.

SymbolizeOperands

If true, symbolize branch target and memory reference operands.

UseColor

True if we are printing colored assembly.

UseMarkup

True if we are printing marked up assembly.

Created with MrDocs