llvm.org GIT mirror llvm / afd18f6
[WinEH] Remove CatchObjRecoverIdx CatchObjRecoverIdx was used for the old scheme, it is no longer relevant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250065 91177308-0d34-0410-b5e6-96231b3b80d8 David Majnemer 4 years ago
4 changed file(s) with 5 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
5959
6060 struct WinEHHandlerType {
6161 int Adjectives;
62 int CatchObjRecoverIdx;
6362 /// The CatchObj starts out life as an LLVM alloca, is turned into a frame
6463 /// index, and after PEI, becomes a raw offset.
6564 union {
145145 }
146146 }
147147
148 /// Retreive the MCSymbol for a GlobalValue or MachineBasicBlock. GlobalValues
149 /// are used in the old WinEH scheme, and they will be removed eventually.
148 /// Retreive the MCSymbol for a GlobalValue or MachineBasicBlock.
150149 static MCSymbol *getMCSymbolForMBB(AsmPrinter *Asm,
151150 const MachineBasicBlock *MBB) {
152151 if (!MBB)
274273 const MCExpr *WinException::create32bitRef(const Value *V) {
275274 if (!V)
276275 return MCConstantExpr::create(0, Asm->OutContext);
277 // FIXME: Delete the GlobalValue case once the new IR is fully functional.
278276 if (const auto *GV = dyn_cast(V))
279277 return create32bitRef(Asm->getSymbol(GV));
280278 return create32bitRef(MMI->getAddrLabelSymbol(cast(V)));
648646 OS.EmitLabel(HandlerMapXData);
649647 for (const WinEHHandlerType &HT : TBME.HandlerArray) {
650648 // Get the frame escape label with the offset of the catch object. If
651 // the index is -1, then there is no catch object, and we should emit an
652 // offset of zero, indicating that no copy will occur.
649 // the index is INT_MAX, then there is no catch object, and we should
650 // emit an offset of zero, indicating that no copy will occur.
653651 const MCExpr *FrameAllocOffsetRef = nullptr;
654 if (HT.CatchObjRecoverIdx >= 0) {
655 MCSymbol *FrameAllocOffset =
656 Asm->OutContext.getOrCreateFrameAllocSymbol(
657 FuncLinkageName, HT.CatchObjRecoverIdx);
658 FrameAllocOffsetRef = MCSymbolRefExpr::create(
659 FrameAllocOffset, MCSymbolRefExpr::VK_None, Asm->OutContext);
660 } else if (HT.CatchObj.FrameIndex != INT_MAX) {
652 if (HT.CatchObj.FrameIndex != INT_MAX) {
661653 int Offset = getFrameIndexOffset(HT.CatchObj.FrameIndex);
662654 // For 32-bit, the catch object offset is relative to the end of the
663655 // EH registration node. For 64-bit, it's relative to SP at the end of
680672 OS.EmitValue(create32bitRef(HandlerSym), 4); // Handler
681673
682674 if (shouldEmitPersonality) {
683 // With the new IR, this is always 16 + 8 + getMaxCallFrameSize().
684675 // Keep this in sync with X86FrameLowering::emitPrologue.
685676 int ParentFrameOffset =
686677 16 + 8 + MF->getFrameInfo()->getMaxCallFrameSize();
296296 // Map all BB references in the WinEH data to MBBs.
297297 for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
298298 for (WinEHHandlerType &H : TBME.HandlerArray) {
299 if (H.CatchObjRecoverIdx == -2 && H.CatchObj.Alloca) {
299 if (H.CatchObj.Alloca) {
300300 assert(StaticAllocaMap.count(H.CatchObj.Alloca));
301301 H.CatchObj.FrameIndex = StaticAllocaMap[H.CatchObj.Alloca];
302302 } else {
193193 HT.TypeDescriptor = cast(TypeInfo->stripPointerCasts());
194194 HT.Adjectives = cast(CPI->getArgOperand(1))->getZExtValue();
195195 HT.Handler = CPI->getParent();
196 HT.CatchObjRecoverIdx = -2;
197196 if (isa(CPI->getArgOperand(2)))
198197 HT.CatchObj.Alloca = nullptr;
199198 else