LLVM 24.0.0git
llvm::MCCFIInstruction Class Reference

#include "llvm/MC/MCDwarf.h"

Classes

struct  CommonFields
struct  EscapeFields
struct  LabelFields
struct  LLVMSetRAStateFields
 Held in ExtraFields when OpLLVMSetRAState. More...
struct  RegisterPairFields
 Held in ExtraFields when OpLLVMRegisterPair. More...
struct  VectorOffsetFields
 Held in ExtraFields when OpLLVMVectorOffset. More...
struct  VectorRegisterMaskFields
 Held in ExtraFields when OpLLVMVectorRegisterMask. More...
struct  VectorRegistersFields
 Held in ExtraFields when OpLLVMVectorRegisters. More...
struct  VectorRegisterWithLane

Public Types

enum  OpType : uint8_t {
  OpSameValue , OpRememberState , OpRestoreState , OpOffset ,
  OpLLVMDefAspaceCfa , OpDefCfaRegister , OpDefCfaOffset , OpDefCfa ,
  OpRelOffset , OpAdjustCfaOffset , OpEscape , OpRestore ,
  OpUndefined , OpRegister , OpWindowSave , OpNegateRAState ,
  OpNegateRAStateWithPC , OpLLVMSetRAState , OpGnuArgsSize , OpLabel ,
  OpValOffset , OpLLVMRegisterPair , OpLLVMVectorRegisters , OpLLVMVectorOffset ,
  OpLLVMVectorRegisterMask
}

Public Member Functions

template<class ExtraFieldsTy>
ExtraFieldsTy & getExtraFields ()
template<class ExtraFieldsTy>
const ExtraFieldsTy & getExtraFields () const
OpType getOperation () const
MCSymbol * getLabel () const
unsigned getRegister () const
unsigned getRegister2 () const
unsigned getAddressSpace () const
int64_t getOffset () const
unsigned getRASignState () const
MCSymbol * getRASignSymbol () const
int64_t getRASignOffset () const
MCSymbol * getCfiLabel () const
StringRef getValues () const
StringRef getComment () const
SMLoc getLoc () const
LLVM_ABI void replaceRegister (unsigned FromReg, unsigned ToReg)
 Replaces in place all references to FromReg with ToReg.

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 createNegateRAStateWithPC (MCSymbol *L, SMLoc Loc={})
 .cfi_negate_ra_state_with_pc AArch64 negate RA state with PC.
static MCCFIInstruction createSetRAState (MCSymbol *L, unsigned State, MCSymbol *PACSym=nullptr, SMLoc Loc={})
 .cfi_set_ra_state AArch64 set RA sign state,
static MCCFIInstruction createSetRAState (MCSymbol *L, unsigned State, int64_t Offset, SMLoc Loc={})
 .cfi_set_ra_state AArch64 set RA sign state, with a pre-computed factored offset to the signing instruction.
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)
static MCCFIInstruction createLLVMRegisterPair (MCSymbol *L, unsigned Register, unsigned R1, unsigned R1SizeInBits, unsigned R2, unsigned R2SizeInBits, SMLoc Loc={})
 .cfi_llvm_register_pair Previous value of Register is saved in R1:R2.
static MCCFIInstruction createLLVMVectorRegisters (MCSymbol *L, unsigned Register, ArrayRef< VectorRegisterWithLane > VectorRegisters, SMLoc Loc={})
 .cfi_llvm_vector_registers Previous value of Register is saved in lanes of vector registers.
static MCCFIInstruction createLLVMVectorOffset (MCSymbol *L, unsigned Register, unsigned RegisterSizeInBits, unsigned MaskRegister, unsigned MaskRegisterSizeInBits, int64_t Offset, SMLoc Loc={})
 .cfi_llvm_vector_offset Previous value of Register is saved at Offset from CFA.
static MCCFIInstruction createLLVMVectorRegisterMask (MCSymbol *L, unsigned Register, unsigned SpillRegister, unsigned SpillRegisterLaneSizeInBits, unsigned MaskRegister, unsigned MaskRegisterSizeInBits, SMLoc Loc={})
 .cfi_llvm_vector_register_mask Previous value of Register is saved in SpillRegister, predicated on the value of MaskRegister.
static MCCFIInstruction createValOffset (MCSymbol *L, unsigned Register, int64_t Offset, SMLoc Loc={})
 .cfi_val_offset Previous value of Register is offset Offset from the current CFA register.

Detailed Description

Definition at line 513 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 
OpNegateRAStateWithPC 
OpLLVMSetRAState 
OpGnuArgsSize 
OpLabel 
OpValOffset 
OpLLVMRegisterPair 
OpLLVMVectorRegisters 
OpLLVMVectorOffset 
OpLLVMVectorRegisterMask 

Definition at line 515 of file MCDwarf.h.

Member Function Documentation

◆ cfiDefCfa()

◆ cfiDefCfaOffset()

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

◆ createAdjustCfaOffset()

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 654 of file MCDwarf.h.

Referenced by llvm::CFIInstBuilder::buildAdjustCFAOffset(), llvm::M68kFrameLowering::eliminateCallFramePseudoInstr(), llvm::X86FrameLowering::eliminateCallFramePseudoInstr(), llvm::MCStreamer::emitCFIAdjustCfaOffset(), llvm::X86FrameLowering::emitPrologue(), and ExpandMOVImmSExti8().

◆ createDefCfaRegister()

◆ createEscape()

◆ createGnuArgsSize()

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 768 of file MCDwarf.h.

References llvm::Size.

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

◆ createLabel()

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

Definition at line 773 of file MCDwarf.h.

References OpLabel.

Referenced by llvm::MCObjectStreamer::emitFill().

◆ createLLVMDefAspaceCfa()

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 663 of file MCDwarf.h.

References llvm::Offset, and OpLLVMDefAspaceCfa.

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

◆ createLLVMRegisterPair()

MCCFIInstruction llvm::MCCFIInstruction::createLLVMRegisterPair ( MCSymbol * L,
unsigned Register,
unsigned R1,
unsigned R1SizeInBits,
unsigned R2,
unsigned R2SizeInBits,
SMLoc Loc = {} )
inlinestatic

.cfi_llvm_register_pair Previous value of Register is saved in R1:R2.

Definition at line 780 of file MCDwarf.h.

References R2.

Referenced by llvm::SIFrameLowering::buildCFIForSRegToSRegSpill(), and llvm::MCStreamer::emitCFILLVMRegisterPair().

◆ createLLVMVectorOffset()

MCCFIInstruction llvm::MCCFIInstruction::createLLVMVectorOffset ( MCSymbol * L,
unsigned Register,
unsigned RegisterSizeInBits,
unsigned MaskRegister,
unsigned MaskRegisterSizeInBits,
int64_t Offset,
SMLoc Loc = {} )
inlinestatic

.cfi_llvm_vector_offset Previous value of Register is saved at Offset from CFA.

MaskRegister specifies the active lanes of register.

Definition at line 800 of file MCDwarf.h.

References llvm::Offset.

Referenced by llvm::SIFrameLowering::buildCFIForVGPRToVMEMSpill(), and llvm::MCStreamer::emitCFILLVMVectorOffset().

◆ createLLVMVectorRegisterMask()

MCCFIInstruction llvm::MCCFIInstruction::createLLVMVectorRegisterMask ( MCSymbol * L,
unsigned Register,
unsigned SpillRegister,
unsigned SpillRegisterLaneSizeInBits,
unsigned MaskRegister,
unsigned MaskRegisterSizeInBits,
SMLoc Loc = {} )
inlinestatic

.cfi_llvm_vector_register_mask Previous value of Register is saved in SpillRegister, predicated on the value of MaskRegister.

Definition at line 811 of file MCDwarf.h.

Referenced by llvm::SIFrameLowering::buildCFIForVRegToVRegSpill(), and llvm::MCStreamer::emitCFILLVMVectorRegisterMask().

◆ createLLVMVectorRegisters()

MCCFIInstruction llvm::MCCFIInstruction::createLLVMVectorRegisters ( MCSymbol * L,
unsigned Register,
ArrayRef< VectorRegisterWithLane > VectorRegisters,
SMLoc Loc = {} )
inlinestatic

◆ createNegateRAState()

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

.cfi_negate_ra_state AArch64 negate RA state.

Definition at line 699 of file MCDwarf.h.

Referenced by llvm::CFIInstBuilder::buildNegateRAState(), and llvm::MCStreamer::emitCFINegateRAState().

◆ createNegateRAStateWithPC()

MCCFIInstruction llvm::MCCFIInstruction::createNegateRAStateWithPC ( MCSymbol * L,
SMLoc Loc = {} )
inlinestatic

.cfi_negate_ra_state_with_pc AArch64 negate RA state with PC.

Definition at line 704 of file MCDwarf.h.

Referenced by llvm::CFIInstBuilder::buildNegateRAStateWithPC(), and llvm::MCStreamer::emitCFINegateRAStateWithPC().

◆ createOffset()

◆ createRegister()

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 688 of file MCDwarf.h.

Referenced by llvm::SIFrameLowering::buildCFIForSRegToSRegSpill(), llvm::CFIInstBuilder::buildRegister(), llvm::MCStreamer::emitCFIRegister(), and llvm::PPCFrameLowering::emitPrologue().

◆ createRelOffset()

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 681 of file MCDwarf.h.

References llvm::Offset.

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

◆ createRememberState()

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

.cfi_remember_state Save all current rules for all registers.

Definition at line 748 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIRememberState(), and insertRememberRestorePair().

◆ createRestore()

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 728 of file MCDwarf.h.

Referenced by llvm::CFIInstBuilder::buildRestore(), llvm::MSP430FrameLowering::emitCalleeSavedFrameMoves(), llvm::X86FrameLowering::emitCalleeSavedFrameMoves(), llvm::MCStreamer::emitCFIRestore(), llvm::MSP430FrameLowering::emitEpilogue(), and llvm::X86FrameLowering::emitEpilogue().

◆ createRestoreState()

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

.cfi_restore_state Restore the previously saved state.

Definition at line 753 of file MCDwarf.h.

Referenced by llvm::MCStreamer::emitCFIRestoreState(), and insertRememberRestorePair().

◆ createSameValue()

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 742 of file MCDwarf.h.

Referenced by llvm::SIFrameLowering::buildCFIForSameValue(), llvm::CFIInstBuilder::buildSameValue(), and llvm::MCStreamer::emitCFISameValue().

◆ createSetRAState() [1/2]

MCCFIInstruction llvm::MCCFIInstruction::createSetRAState ( MCSymbol * L,
unsigned State,
int64_t Offset,
SMLoc Loc = {} )
inlinestatic

.cfi_set_ra_state AArch64 set RA sign state, with a pre-computed factored offset to the signing instruction.

Definition at line 719 of file MCDwarf.h.

References llvm::Offset.

◆ createSetRAState() [2/2]

MCCFIInstruction llvm::MCCFIInstruction::createSetRAState ( MCSymbol * L,
unsigned State,
MCSymbol * PACSym = nullptr,
SMLoc Loc = {} )
inlinestatic

◆ createUndefined()

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 735 of file MCDwarf.h.

Referenced by llvm::SIFrameLowering::buildCFIForSRegToSRegSpill(), llvm::CFIInstBuilder::buildUndefined(), llvm::MCStreamer::emitCFIUndefined(), and llvm::SIFrameLowering::emitEntryFunctionPrologue().

◆ createValOffset()

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

.cfi_val_offset Previous value of Register is offset Offset from the current CFA register.

Definition at line 831 of file MCDwarf.h.

References llvm::Offset.

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

◆ createWindowSave()

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

.cfi_window_save SPARC register window is saved.

Definition at line 694 of file MCDwarf.h.

Referenced by llvm::CFIInstBuilder::buildWindowSave(), and llvm::MCStreamer::emitCFIWindowSave().

◆ getAddressSpace()

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

Definition at line 853 of file MCDwarf.h.

References assert(), and OpLLVMDefAspaceCfa.

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

◆ getCfiLabel()

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

Definition at line 881 of file MCDwarf.h.

References assert(), and OpLabel.

◆ getComment()

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

Definition at line 892 of file MCDwarf.h.

References assert(), and OpEscape.

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

◆ getExtraFields() [1/2]

template<class ExtraFieldsTy>
ExtraFieldsTy & llvm::MCCFIInstruction::getExtraFields ( )
inline

Definition at line 822 of file MCDwarf.h.

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

◆ getExtraFields() [2/2]

template<class ExtraFieldsTy>
const ExtraFieldsTy & llvm::MCCFIInstruction::getExtraFields ( ) const
inline

Definition at line 826 of file MCDwarf.h.

◆ getLabel()

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

Definition at line 837 of file MCDwarf.h.

Referenced by printCFI().

◆ getLoc()

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

Definition at line 896 of file MCDwarf.h.

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

◆ getOffset()

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

◆ getOperation()

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

◆ getRASignOffset()

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

Definition at line 876 of file MCDwarf.h.

References assert(), and OpLLVMSetRAState.

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

◆ getRASignState()

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

Definition at line 866 of file MCDwarf.h.

References assert(), and OpLLVMSetRAState.

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

◆ getRASignSymbol()

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

Definition at line 871 of file MCDwarf.h.

References assert(), and OpLLVMSetRAState.

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

◆ getRegister()

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

◆ getRegister2()

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

Definition at line 848 of file MCDwarf.h.

References assert(), and OpRegister.

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

◆ getValues()

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

Definition at line 886 of file MCDwarf.h.

References assert(), OpEscape, and llvm::Values.

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

◆ replaceRegister()

void MCCFIInstruction::replaceRegister ( unsigned FromReg,
unsigned ToReg )

Replaces in place all references to FromReg with ToReg.

Definition at line 1304 of file MCDwarf.cpp.

References F, llvm_unreachable, llvm::makeVisitor(), and llvm::MCCFIInstruction::VectorRegisterWithLane::Register.


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