LLVM  8.0.1
Macros | Functions | Variables
WinEHPrepare.cpp File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/MapVector.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/Analysis/CFG.h"
#include "llvm/Analysis/EHPersonalities.h"
#include "llvm/Transforms/Utils/Local.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/WinEHFuncInfo.h"
#include "llvm/IR/Verifier.h"
#include "llvm/MC/MCSymbol.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/BasicBlockUtils.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/Transforms/Utils/SSAUpdater.h"
Include dependency graph for WinEHPrepare.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "winehprepare"
 

Functions

 INITIALIZE_PASS (WinEHPrepare, DEBUG_TYPE, "Prepare Windows exceptions", false, false) FunctionPass *llvm
 
static int addUnwindMapEntry (WinEHFuncInfo &FuncInfo, int ToState, const BasicBlock *BB)
 
static void addTryBlockMapEntry (WinEHFuncInfo &FuncInfo, int TryLow, int TryHigh, int CatchHigh, ArrayRef< const CatchPadInst *> Handlers)
 
static BasicBlockgetCleanupRetUnwindDest (const CleanupPadInst *CleanupPad)
 
static void calculateStateNumbersForInvokes (const Function *Fn, WinEHFuncInfo &FuncInfo)
 
static const BasicBlockgetEHPadFromPredecessor (const BasicBlock *BB, Value *ParentPad)
 
static void calculateCXXStateNumbers (WinEHFuncInfo &FuncInfo, const Instruction *FirstNonPHI, int ParentState)
 
static int addSEHExcept (WinEHFuncInfo &FuncInfo, int ParentState, const Function *Filter, const BasicBlock *Handler)
 
static int addSEHFinally (WinEHFuncInfo &FuncInfo, int ParentState, const BasicBlock *Handler)
 
static void calculateSEHStateNumbers (WinEHFuncInfo &FuncInfo, const Instruction *FirstNonPHI, int ParentState)
 
static bool isTopLevelPadForMSVC (const Instruction *EHPad)
 
static int addClrEHHandler (WinEHFuncInfo &FuncInfo, int HandlerParentState, int TryParentState, ClrHandlerType HandlerType, uint32_t TypeToken, const BasicBlock *Handler)
 

Variables

static cl::opt< boolDisableDemotion ("disable-demotion", cl::Hidden, cl::desc("Clone multicolor basic blocks but do not demote cross scopes"), cl::init(false))
 
static cl::opt< boolDisableCleanups ("disable-cleanups", cl::Hidden, cl::desc("Do not remove implausible terminators or other similar cleanups"), cl::init(false))
 
static cl::opt< boolDemoteCatchSwitchPHIOnlyOpt ("demote-catchswitch-only", cl::Hidden, cl::desc("Demote catchswitch BBs only (for wasm EH)"), cl::init(false))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "winehprepare"

Definition at line 39 of file WinEHPrepare.cpp.

Function Documentation

◆ addClrEHHandler()

static int addClrEHHandler ( WinEHFuncInfo FuncInfo,
int  HandlerParentState,
int  TryParentState,
ClrHandlerType  HandlerType,
uint32_t  TypeToken,
const BasicBlock Handler 
)
static

◆ addSEHExcept()

static int addSEHExcept ( WinEHFuncInfo FuncInfo,
int  ParentState,
const Function Filter,
const BasicBlock Handler 
)
static

◆ addSEHFinally()

static int addSEHFinally ( WinEHFuncInfo FuncInfo,
int  ParentState,
const BasicBlock Handler 
)
static

◆ addTryBlockMapEntry()

static void addTryBlockMapEntry ( WinEHFuncInfo FuncInfo,
int  TryLow,
int  TryHigh,
int  CatchHigh,
ArrayRef< const CatchPadInst *>  Handlers 
)
static

◆ addUnwindMapEntry()

static int addUnwindMapEntry ( WinEHFuncInfo FuncInfo,
int  ToState,
const BasicBlock BB 
)
static

◆ calculateCXXStateNumbers()

static void calculateCXXStateNumbers ( WinEHFuncInfo FuncInfo,
const Instruction FirstNonPHI,
int  ParentState 
)
static

◆ calculateSEHStateNumbers()

static void calculateSEHStateNumbers ( WinEHFuncInfo FuncInfo,
const Instruction FirstNonPHI,
int  ParentState 
)
static

◆ calculateStateNumbersForInvokes()

static void calculateStateNumbersForInvokes ( const Function Fn,
WinEHFuncInfo FuncInfo 
)
static

◆ getCleanupRetUnwindDest()

static BasicBlock* getCleanupRetUnwindDest ( const CleanupPadInst CleanupPad)
static

◆ getEHPadFromPredecessor()

static const BasicBlock* getEHPadFromPredecessor ( const BasicBlock BB,
Value ParentPad 
)
static

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( WinEHPrepare  ,
DEBUG_TYPE  ,
"Prepare Windows exceptions ,
false  ,
false   
)

◆ isTopLevelPadForMSVC()

static bool isTopLevelPadForMSVC ( const Instruction EHPad)
static

Variable Documentation

◆ DemoteCatchSwitchPHIOnlyOpt

cl::opt<bool> DemoteCatchSwitchPHIOnlyOpt("demote-catchswitch-only", cl::Hidden, cl::desc("Demote catchswitch BBs only (for wasm EH)"), cl::init(false))
static

◆ DisableCleanups

cl::opt<bool> DisableCleanups("disable-cleanups", cl::Hidden, cl::desc("Do not remove implausible terminators or other similar cleanups"), cl::init(false))
static

◆ DisableDemotion

cl::opt<bool> DisableDemotion("disable-demotion", cl::Hidden, cl::desc( "Clone multicolor basic blocks but do not demote cross scopes"), cl::init(false))
static