LLVM 23.0.0git
X86WinEHUnwindV3.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "x86-wineh-unwindv3"

Functions

 STATISTIC (FunctionsProcessed, "Number of functions processed by Unwind v3 pass")
 STATISTIC (SubFragmentSplits, "Number of sub-fragment splits inserted for Unwind v3")
static void suppressWinCFI (MachineFunction &MF)
 After reporting a recoverable error for MF, erase all SEH pseudo- instructions and clear the WinCFI flag so the AsmPrinter doesn't try to emit (potentially malformed) unwind information.
 INITIALIZE_PASS (X86WinEHUnwindV3, "x86-wineh-unwindv3", "Capacity check and sub-fragment splitting for Win64 Unwind v3", false, false) FunctionPass *llvm

Variables

static constexpr unsigned MaxV3PrologOps = 31
 V3 limits from the format specification.
static constexpr unsigned MaxV3Epilogs = 7
static constexpr unsigned MaxV3EpilogOps = 31
static cl::opt< unsignedEpilogDistanceThreshold ("x86-wineh-unwindv3-epilog-distance-threshold", cl::Hidden, cl::desc("Maximum approximate instruction distance between adjacent epilogs " "(or between the last epilog and the funclet end) before " "splitting into a new chained unwind info for Unwind v3."), cl::init(3000))
 Maximum approximate instruction distance allowed between two adjacent epilogs, and between the last epilog and the funclet end, before the funclet is split into a new chained sub-fragment.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "x86-wineh-unwindv3"

Definition at line 39 of file X86WinEHUnwindV3.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( X86WinEHUnwindV3 ,
"x86-wineh-unwindv3" ,
"Capacity check and sub-fragment splitting for Win64 Unwind v3" ,
false ,
false  )

Definition at line 147 of file X86WinEHUnwindV3.cpp.

References llvm::createX86WinEHUnwindV3Pass().

◆ STATISTIC() [1/2]

STATISTIC ( FunctionsProcessed ,
"Number of functions processed by Unwind v3 pass"  )

◆ STATISTIC() [2/2]

STATISTIC ( SubFragmentSplits ,
"Number of sub-fragment splits inserted for Unwind v3"  )

◆ suppressWinCFI()

void suppressWinCFI ( MachineFunction & MF)
static

After reporting a recoverable error for MF, erase all SEH pseudo- instructions and clear the WinCFI flag so the AsmPrinter doesn't try to emit (potentially malformed) unwind information.

The LLVMContext diagnostic recorded by the caller will prevent the object file from actually being written.

Definition at line 72 of file X86WinEHUnwindV3.cpp.

References llvm::make_early_inc_range(), MBB, MI, and llvm::MachineFunction::setHasWinCFI().

Variable Documentation

◆ EpilogDistanceThreshold

cl::opt< unsigned > EpilogDistanceThreshold("x86-wineh-unwindv3-epilog-distance-threshold", cl::Hidden, cl::desc( "Maximum approximate instruction distance between adjacent epilogs " "(or between the last epilog and the funclet end) before " "splitting into a new chained unwind info for Unwind v3."), cl::init(3000)) ( "x86-wineh-unwindv3-epilog-distance-threshold" ,
cl::Hidden ,
cl::desc( "Maximum approximate instruction distance between adjacent epilogs " "(or between the last epilog and the funclet end) before " "splitting into a new chained unwind info for Unwind v3.") ,
cl::init(3000)  )
static

Maximum approximate instruction distance allowed between two adjacent epilogs, and between the last epilog and the funclet end, before the funclet is split into a new chained sub-fragment.

V3 encodes each epilog's position as a signed 16-bit EpilogOffset: a delta from the previous epilog, with the tail-closest epilog encoded relative to the fragment end. The exact byte offsets aren't known until MC layout, so the approximate instruction count is used as a proxy, with margin for the average emitted instruction size.

◆ MaxV3EpilogOps

unsigned MaxV3EpilogOps = 31
staticconstexpr

Definition at line 49 of file X86WinEHUnwindV3.cpp.

◆ MaxV3Epilogs

unsigned MaxV3Epilogs = 7
staticconstexpr

Definition at line 48 of file X86WinEHUnwindV3.cpp.

◆ MaxV3PrologOps

unsigned MaxV3PrologOps = 31
staticconstexpr

V3 limits from the format specification.

Definition at line 47 of file X86WinEHUnwindV3.cpp.