#include "llvm/CodeGen/SjLjEHPrepare.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Transforms/Utils/Local.h"
usingnamespacellvm;
#define DEBUG_TYPE …
STATISTIC(NumInvokes, "Number of invokes replaced");
STATISTIC(NumSpilled, "Number of registers live across unwind edges");
namespace {
class SjLjEHPrepareImpl { … };
class SjLjEHPrepare : public FunctionPass { … };
}
PreservedAnalyses SjLjEHPreparePass::run(Function &F,
FunctionAnalysisManager &FAM) { … }
char SjLjEHPrepare::ID = …;
INITIALIZE_PASS(…)
FunctionPass *llvm::createSjLjEHPreparePass(const TargetMachine *TM) { … }
bool SjLjEHPrepareImpl::doInitialization(Module &M) { … }
void SjLjEHPrepareImpl::insertCallSiteStore(Instruction *I, int Number) { … }
static void MarkBlocksLiveIn(BasicBlock *BB,
SmallPtrSetImpl<BasicBlock *> &LiveBBs) { … }
void SjLjEHPrepareImpl::substituteLPadValues(LandingPadInst *LPI, Value *ExnVal,
Value *SelVal) { … }
Value *
SjLjEHPrepareImpl::setupFunctionContext(Function &F,
ArrayRef<LandingPadInst *> LPads) { … }
void SjLjEHPrepareImpl::lowerIncomingArguments(Function &F) { … }
void SjLjEHPrepareImpl::lowerAcrossUnwindEdges(Function &F,
ArrayRef<InvokeInst *> Invokes) { … }
bool SjLjEHPrepareImpl::setupEntryBlockAndCallSites(Function &F) { … }
bool SjLjEHPrepareImpl::runOnFunction(Function &F) { … }