[WinEH] Fix ip2state table emission with funclets
[oota-llvm.git] / include / llvm / CodeGen / WinEHFuncInfo.h
index 0f947812a015e924de0218fec00ba6a612977436..ac19ddf86bd6de961bf2cc9e16c2b556d9f96589 100644 (file)
@@ -28,6 +28,7 @@ class GlobalVariable;
 class InvokeInst;
 class IntrinsicInst;
 class LandingPadInst;
+class MCExpr;
 class MCSymbol;
 class MachineBasicBlock;
 class Value;
@@ -160,15 +161,18 @@ struct WinEHTryBlockMapEntry {
 
 struct WinEHFuncInfo {
   DenseMap<const Instruction *, int> EHPadStateMap;
+  DenseMap<MCSymbol *, std::pair<int, MCSymbol *>> InvokeToStateMap;
   SmallVector<WinEHUnwindMapEntry, 4> UnwindMap;
   SmallVector<WinEHTryBlockMapEntry, 4> TryBlockMap;
   SmallVector<SEHUnwindMapEntry, 4> SEHUnwindMap;
-  SmallVector<std::pair<MCSymbol *, int>, 4> IPToStateList;
   int UnwindHelpFrameIdx = INT_MAX;
   int UnwindHelpFrameOffset = -1;
 
   int getLastStateNumber() const { return UnwindMap.size() - 1; }
 
+  void addIPToStateRange(const BasicBlock *PadBB, MCSymbol *InvokeBegin,
+                         MCSymbol *InvokeEnd);
+
   /// localescape index of the 32-bit EH registration node. Set by
   /// WinEHStatePass and used indirectly by SEH filter functions of the parent.
   int EHRegNodeEscapeIndex = INT_MAX;