#include "WinException.h"
#include "llvm/ADT/Twine.h"
#include "llvm/BinaryFormat/COFF.h"
#include "llvm/BinaryFormat/Dwarf.h"
#include "llvm/CodeGen/AsmPrinter.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/TargetFrameLowering.h"
#include "llvm/CodeGen/TargetLowering.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/CodeGen/WinEHFuncInfo.h"
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/Module.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
usingnamespacellvm;
WinException::WinException(AsmPrinter *A) : … { … }
WinException::~WinException() = default;
void WinException::endModule() { … }
void WinException::beginFunction(const MachineFunction *MF) { … }
void WinException::markFunctionEnd() { … }
void WinException::endFunction(const MachineFunction *MF) { … }
static MCSymbol *getMCSymbolForMBB(AsmPrinter *Asm,
const MachineBasicBlock *MBB) { … }
void WinException::beginFunclet(const MachineBasicBlock &MBB,
MCSymbol *Sym) { … }
void WinException::endFunclet() { … }
void WinException::endFuncletImpl() { … }
const MCExpr *WinException::create32bitRef(const MCSymbol *Value) { … }
const MCExpr *WinException::create32bitRef(const GlobalValue *GV) { … }
const MCExpr *WinException::getLabel(const MCSymbol *Label) { … }
const MCExpr *WinException::getLabelPlusOne(const MCSymbol *Label) { … }
const MCExpr *WinException::getOffset(const MCSymbol *OffsetOf,
const MCSymbol *OffsetFrom) { … }
const MCExpr *WinException::getOffsetPlusOne(const MCSymbol *OffsetOf,
const MCSymbol *OffsetFrom) { … }
int WinException::getFrameIndexOffset(int FrameIndex,
const WinEHFuncInfo &FuncInfo) { … }
namespace {
const int NullState = …;
struct InvokeStateChange { … };
class InvokeStateChangeIterator { … };
}
InvokeStateChangeIterator &InvokeStateChangeIterator::scan() { … }
void WinException::emitCSpecificHandlerTable(const MachineFunction *MF) { … }
void WinException::emitSEHActionsForRange(const WinEHFuncInfo &FuncInfo,
const MCSymbol *BeginLabel,
const MCSymbol *EndLabel, int State) { … }
void WinException::emitCXXFrameHandler3Table(const MachineFunction *MF) { … }
void WinException::computeIP2StateTable(
const MachineFunction *MF, const WinEHFuncInfo &FuncInfo,
SmallVectorImpl<std::pair<const MCExpr *, int>> &IPToStateTable) { … }
void WinException::emitEHRegistrationOffsetLabel(const WinEHFuncInfo &FuncInfo,
StringRef FLinkageName) { … }
void WinException::emitExceptHandlerTable(const MachineFunction *MF) { … }
static int getTryRank(const WinEHFuncInfo &FuncInfo, int State) { … }
static int getTryAncestor(const WinEHFuncInfo &FuncInfo, int Left, int Right) { … }
void WinException::emitCLRExceptionTable(const MachineFunction *MF) { … }