#include "llvm/CodeGen/StackMaps.h"
#include "llvm/ADT/DenseMapInfo.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/Twine.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/raw_ostream.h"
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <iterator>
#include <utility>
usingnamespacellvm;
#define DEBUG_TYPE …
static cl::opt<int> StackMapVersion(
"stackmap-version", cl::init(3), cl::Hidden,
cl::desc("Specify the stackmap encoding version (default = 3)"));
const char *StackMaps::WSMP = …;
static uint64_t getConstMetaVal(const MachineInstr &MI, unsigned Idx) { … }
StackMapOpers::StackMapOpers(const MachineInstr *MI)
: … { … }
PatchPointOpers::PatchPointOpers(const MachineInstr *MI)
: … { … }
unsigned PatchPointOpers::getNextScratchIdx(unsigned StartIdx) const { … }
unsigned StatepointOpers::getNumGcMapEntriesIdx() { … }
unsigned StatepointOpers::getNumAllocaIdx() { … }
unsigned StatepointOpers::getNumGCPtrIdx() { … }
int StatepointOpers::getFirstGCPtrIdx() { … }
unsigned StatepointOpers::getGCPointerMap(
SmallVectorImpl<std::pair<unsigned, unsigned>> &GCMap) { … }
bool StatepointOpers::isFoldableReg(Register Reg) const { … }
bool StatepointOpers::isFoldableReg(const MachineInstr *MI, Register Reg) { … }
StackMaps::StackMaps(AsmPrinter &AP) : … { … }
unsigned StackMaps::getNextMetaArgIdx(const MachineInstr *MI, unsigned CurIdx) { … }
static unsigned getDwarfRegNum(unsigned Reg, const TargetRegisterInfo *TRI) { … }
MachineInstr::const_mop_iterator
StackMaps::parseOperand(MachineInstr::const_mop_iterator MOI,
MachineInstr::const_mop_iterator MOE, LocationVec &Locs,
LiveOutVec &LiveOuts) { … }
void StackMaps::print(raw_ostream &OS) { … }
StackMaps::LiveOutReg
StackMaps::createLiveOutReg(unsigned Reg, const TargetRegisterInfo *TRI) const { … }
StackMaps::LiveOutVec
StackMaps::parseRegisterLiveOutMask(const uint32_t *Mask) const { … }
void StackMaps::parseStatepointOpers(const MachineInstr &MI,
MachineInstr::const_mop_iterator MOI,
MachineInstr::const_mop_iterator MOE,
LocationVec &Locations,
LiveOutVec &LiveOuts) { … }
void StackMaps::recordStackMapOpers(const MCSymbol &MILabel,
const MachineInstr &MI, uint64_t ID,
MachineInstr::const_mop_iterator MOI,
MachineInstr::const_mop_iterator MOE,
bool recordResult) { … }
void StackMaps::recordStackMap(const MCSymbol &L, const MachineInstr &MI) { … }
void StackMaps::recordPatchPoint(const MCSymbol &L, const MachineInstr &MI) { … }
void StackMaps::recordStatepoint(const MCSymbol &L, const MachineInstr &MI) { … }
void StackMaps::emitStackmapHeader(MCStreamer &OS) { … }
void StackMaps::emitFunctionFrameRecords(MCStreamer &OS) { … }
void StackMaps::emitConstantPoolEntries(MCStreamer &OS) { … }
void StackMaps::emitCallsiteEntries(MCStreamer &OS) { … }
void StackMaps::serializeToStackMapSection() { … }