LLVM
8.0.1
|
#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"
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 BasicBlock * | getCleanupRetUnwindDest (const CleanupPadInst *CleanupPad) |
static void | calculateStateNumbersForInvokes (const Function *Fn, WinEHFuncInfo &FuncInfo) |
static const BasicBlock * | getEHPadFromPredecessor (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< bool > | DisableDemotion ("disable-demotion", cl::Hidden, cl::desc("Clone multicolor basic blocks but do not demote cross scopes"), cl::init(false)) |
static cl::opt< bool > | DisableCleanups ("disable-cleanups", cl::Hidden, cl::desc("Do not remove implausible terminators or other similar cleanups"), cl::init(false)) |
static cl::opt< bool > | DemoteCatchSwitchPHIOnlyOpt ("demote-catchswitch-only", cl::Hidden, cl::desc("Demote catchswitch BBs only (for wasm EH)"), cl::init(false)) |
#define DEBUG_TYPE "winehprepare" |
Definition at line 39 of file WinEHPrepare.cpp.
|
static |
Definition at line 464 of file WinEHPrepare.cpp.
References llvm::WinEHFuncInfo::ClrEHUnwindMap, llvm::ClrEHUnwindMapEntry::Handler, llvm::ClrEHUnwindMapEntry::HandlerParentState, llvm::ClrEHUnwindMapEntry::HandlerType, llvm::ClrEHUnwindMapEntry::TryParentState, and llvm::ClrEHUnwindMapEntry::TypeToken.
Referenced by llvm::calculateClrEHStateNumbers().
|
static |
Definition at line 316 of file WinEHPrepare.cpp.
References llvm::SEHUnwindMapEntry::Filter, llvm::Filter, llvm::SEHUnwindMapEntry::Handler, llvm::SEHUnwindMapEntry::IsFinally, llvm::WinEHFuncInfo::SEHUnwindMap, and llvm::SEHUnwindMapEntry::ToState.
Referenced by calculateSEHStateNumbers().
|
static |
Definition at line 327 of file WinEHPrepare.cpp.
References llvm::SEHUnwindMapEntry::Filter, llvm::SEHUnwindMapEntry::Handler, llvm::SEHUnwindMapEntry::IsFinally, llvm::WinEHFuncInfo::SEHUnwindMap, and llvm::SEHUnwindMapEntry::ToState.
Referenced by calculateSEHStateNumbers().
|
static |
Definition at line 139 of file WinEHPrepare.cpp.
References llvm::WinEHHandlerType::Adjectives, llvm::WinEHHandlerType::Alloca, assert(), llvm::WinEHTryBlockMapEntry::CatchHigh, llvm::WinEHHandlerType::CatchObj, llvm::WinEHHandlerType::Handler, llvm::WinEHTryBlockMapEntry::HandlerArray, llvm::Constant::isNullValue(), llvm::Constant::stripPointerCasts(), llvm::WinEHFuncInfo::TryBlockMap, llvm::WinEHTryBlockMapEntry::TryHigh, llvm::WinEHTryBlockMapEntry::TryLow, and llvm::WinEHHandlerType::TypeDescriptor.
Referenced by calculateCXXStateNumbers().
|
static |
Definition at line 130 of file WinEHPrepare.cpp.
References llvm::CxxUnwindMapEntry::Cleanup, llvm::WinEHFuncInfo::CxxUnwindMap, llvm::WinEHFuncInfo::getLastStateNumber(), and llvm::CxxUnwindMapEntry::ToState.
Referenced by calculateCXXStateNumbers().
|
static |
Definition at line 236 of file WinEHPrepare.cpp.
References addTryBlockMapEntry(), addUnwindMapEntry(), assert(), llvm::dbgs(), llvm::WinEHFuncInfo::EHPadStateMap, llvm::WinEHFuncInfo::FuncletBaseStateMap, getCleanupRetUnwindDest(), getEHPadFromPredecessor(), llvm::WinEHFuncInfo::getLastStateNumber(), llvm::Value::getName(), llvm::Instruction::getParent(), llvm::BasicBlock::isEHPad(), LLVM_DEBUG, llvm::predecessors(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::report_fatal_error(), and llvm::Value::users().
Referenced by llvm::calculateWinCXXEHStateNumbers().
|
static |
Definition at line 338 of file WinEHPrepare.cpp.
References addSEHExcept(), addSEHFinally(), assert(), llvm::calculateSEHStateNumbers(), llvm::dbgs(), llvm::dyn_cast(), llvm::WinEHFuncInfo::EHPadStateMap, llvm::Filter, getCleanupRetUnwindDest(), getEHPadFromPredecessor(), llvm::Value::getName(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::BasicBlock::isEHPad(), llvm::Constant::isNullValue(), LLVM_DEBUG, llvm::predecessors(), llvm::report_fatal_error(), and llvm::Value::users().
|
static |
Definition at line 173 of file WinEHPrepare.cpp.
References assert(), llvm::colorEHFunclets(), llvm::dyn_cast(), llvm::WinEHFuncInfo::EHPadStateMap, F(), llvm::BasicBlock::front(), llvm::WinEHFuncInfo::FuncletBaseStateMap, getCleanupRetUnwindDest(), llvm::Function::getEntryBlock(), llvm::BasicBlock::getFirstNonPHI(), llvm::WinEHFuncInfo::InvokeStateMap, and llvm_unreachable.
Referenced by llvm::calculateSEHStateNumbers(), and llvm::calculateWinCXXEHStateNumbers().
|
static |
Definition at line 166 of file WinEHPrepare.cpp.
References llvm::Value::users().
Referenced by calculateCXXStateNumbers(), calculateSEHStateNumbers(), calculateStateNumbersForInvokes(), and isTopLevelPadForMSVC().
|
static |
Definition at line 219 of file WinEHPrepare.cpp.
References assert(), llvm::BasicBlock::getTerminator(), and llvm::Instruction::isEHPad().
Referenced by calculateCXXStateNumbers(), and calculateSEHStateNumbers().
INITIALIZE_PASS | ( | WinEHPrepare | , |
DEBUG_TYPE | , | ||
"Prepare Windows exceptions" | , | ||
false | , | ||
false | |||
) |
Definition at line 104 of file WinEHPrepare.cpp.
References llvm::classifyEHPersonality(), llvm::Module::getDataLayout(), llvm::GlobalValue::getParent(), llvm::Function::getPersonalityFn(), llvm::Function::hasPersonalityFn(), llvm::isScopedEHPersonality(), and runOnFunction().
|
static |
Definition at line 416 of file WinEHPrepare.cpp.
References getCleanupRetUnwindDest(), and llvm_unreachable.
Referenced by llvm::calculateSEHStateNumbers(), and llvm::calculateWinCXXEHStateNumbers().
|
static |
|
static |