class BasicBlock;
class Constant;
class Function;
-class GlobalValue;
+class GlobalVariable;
+class InvokeInst;
class IntrinsicInst;
class LandingPadInst;
class MCSymbol;
};
void parseEHActions(const IntrinsicInst *II,
- SmallVectorImpl<ActionHandler *> &Actions);
-
+ SmallVectorImpl<std::unique_ptr<ActionHandler>> &Actions);
// The following structs respresent the .xdata for functions using C++
// exceptions on Windows.
};
struct WinEHFuncInfo {
+ DenseMap<const Function *, const LandingPadInst *> RootLPad;
+ DenseMap<const Function *, const InvokeInst *> LastInvoke;
+ DenseMap<const Function *, int> HandlerEnclosedState;
+ DenseMap<const Function *, bool> LastInvokeVisited;
DenseMap<const LandingPadInst *, int> LandingPadStateMap;
DenseMap<const Function *, int> CatchHandlerParentFrameObjIdx;
DenseMap<const Function *, int> CatchHandlerParentFrameObjOffset;
NumIPToStateFuncsVisited(0) {}
};
+/// Analyze the IR in ParentFn and it's handlers to build WinEHFuncInfo, which
+/// describes the state numbers and tables used by __CxxFrameHandler3. This
+/// analysis assumes that WinEHPrepare has already been run.
+void calculateWinCXXEHStateNumbers(const Function *ParentFn,
+ WinEHFuncInfo &FuncInfo);
+
}
#endif // LLVM_CODEGEN_WINEHFUNCINFO_H