[llvm] r250065 - [WinEH] Remove CatchObjRecoverIdx
David Majnemer via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 12 09:44:25 PDT 2015
Author: majnemer
Date: Mon Oct 12 11:44:22 2015
New Revision: 250065
URL: http://llvm.org/viewvc/llvm-project?rev=250065&view=rev
Log:
[WinEH] Remove CatchObjRecoverIdx
CatchObjRecoverIdx was used for the old scheme, it is no longer
relevant.
Modified:
llvm/trunk/include/llvm/CodeGen/WinEHFuncInfo.h
llvm/trunk/lib/CodeGen/AsmPrinter/WinException.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
Modified: llvm/trunk/include/llvm/CodeGen/WinEHFuncInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/WinEHFuncInfo.h?rev=250065&r1=250064&r2=250065&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/WinEHFuncInfo.h (original)
+++ llvm/trunk/include/llvm/CodeGen/WinEHFuncInfo.h Mon Oct 12 11:44:22 2015
@@ -60,7 +60,6 @@ struct SEHUnwindMapEntry {
struct WinEHHandlerType {
int Adjectives;
- int CatchObjRecoverIdx;
/// The CatchObj starts out life as an LLVM alloca, is turned into a frame
/// index, and after PEI, becomes a raw offset.
union {
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/WinException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/WinException.cpp?rev=250065&r1=250064&r2=250065&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/WinException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/WinException.cpp Mon Oct 12 11:44:22 2015
@@ -146,8 +146,7 @@ void WinException::endFunction(const Mac
}
}
-/// Retreive the MCSymbol for a GlobalValue or MachineBasicBlock. GlobalValues
-/// are used in the old WinEH scheme, and they will be removed eventually.
+/// Retreive the MCSymbol for a GlobalValue or MachineBasicBlock.
static MCSymbol *getMCSymbolForMBB(AsmPrinter *Asm,
const MachineBasicBlock *MBB) {
if (!MBB)
@@ -275,7 +274,6 @@ const MCExpr *WinException::create32bitR
const MCExpr *WinException::create32bitRef(const Value *V) {
if (!V)
return MCConstantExpr::create(0, Asm->OutContext);
- // FIXME: Delete the GlobalValue case once the new IR is fully functional.
if (const auto *GV = dyn_cast<GlobalValue>(V))
return create32bitRef(Asm->getSymbol(GV));
return create32bitRef(MMI->getAddrLabelSymbol(cast<BasicBlock>(V)));
@@ -649,16 +647,10 @@ void WinException::emitCXXFrameHandler3T
OS.EmitLabel(HandlerMapXData);
for (const WinEHHandlerType &HT : TBME.HandlerArray) {
// Get the frame escape label with the offset of the catch object. If
- // the index is -1, then there is no catch object, and we should emit an
- // offset of zero, indicating that no copy will occur.
+ // the index is INT_MAX, then there is no catch object, and we should
+ // emit an offset of zero, indicating that no copy will occur.
const MCExpr *FrameAllocOffsetRef = nullptr;
- if (HT.CatchObjRecoverIdx >= 0) {
- MCSymbol *FrameAllocOffset =
- Asm->OutContext.getOrCreateFrameAllocSymbol(
- FuncLinkageName, HT.CatchObjRecoverIdx);
- FrameAllocOffsetRef = MCSymbolRefExpr::create(
- FrameAllocOffset, MCSymbolRefExpr::VK_None, Asm->OutContext);
- } else if (HT.CatchObj.FrameIndex != INT_MAX) {
+ if (HT.CatchObj.FrameIndex != INT_MAX) {
int Offset = getFrameIndexOffset(HT.CatchObj.FrameIndex);
// For 32-bit, the catch object offset is relative to the end of the
// EH registration node. For 64-bit, it's relative to SP at the end of
@@ -681,7 +673,6 @@ void WinException::emitCXXFrameHandler3T
OS.EmitValue(create32bitRef(HandlerSym), 4); // Handler
if (shouldEmitPersonality) {
- // With the new IR, this is always 16 + 8 + getMaxCallFrameSize().
// Keep this in sync with X86FrameLowering::emitPrologue.
int ParentFrameOffset =
16 + 8 + MF->getFrameInfo()->getMaxCallFrameSize();
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp?rev=250065&r1=250064&r2=250065&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp Mon Oct 12 11:44:22 2015
@@ -297,7 +297,7 @@ void FunctionLoweringInfo::set(const Fun
// Map all BB references in the WinEH data to MBBs.
for (WinEHTryBlockMapEntry &TBME : EHInfo.TryBlockMap) {
for (WinEHHandlerType &H : TBME.HandlerArray) {
- if (H.CatchObjRecoverIdx == -2 && H.CatchObj.Alloca) {
+ if (H.CatchObj.Alloca) {
assert(StaticAllocaMap.count(H.CatchObj.Alloca));
H.CatchObj.FrameIndex = StaticAllocaMap[H.CatchObj.Alloca];
} else {
Modified: llvm/trunk/lib/CodeGen/WinEHPrepare.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/WinEHPrepare.cpp?rev=250065&r1=250064&r2=250065&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/WinEHPrepare.cpp (original)
+++ llvm/trunk/lib/CodeGen/WinEHPrepare.cpp Mon Oct 12 11:44:22 2015
@@ -194,7 +194,6 @@ static void addTryBlockMapEntry(WinEHFun
HT.TypeDescriptor = cast<GlobalVariable>(TypeInfo->stripPointerCasts());
HT.Adjectives = cast<ConstantInt>(CPI->getArgOperand(1))->getZExtValue();
HT.Handler = CPI->getParent();
- HT.CatchObjRecoverIdx = -2;
if (isa<ConstantPointerNull>(CPI->getArgOperand(2)))
HT.CatchObj.Alloca = nullptr;
else
More information about the llvm-commits
mailing list