#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"
namespace llvm {
class MCSection;
}
usingnamespacellvm;
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) { … }
void llvm::Win64EH::UnwindEmitter::Emit(MCStreamer &Streamer) const { … }
void llvm::Win64EH::UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
WinEH::FrameInfo *info,
bool HandlerData) const { … }
static const MCExpr *GetSubDivExpr(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 MCSymbol*
FindMatchingEpilog(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) { … }
void llvm::Win64EH::ARM64UnwindEmitter::Emit(MCStreamer &Streamer) const { … }
void llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
WinEH::FrameInfo *info,
bool HandlerData) const { … }
void llvm::Win64EH::ARMUnwindEmitter::Emit(MCStreamer &Streamer) const { … }
void llvm::Win64EH::ARMUnwindEmitter::EmitUnwindInfo(MCStreamer &Streamer,
WinEH::FrameInfo *info,
bool HandlerData) const { … }