LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::MCCFIInstruction Class Reference

#include "llvm/MC/MCDwarf.h"

Public Types

enum  OpType : uint8_t {
  OpSameValue , OpRememberState , OpRestoreState , OpOffset ,
  OpLLVMDefAspaceCfa , OpDefCfaRegister , OpDefCfaOffset , OpDefCfa ,
  OpRelOffset , OpAdjustCfaOffset , OpEscape , OpRestore ,
  OpUndefined , OpRegister , OpWindowSave , OpNegateRAState ,
  OpGnuArgsSize , OpLabel
}
 

Public Member Functions

OpType getOperation () const
 
MCSymbolgetLabel () const
 
unsigned getRegister () const
 
unsigned getRegister2 () const
 
unsigned getAddressSpace () const
 
int64_t getOffset () const
 
MCSymbolgetCfiLabel () const
 
StringRef getValues () const
 
StringRef getComment () const
 
SMLoc getLoc () const
 

Static Public Member Functions

static MCCFIInstruction cfiDefCfa (MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
 .cfi_def_cfa defines a rule for computing CFA as: take address from Register and add Offset to it.
 
static MCCFIInstruction createDefCfaRegister (MCSymbol *L, unsigned Register, SMLoc Loc={})
 .cfi_def_cfa_register modifies a rule for computing CFA.
 
static MCCFIInstruction cfiDefCfaOffset (MCSymbol *L, int64_t Offset, SMLoc Loc={})
 .cfi_def_cfa_offset modifies a rule for computing CFA.
 
static MCCFIInstruction createAdjustCfaOffset (MCSymbol *L, int64_t Adjustment, SMLoc Loc={})
 .cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but Offset is a relative value that is added/subtracted from the previous offset.
 
static MCCFIInstruction createLLVMDefAspaceCfa (MCSymbol *L, unsigned Register, int64_t Offset, unsigned AddressSpace, SMLoc Loc)
 .cfi_llvm_def_aspace_cfa defines the rule for computing the CFA to be the result of evaluating the DWARF operation expression DW_OP_constu AS; DW_OP_aspace_bregx R, B as a location description.
 
static MCCFIInstruction createOffset (MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
 .cfi_offset Previous value of Register is saved at offset Offset from CFA.
 
static MCCFIInstruction createRelOffset (MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
 .cfi_rel_offset Previous value of Register is saved at offset Offset from the current CFA register.
 
static MCCFIInstruction createRegister (MCSymbol *L, unsigned Register1, unsigned Register2, SMLoc Loc={})
 .cfi_register Previous value of Register1 is saved in register Register2.
 
static MCCFIInstruction createWindowSave (MCSymbol *L, SMLoc Loc={})
 .cfi_window_save SPARC register window is saved.
 
static MCCFIInstruction createNegateRAState (MCSymbol *L, SMLoc Loc={})
 .cfi_negate_ra_state AArch64 negate RA state.
 
static MCCFIInstruction createRestore (MCSymbol *L, unsigned Register, SMLoc Loc={})
 .cfi_restore says that the rule for Register is now the same as it was at the beginning of the function, after all initial instructions added by .cfi_startproc were executed.
 
static MCCFIInstruction createUndefined (MCSymbol *L, unsigned Register, SMLoc Loc={})
 .cfi_undefined From now on the previous value of Register can't be restored anymore.
 
static MCCFIInstruction createSameValue (MCSymbol *L, unsigned Register, SMLoc Loc={})
 .cfi_same_value Current value of Register is the same as in the previous frame.
 
static MCCFIInstruction createRememberState (MCSymbol *L, SMLoc Loc={})
 .cfi_remember_state Save all current rules for all registers.
 
static MCCFIInstruction createRestoreState (MCSymbol *L, SMLoc Loc={})
 .cfi_restore_state Restore the previously saved state.
 
static MCCFIInstruction createEscape (MCSymbol *L, StringRef Vals, SMLoc Loc={}, StringRef Comment="")
 .cfi_escape Allows the user to add arbitrary bytes to the unwind info.
 
static MCCFIInstruction createGnuArgsSize (MCSymbol *L, int64_t Size, SMLoc Loc={})
 A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE.
 
static MCCFIInstruction createLabel (MCSymbol *L, MCSymbol *CfiLabel, SMLoc Loc)
 

Detailed Description

Definition at line 484 of file MCDwarf.h.

Member Enumeration Documentation

◆ OpType

Enumerator
OpSameValue 
OpRememberState 
OpRestoreState 
OpOffset 
OpLLVMDefAspaceCfa 
OpDefCfaRegister 
OpDefCfaOffset 
OpDefCfa 
OpRelOffset 
OpAdjustCfaOffset 
OpEscape 
OpRestore 
OpUndefined 
OpRegister 
OpWindowSave 
OpNegateRAState 
OpGnuArgsSize 
OpLabel 

Definition at line 486 of file MCDwarf.h.

Member Function Documentation

◆ cfiDefCfa()

static MCCFIInstruction llvm::MCCFIInstruction::cfiDefCfa ( MCSymbol L,
unsigned  Register,
int64_t  Offset,
SMLoc  Loc = {} 
)
inlinestatic

◆ cfiDefCfaOffset()

static MCCFIInstruction llvm::MCCFIInstruction::cfiDefCfaOffset ( MCSymbol L,
int64_t  Offset,
SMLoc  Loc = {} 
)
inlinestatic

◆ createAdjustCfaOffset()

static MCCFIInstruction llvm::MCCFIInstruction::createAdjustCfaOffset ( MCSymbol L,
int64_t  Adjustment,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_adjust_cfa_offset Same as .cfi_def_cfa_offset, but Offset is a relative value that is added/subtracted from the previous offset.

Definition at line 581 of file MCDwarf.h.

Referenced by llvm::MSP430FrameLowering::eliminateCallFramePseudoInstr(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::MCStreamer::emitCFIAdjustCfaOffset(), and ExpandMOVImmSExti8().

◆ createDefCfaRegister()

static MCCFIInstruction llvm::MCCFIInstruction::createDefCfaRegister ( MCSymbol L,
unsigned  Register,
SMLoc  Loc = {} 
)
inlinestatic

◆ createEscape()

static MCCFIInstruction llvm::MCCFIInstruction::createEscape ( MCSymbol L,
StringRef  Vals,
SMLoc  Loc = {},
StringRef  Comment = "" 
)
inlinestatic

◆ createGnuArgsSize()

static MCCFIInstruction llvm::MCCFIInstruction::createGnuArgsSize ( MCSymbol L,
int64_t  Size,
SMLoc  Loc = {} 
)
inlinestatic

A special wrapper for .cfi_escape that indicates GNU_ARGS_SIZE.

Definition at line 670 of file MCDwarf.h.

Referenced by llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), and llvm::MCStreamer::emitCFIGnuArgsSize().

◆ createLabel()

static MCCFIInstruction llvm::MCCFIInstruction::createLabel ( MCSymbol L,
MCSymbol CfiLabel,
SMLoc  Loc 
)
inlinestatic

Definition at line 675 of file MCDwarf.h.

References CfiLabel, and OpLabel.

Referenced by llvm::MCStreamer::emitCFILabelDirective().

◆ createLLVMDefAspaceCfa()

static MCCFIInstruction llvm::MCCFIInstruction::createLLVMDefAspaceCfa ( MCSymbol L,
unsigned  Register,
int64_t  Offset,
unsigned  AddressSpace,
SMLoc  Loc 
)
inlinestatic

.cfi_llvm_def_aspace_cfa defines the rule for computing the CFA to be the result of evaluating the DWARF operation expression DW_OP_constu AS; DW_OP_aspace_bregx R, B as a location description.

Definition at line 590 of file MCDwarf.h.

References Offset, and OpLLVMDefAspaceCfa.

Referenced by llvm::MCStreamer::emitCFILLVMDefAspaceCfa().

◆ createNegateRAState()

static MCCFIInstruction llvm::MCCFIInstruction::createNegateRAState ( MCSymbol L,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_negate_ra_state AArch64 negate RA state.

Definition at line 626 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFINegateRAState(), and llvm::AArch64FrameLowering::resetCFIToInitialState().

◆ createOffset()

static MCCFIInstruction llvm::MCCFIInstruction::createOffset ( MCSymbol L,
unsigned  Register,
int64_t  Offset,
SMLoc  Loc = {} 
)
inlinestatic

◆ createRegister()

static MCCFIInstruction llvm::MCCFIInstruction::createRegister ( MCSymbol L,
unsigned  Register1,
unsigned  Register2,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_register Previous value of Register1 is saved in register Register2.

Definition at line 615 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIRegister(), llvm::PPCFrameLowering::emitPrologue(), and llvm::SparcFrameLowering::emitPrologue().

◆ createRelOffset()

static MCCFIInstruction llvm::MCCFIInstruction::createRelOffset ( MCSymbol L,
unsigned  Register,
int64_t  Offset,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_rel_offset Previous value of Register is saved at offset Offset from the current CFA register.

This is transformed to .cfi_offset using the known displacement of the CFA register from the CFA.

Definition at line 608 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIRelOffset().

◆ createRememberState()

static MCCFIInstruction llvm::MCCFIInstruction::createRememberState ( MCSymbol L,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_remember_state Save all current rules for all registers.

Definition at line 653 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIRememberState(), and llvm::CFIFixup::runOnMachineFunction().

◆ createRestore()

static MCCFIInstruction llvm::MCCFIInstruction::createRestore ( MCSymbol L,
unsigned  Register,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_restore says that the rule for Register is now the same as it was at the beginning of the function, after all initial instructions added by .cfi_startproc were executed.

Definition at line 633 of file MCDwarf.h.

Referenced by llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), emitCalleeSavedRestores(), llvm::MCStreamer::emitCFIRestore(), llvm::MSP430FrameLowering::emitEpilogue(), llvm::X86FrameLowering::emitEpilogue(), emitSCSEpilogue(), emitShadowCallStackEpilogue(), and emitVGSaveRestore().

◆ createRestoreState()

static MCCFIInstruction llvm::MCCFIInstruction::createRestoreState ( MCSymbol L,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_restore_state Restore the previously saved state.

Definition at line 658 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIRestoreState(), and llvm::CFIFixup::runOnMachineFunction().

◆ createSameValue()

static MCCFIInstruction llvm::MCCFIInstruction::createSameValue ( MCSymbol L,
unsigned  Register,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_same_value Current value of Register is the same as in the previous frame.

I.e., no restoration is needed.

Definition at line 647 of file MCDwarf.h.

Referenced by llvm::ARMFrameLowering::adjustForSegmentedStacks(), llvm::MCStreamer::emitCFISameValue(), and insertCFISameValue().

◆ createUndefined()

static MCCFIInstruction llvm::MCCFIInstruction::createUndefined ( MCSymbol L,
unsigned  Register,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_undefined From now on the previous value of Register can't be restored anymore.

Definition at line 640 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIUndefined().

◆ createWindowSave()

static MCCFIInstruction llvm::MCCFIInstruction::createWindowSave ( MCSymbol L,
SMLoc  Loc = {} 
)
inlinestatic

.cfi_window_save SPARC register window is saved.

Definition at line 621 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIWindowSave(), and llvm::SparcFrameLowering::emitPrologue().

◆ getAddressSpace()

unsigned llvm::MCCFIInstruction::getAddressSpace ( ) const
inline

Definition at line 700 of file MCDwarf.h.

References assert(), Operation, and OpLLVMDefAspaceCfa.

Referenced by llvm::AsmPrinter::emitCFIInstruction(), and printCFI().

◆ getCfiLabel()

MCSymbol * llvm::MCCFIInstruction::getCfiLabel ( ) const
inline

Definition at line 714 of file MCDwarf.h.

References assert(), Operation, and OpLabel.

◆ getComment()

StringRef llvm::MCCFIInstruction::getComment ( ) const
inline

Definition at line 724 of file MCDwarf.h.

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

◆ getLabel()

MCSymbol * llvm::MCCFIInstruction::getLabel ( ) const
inline

Definition at line 681 of file MCDwarf.h.

Referenced by printCFI().

◆ getLoc()

SMLoc llvm::MCCFIInstruction::getLoc ( ) const
inline

Definition at line 725 of file MCDwarf.h.

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

◆ getOffset()

int64_t llvm::MCCFIInstruction::getOffset ( ) const
inline

◆ getOperation()

OpType llvm::MCCFIInstruction::getOperation ( ) const
inline

◆ getRegister()

unsigned llvm::MCCFIInstruction::getRegister ( ) const
inline

◆ getRegister2()

unsigned llvm::MCCFIInstruction::getRegister2 ( ) const
inline

Definition at line 695 of file MCDwarf.h.

References assert(), Operation, and OpRegister.

Referenced by llvm::AsmPrinter::emitCFIInstruction(), and printCFI().

◆ getValues()

StringRef llvm::MCCFIInstruction::getValues ( ) const
inline

Definition at line 719 of file MCDwarf.h.

References assert(), Operation, and OpEscape.

Referenced by llvm::AsmPrinter::emitCFIInstruction(), and printCFI().

Member Data Documentation

◆ AddressSpace

unsigned llvm::MCCFIInstruction::AddressSpace

Definition at line 517 of file MCDwarf.h.

◆ CfiLabel

MCSymbol* llvm::MCCFIInstruction::CfiLabel

Definition at line 523 of file MCDwarf.h.

Referenced by createLabel().

◆ Offset

int64_t llvm::MCCFIInstruction::Offset

Definition at line 512 of file MCDwarf.h.

Referenced by createLLVMDefAspaceCfa().

◆ Register

unsigned llvm::MCCFIInstruction::Register

Definition at line 511 of file MCDwarf.h.

◆ Register2

unsigned llvm::MCCFIInstruction::Register2

Definition at line 521 of file MCDwarf.h.

◆ 

struct { ... } llvm::MCCFIInstruction::RI

◆ 

struct { ... } llvm::MCCFIInstruction::RIA

◆ 

struct { ... } llvm::MCCFIInstruction::RR

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