LLVM 24.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 constexpr unsigned EpilogDistanceThreshold = 32767
static cl::opt< unsignedApproxBytesPerInstr ("x86-wineh-unwindv3-instr-avg-size", cl::Hidden, cl::desc("Average size of an instruction. This value is used in determining " "split points for chained unwinder info"), cl::init(7))
 Approximate byte distance between an epilog and its fragment tail beyond which 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 146 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 71 of file X86WinEHUnwindV3.cpp.

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

Variable Documentation

◆ ApproxBytesPerInstr

cl::opt< unsigned > ApproxBytesPerInstr("x86-wineh-unwindv3-instr-avg-size", cl::Hidden, cl::desc( "Average size of an instruction. This value is used in determining " "split points for chained unwinder info"), cl::init(7)) ( "x86-wineh-unwindv3-instr-avg-size" ,
cl::Hidden ,
cl::desc( "Average size of an instruction. This value is used in determining " "split points for chained unwinder info") ,
cl::init(7)  )
static

Approximate byte distance between an epilog and its fragment tail beyond which the funclet is split into a new chained sub-fragment.

The V3 EpilogOffset field is a signed 16-bit byte offset measured from the fragment tail, so each fragment must span less than 32 KiB of code. The exact byte offsets aren't known until MC layout, so (like the V2 pass) an approximate byte count is used as a proxy — instructions are charged ApproxBytesPerInstr each and alignment padding is added.

◆ EpilogDistanceThreshold

unsigned EpilogDistanceThreshold = 32767
staticconstexpr

Definition at line 50 of file X86WinEHUnwindV3.cpp.

◆ 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.