LLVM 20.0.0git
Namespaces | Functions
MCWin64EH.cpp File Reference
#include "llvm/MC/MCWin64EH.h"
#include "llvm/ADT/Twine.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCObjectStreamer.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Support/Win64EH.h"

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

static uint8_t CountOfUnwindCodes (std::vector< WinEH::Instruction > &Insns)
 
static void EmitAbsDifference (MCStreamer &Streamer, const MCSymbol *LHS, const MCSymbol *RHS)
 
static void EmitUnwindCode (MCStreamer &streamer, const MCSymbol *begin, WinEH::Instruction &inst)
 
static void EmitSymbolRefWithOfs (MCStreamer &streamer, const MCSymbol *Base, int64_t Offset)
 
static void EmitSymbolRefWithOfs (MCStreamer &streamer, const MCSymbol *Base, const MCSymbol *Other)
 
static void EmitRuntimeFunction (MCStreamer &streamer, const WinEH::FrameInfo *info)
 
static void EmitUnwindInfo (MCStreamer &streamer, WinEH::FrameInfo *info)
 
static const MCExprGetSubDivExpr (MCStreamer &Streamer, const MCSymbol *LHS, const MCSymbol *RHS, int Div)
 
static std::optional< int64_t > GetOptionalAbsDifference (MCStreamer &Streamer, const MCSymbol *LHS, const MCSymbol *RHS)
 
static int64_t GetAbsDifference (MCStreamer &Streamer, const MCSymbol *LHS, const MCSymbol *RHS)
 
static void checkARM64Instructions (MCStreamer &Streamer, ArrayRef< WinEH::Instruction > Insns, const MCSymbol *Begin, const MCSymbol *End, StringRef Name, StringRef Type)
 
static uint32_t ARM64CountOfUnwindCodes (ArrayRef< WinEH::Instruction > Insns)
 
static void ARM64EmitUnwindCode (MCStreamer &streamer, const WinEH::Instruction &inst)
 
static MCSymbolFindMatchingEpilog (const std::vector< WinEH::Instruction > &EpilogInstrs, const std::vector< MCSymbol * > &Epilogs, const WinEH::FrameInfo *info)
 
static void simplifyARM64Opcodes (std::vector< WinEH::Instruction > &Instructions, bool Reverse)
 
static int getARM64OffsetInProlog (const std::vector< WinEH::Instruction > &Prolog, const std::vector< WinEH::Instruction > &Epilog)
 
static int checkARM64PackedEpilog (MCStreamer &streamer, WinEH::FrameInfo *info, WinEH::FrameInfo::Segment *Seg, int PrologCodeBytes)
 
static bool tryARM64PackedUnwind (WinEH::FrameInfo *info, uint32_t FuncLength, int PackedEpilogOffset)
 
static void ARM64ProcessEpilogs (WinEH::FrameInfo *info, WinEH::FrameInfo::Segment *Seg, uint32_t &TotalCodeBytes, MapVector< MCSymbol *, uint32_t > &EpilogInfo)
 
static void ARM64FindSegmentsInFunction (MCStreamer &streamer, WinEH::FrameInfo *info, int64_t RawFuncLength)
 
static void ARM64EmitUnwindInfoForSegment (MCStreamer &streamer, WinEH::FrameInfo *info, WinEH::FrameInfo::Segment &Seg, bool TryPacked=true)
 
static void ARM64EmitUnwindInfo (MCStreamer &streamer, WinEH::FrameInfo *info, bool TryPacked=true)
 
static uint32_t ARMCountOfUnwindCodes (ArrayRef< WinEH::Instruction > Insns)
 
static uint32_t ARMCountOfInstructionBytes (ArrayRef< WinEH::Instruction > Insns, bool *HasCustom=nullptr)
 
static void checkARMInstructions (MCStreamer &Streamer, ArrayRef< WinEH::Instruction > Insns, const MCSymbol *Begin, const MCSymbol *End, StringRef Name, StringRef Type)
 
static bool isARMTerminator (const WinEH::Instruction &inst)
 
static void ARMEmitUnwindCode (MCStreamer &streamer, const WinEH::Instruction &inst)
 
static int getARMOffsetInProlog (const std::vector< WinEH::Instruction > &Prolog, const std::vector< WinEH::Instruction > &Epilog, bool CanTweakProlog)
 
static int checkARMPackedEpilog (MCStreamer &streamer, WinEH::FrameInfo *info, int PrologCodeBytes)
 
static bool parseRegMask (unsigned Mask, bool &HasLR, bool &HasR11, unsigned &Folded, int &IntRegs)
 
static bool tryARMPackedUnwind (MCStreamer &streamer, WinEH::FrameInfo *info, uint32_t FuncLength)
 
static void ARMEmitUnwindInfo (MCStreamer &streamer, WinEH::FrameInfo *info, bool TryPacked=true)
 
static void ARM64EmitRuntimeFunction (MCStreamer &streamer, const WinEH::FrameInfo *info)
 
static void ARMEmitRuntimeFunction (MCStreamer &streamer, const WinEH::FrameInfo *info)
 

Function Documentation

◆ ARM64CountOfUnwindCodes()

static uint32_t ARM64CountOfUnwindCodes ( ArrayRef< WinEH::Instruction Insns)
static

◆ ARM64EmitRuntimeFunction()

static void ARM64EmitRuntimeFunction ( MCStreamer streamer,
const WinEH::FrameInfo info 
)
static

◆ ARM64EmitUnwindCode()

static void ARM64EmitUnwindCode ( MCStreamer streamer,
const WinEH::Instruction inst 
)
static

◆ ARM64EmitUnwindInfo()

static void ARM64EmitUnwindInfo ( MCStreamer streamer,
WinEH::FrameInfo info,
bool  TryPacked = true 
)
static

◆ ARM64EmitUnwindInfoForSegment()

static void ARM64EmitUnwindInfoForSegment ( MCStreamer streamer,
WinEH::FrameInfo info,
WinEH::FrameInfo::Segment Seg,
bool  TryPacked = true 
)
static

◆ ARM64FindSegmentsInFunction()

static void ARM64FindSegmentsInFunction ( MCStreamer streamer,
WinEH::FrameInfo info,
int64_t  RawFuncLength 
)
static

◆ ARM64ProcessEpilogs()

static void ARM64ProcessEpilogs ( WinEH::FrameInfo info,
WinEH::FrameInfo::Segment Seg,
uint32_t TotalCodeBytes,
MapVector< MCSymbol *, uint32_t > &  EpilogInfo 
)
static

◆ ARMCountOfInstructionBytes()

static uint32_t ARMCountOfInstructionBytes ( ArrayRef< WinEH::Instruction Insns,
bool HasCustom = nullptr 
)
static

◆ ARMCountOfUnwindCodes()

static uint32_t ARMCountOfUnwindCodes ( ArrayRef< WinEH::Instruction Insns)
static

◆ ARMEmitRuntimeFunction()

static void ARMEmitRuntimeFunction ( MCStreamer streamer,
const WinEH::FrameInfo info 
)
static

◆ ARMEmitUnwindCode()

static void ARMEmitUnwindCode ( MCStreamer streamer,
const WinEH::Instruction inst 
)
static

◆ ARMEmitUnwindInfo()

static void ARMEmitUnwindInfo ( MCStreamer streamer,
WinEH::FrameInfo info,
bool  TryPacked = true 
)
static

◆ checkARM64Instructions()

static void checkARM64Instructions ( MCStreamer Streamer,
ArrayRef< WinEH::Instruction Insns,
const MCSymbol Begin,
const MCSymbol End,
StringRef  Name,
StringRef  Type 
)
static

◆ checkARM64PackedEpilog()

static int checkARM64PackedEpilog ( MCStreamer streamer,
WinEH::FrameInfo info,
WinEH::FrameInfo::Segment Seg,
int  PrologCodeBytes 
)
static

◆ checkARMInstructions()

static void checkARMInstructions ( MCStreamer Streamer,
ArrayRef< WinEH::Instruction Insns,
const MCSymbol Begin,
const MCSymbol End,
StringRef  Name,
StringRef  Type 
)
static

◆ checkARMPackedEpilog()

static int checkARMPackedEpilog ( MCStreamer streamer,
WinEH::FrameInfo info,
int  PrologCodeBytes 
)
static

◆ CountOfUnwindCodes()

static uint8_t CountOfUnwindCodes ( std::vector< WinEH::Instruction > &  Insns)
static

◆ EmitAbsDifference()

static void EmitAbsDifference ( MCStreamer Streamer,
const MCSymbol LHS,
const MCSymbol RHS 
)
static

◆ EmitRuntimeFunction()

static void EmitRuntimeFunction ( MCStreamer streamer,
const WinEH::FrameInfo info 
)
static

◆ EmitSymbolRefWithOfs() [1/2]

static void EmitSymbolRefWithOfs ( MCStreamer streamer,
const MCSymbol Base,
const MCSymbol Other 
)
static

◆ EmitSymbolRefWithOfs() [2/2]

static void EmitSymbolRefWithOfs ( MCStreamer streamer,
const MCSymbol Base,
int64_t  Offset 
)
static

◆ EmitUnwindCode()

static void EmitUnwindCode ( MCStreamer streamer,
const MCSymbol begin,
WinEH::Instruction inst 
)
static

◆ EmitUnwindInfo()

static void EmitUnwindInfo ( MCStreamer streamer,
WinEH::FrameInfo info 
)
static

◆ FindMatchingEpilog()

static MCSymbol * FindMatchingEpilog ( const std::vector< WinEH::Instruction > &  EpilogInstrs,
const std::vector< MCSymbol * > &  Epilogs,
const WinEH::FrameInfo info 
)
static

Definition at line 651 of file MCWin64EH.cpp.

References assert(), info, and llvm::Match.

Referenced by ARM64ProcessEpilogs(), and ARMEmitUnwindInfo().

◆ GetAbsDifference()

static int64_t GetAbsDifference ( MCStreamer Streamer,
const MCSymbol LHS,
const MCSymbol RHS 
)
static

◆ getARM64OffsetInProlog()

static int getARM64OffsetInProlog ( const std::vector< WinEH::Instruction > &  Prolog,
const std::vector< WinEH::Instruction > &  Epilog 
)
static

Definition at line 740 of file MCWin64EH.cpp.

References ARM64CountOfUnwindCodes(), Epilog, I, and Prolog.

Referenced by ARM64ProcessEpilogs(), and checkARM64PackedEpilog().

◆ getARMOffsetInProlog()

static int getARMOffsetInProlog ( const std::vector< WinEH::Instruction > &  Prolog,
const std::vector< WinEH::Instruction > &  Epilog,
bool  CanTweakProlog 
)
static

◆ GetOptionalAbsDifference()

static std::optional< int64_t > GetOptionalAbsDifference ( MCStreamer Streamer,
const MCSymbol LHS,
const MCSymbol RHS 
)
static

◆ GetSubDivExpr()

static const MCExpr * GetSubDivExpr ( MCStreamer Streamer,
const MCSymbol LHS,
const MCSymbol RHS,
int  Div 
)
static

◆ isARMTerminator()

static bool isARMTerminator ( const WinEH::Instruction inst)
static

◆ parseRegMask()

static bool parseRegMask ( unsigned  Mask,
bool HasLR,
bool HasR11,
unsigned Folded,
int &  IntRegs 
)
static

Definition at line 1828 of file MCWin64EH.cpp.

References llvm::First, IntRegs, and N.

Referenced by tryARMPackedUnwind().

◆ simplifyARM64Opcodes()

static void simplifyARM64Opcodes ( std::vector< WinEH::Instruction > &  Instructions,
bool  Reverse 
)
static

◆ tryARM64PackedUnwind()

static bool tryARM64PackedUnwind ( WinEH::FrameInfo info,
uint32_t  FuncLength,
int  PackedEpilogOffset 
)
static

◆ tryARMPackedUnwind()

static bool tryARMPackedUnwind ( MCStreamer streamer,
WinEH::FrameInfo info,
uint32_t  FuncLength 
)
static