LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | List of all members
llvm::StackMaps Class Reference

#include <StackMaps.h>

Classes

struct  Location
 

Public Types

enum  OpType { DirectMemRefOp, IndirectMemRefOp, ConstantOp }
 
typedef std::pair< Location,
MachineInstr::const_mop_iterator >(* 
OperandParser )(MachineInstr::const_mop_iterator, MachineInstr::const_mop_iterator, const TargetMachine &)
 

Public Member Functions

 StackMaps (AsmPrinter &AP, OperandParser OpParser)
 
void recordStackMap (const MachineInstr &MI)
 Generate a stackmap record for a stackmap instruction. More...
 
void recordPatchPoint (const MachineInstr &MI)
 Generate a stackmap record for a patchpoint instruction. More...
 
void serializeToStackMapSection ()
 

Detailed Description

Definition at line 81 of file StackMaps.h.

Member Typedef Documentation

Definition at line 98 of file StackMaps.h.

Member Enumeration Documentation

Enumerator
DirectMemRefOp 
IndirectMemRefOp 
ConstantOp 

Definition at line 104 of file StackMaps.h.

Constructor & Destructor Documentation

llvm::StackMaps::StackMaps ( AsmPrinter AP,
OperandParser  OpParser 
)
inline

Definition at line 106 of file StackMaps.h.

Member Function Documentation

void StackMaps::recordPatchPoint ( const MachineInstr MI)
void StackMaps::recordStackMap ( const MachineInstr MI)

Generate a stackmap record for a stackmap instruction.

MI must be a raw STACKMAP, not a PATCHPOINT.

Definition at line 123 of file StackMaps.cpp.

References llvm::MachineOperand::getImm(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), getStackMapEndMOP(), llvm::next(), llvm::MachineInstr::operands_begin(), llvm::MachineInstr::operands_end(), and llvm::TargetOpcode::STACKMAP.

Referenced by LowerSTACKMAP().

void StackMaps::serializeToStackMapSection ( )

If there is any stack map data, create a stack map section and serialize the map info into it. This clears the stack map data structures afterwards.

serializeToStackMapSection conceptually populates the following fields:

uint32 : Reserved (header) uint32 : NumConstants int64 : Constants[NumConstants] uint32 : NumRecords StkMapRecord[NumRecords] { uint32 : PatchPoint ID uint32 : Instruction Offset uint16 : Reserved (record flags) uint16 : NumLocations Location[NumLocations] { uint8 : Register | Direct | Indirect | Constant | ConstantIndex uint8 : Size in Bytes uint16 : Dwarf RegNum int32 : Offset } }

Location Encoding, Type, Value: 0x1, Register, Reg (value in register) 0x2, Direct, Reg + Offset (frame index) 0x3, Indirect, [Reg + Offset] (spilled value) 0x4, Constant, Offset (small constant) 0x5, ConstIndex, Constants[Offset] (large constant)

Definition at line 182 of file StackMaps.cpp.

References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::StackMaps::Location::Constant, llvm::StackMaps::Location::ConstantIndex, llvm::dbgs(), DEBUG, llvm::StackMaps::Location::Direct, llvm::MCStreamer::EmitIntValue(), llvm::MCStreamer::EmitLabel(), llvm::MCStreamer::EmitValue(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::MCStreamer::getContext(), llvm::MCRegisterInfo::getDwarfRegNum(), llvm::MCRegisterInfo::getLLVMRegNum(), llvm::MCRegisterInfo::getName(), llvm::MCContext::getObjectFileInfo(), llvm::MCContext::GetOrCreateSymbol(), llvm::TargetMachine::getRegisterInfo(), llvm::MCContext::getRegisterInfo(), llvm::MCObjectFileInfo::getStackMapSection(), llvm::MCRegisterInfo::getSubRegIdxOffset(), llvm::MCRegisterInfo::getSubRegIndex(), llvm::StackMaps::Location::Indirect, llvm::MCRegisterInfo::DiffListIterator::isValid(), llvm::StackMaps::Location::LocType, llvm::StackMaps::Location::Offset, llvm::AsmPrinter::OutStreamer, llvm::StackMaps::Location::Reg, llvm::StackMaps::Location::Register, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::MCStreamer::SwitchSection(), llvm::AsmPrinter::TM, and llvm::StackMaps::Location::Unprocessed.

Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile().


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