LLVM 24.0.0git
X86MCLFIRewriter.cpp File Reference
#include "X86MCLFIRewriter.h"
#include "X86BaseInfo.h"
#include "X86MCTargetDesc.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
#include "llvm/MC/MCInstBuilder.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include <algorithm>
#include <optional>

Go to the source code of this file.

Functions

static bool isPrefix (const MCInst &Inst, const MCInstrInfo &InstInfo)
static bool isSupportedPrefix (const MCInst &Inst)
static bool isSyscall (const MCInst &Inst)
static bool isDirectCall (const MCInst &Inst)
static bool isSupportedIndirectBranch (const MCInst &Inst)
static bool isWriteSegmentBase (unsigned Opcode)
static bool hasNoTrackPrefix (const MCInst &Inst, const MCInstrInfo &InstInfo)
static int findFSMemOperand (const MCInst &Inst, const MCInstrInfo &InstInfo)
static bool readsRegister (const MCInst &Inst, const MCInstrDesc &Desc, MCRegister Reg, const MCRegisterInfo &RI)
static bool isGR64OrNone (MCRegister Reg)
static void emitTPLoad (MCRegister Reg, MCStreamer &Out, const MCSubtargetInfo &STI)
static bool isSandboxBaseReg (MCRegister Reg)
static bool hasImplicitMemPointer (unsigned Opcode)
static bool isBitTestWithRegOffset (unsigned Opcode)
static bool ignoresMemOperand (unsigned Opcode)
static bool hasGPRIndex (const MCInst &Inst, int MemIdx)
static bool has32BitAddress (const MCInst &Inst, int MemIdx)
static std::optional< StringOpPointers > getStringOpPointers (unsigned Opcode)
static void emitStringPtrFixup (MCRegister Reg, MCRegister Reg32, MCStreamer &Out, const MCSubtargetInfo &STI)
static std::optional< unsigned > memToRegOpcode (unsigned Opcode)
static std::optional< unsigned > demote64BitOpcode (unsigned Opcode)
static void emitStackFixup (MCStreamer &Out, const MCSubtargetInfo &STI)

Variables

static constexpr MCRegister LFIBaseReg = X86::R14
static constexpr MCRegister LFIScratchReg = X86::R11
static constexpr MCRegister LFITPReg = X86::R15
static constexpr MCRegister LFIBaseSeg = X86::GS
static constexpr int TPOffset = 16

Function Documentation

◆ demote64BitOpcode()

std::optional< unsigned > demote64BitOpcode ( unsigned Opcode)
static

Definition at line 727 of file X86MCLFIRewriter.cpp.

◆ emitStackFixup()

void emitStackFixup ( MCStreamer & Out,
const MCSubtargetInfo & STI )
static

Definition at line 781 of file X86MCLFIRewriter.cpp.

References LFIBaseReg.

◆ emitStringPtrFixup()

void emitStringPtrFixup ( MCRegister Reg,
MCRegister Reg32,
MCStreamer & Out,
const MCSubtargetInfo & STI )
static

Definition at line 651 of file X86MCLFIRewriter.cpp.

References LFIBaseReg, and Reg.

◆ emitTPLoad()

void emitTPLoad ( MCRegister Reg,
MCStreamer & Out,
const MCSubtargetInfo & STI )
static

Definition at line 326 of file X86MCLFIRewriter.cpp.

References LFITPReg, Reg, and TPOffset.

◆ findFSMemOperand()

◆ getStringOpPointers()

std::optional< StringOpPointers > getStringOpPointers ( unsigned Opcode)
static

Definition at line 613 of file X86MCLFIRewriter.cpp.

◆ has32BitAddress()

◆ hasGPRIndex()

bool hasGPRIndex ( const MCInst & Inst,
int MemIdx )
static

◆ hasImplicitMemPointer()

bool hasImplicitMemPointer ( unsigned Opcode)
static

Definition at line 447 of file X86MCLFIRewriter.cpp.

◆ hasNoTrackPrefix()

bool hasNoTrackPrefix ( const MCInst & Inst,
const MCInstrInfo & InstInfo )
static

◆ ignoresMemOperand()

bool ignoresMemOperand ( unsigned Opcode)
static

Definition at line 513 of file X86MCLFIRewriter.cpp.

◆ isBitTestWithRegOffset()

bool isBitTestWithRegOffset ( unsigned Opcode)
static

Definition at line 483 of file X86MCLFIRewriter.cpp.

◆ isDirectCall()

bool isDirectCall ( const MCInst & Inst)
static

Definition at line 61 of file X86MCLFIRewriter.cpp.

References llvm::MCInst::getOpcode().

◆ isGR64OrNone()

bool isGR64OrNone ( MCRegister Reg)
static

Definition at line 125 of file X86MCLFIRewriter.cpp.

References Reg.

◆ isPrefix()

bool isPrefix ( const MCInst & Inst,
const MCInstrInfo & InstInfo )
static

Definition at line 40 of file X86MCLFIRewriter.cpp.

References llvm::MCInst::getOpcode(), and llvm::X86II::isPrefix().

◆ isSandboxBaseReg()

bool isSandboxBaseReg ( MCRegister Reg)
static

Definition at line 440 of file X86MCLFIRewriter.cpp.

References LFIBaseReg, and Reg.

◆ isSupportedIndirectBranch()

bool isSupportedIndirectBranch ( const MCInst & Inst)
static

Definition at line 65 of file X86MCLFIRewriter.cpp.

References llvm::MCInst::getOpcode().

◆ isSupportedPrefix()

bool isSupportedPrefix ( const MCInst & Inst)
static

Definition at line 45 of file X86MCLFIRewriter.cpp.

References llvm::MCInst::getOpcode().

◆ isSyscall()

bool isSyscall ( const MCInst & Inst)
static

Definition at line 57 of file X86MCLFIRewriter.cpp.

References llvm::MCInst::getOpcode().

◆ isWriteSegmentBase()

bool isWriteSegmentBase ( unsigned Opcode)
static

Definition at line 81 of file X86MCLFIRewriter.cpp.

◆ memToRegOpcode()

std::optional< unsigned > memToRegOpcode ( unsigned Opcode)
static

Definition at line 706 of file X86MCLFIRewriter.cpp.

◆ readsRegister()

Variable Documentation

◆ LFIBaseReg

MCRegister LFIBaseReg = X86::R14
staticconstexpr

Definition at line 29 of file X86MCLFIRewriter.cpp.

◆ LFIBaseSeg

MCRegister LFIBaseSeg = X86::GS
staticconstexpr

Definition at line 34 of file X86MCLFIRewriter.cpp.

◆ LFIScratchReg

MCRegister LFIScratchReg = X86::R11
staticconstexpr

Definition at line 30 of file X86MCLFIRewriter.cpp.

◆ LFITPReg

MCRegister LFITPReg = X86::R15
staticconstexpr

Definition at line 31 of file X86MCLFIRewriter.cpp.

Referenced by emitTPLoad().

◆ TPOffset

int TPOffset = 16
staticconstexpr

Definition at line 38 of file X86MCLFIRewriter.cpp.

Referenced by emitTPLoad().