Skip to content

Commit c92893d

Browse files
authored
Update SROA.cpp
#115
1 parent c21e605 commit c92893d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

llvm/lib/Transforms/Scalar/SROA.cpp

+10-4
Original file line numberDiff line numberDiff line change
@@ -3504,16 +3504,22 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
35043504
// for the new alloca slice.
35053505
Type *PointerTy = IRB.getPtrTy(OldPtr->getType()->getPointerAddressSpace());
35063506
Value *Ptr = getNewAllocaSlicePtr(IRB, PointerTy);
3507-
#ifndef _WIN32
3507+
bool bShouldDisableLifetimeMarker = false;
3508+
3509+
if (II.getParent() && II.getParent()->getParent() && II.getParent()->getParent()->hasSEHOrCXXSEH()) {
3510+
bShouldDisableLifetimeMarker = true;
3511+
}
3512+
3513+
if (!bShouldDisableLifetimeMarker) {
35083514
Value *New;
35093515
if (II.getIntrinsicID() == Intrinsic::lifetime_start)
35103516
New = IRB.CreateLifetimeStart(Ptr, Size);
35113517
else
35123518
New = IRB.CreateLifetimeEnd(Ptr, Size);
35133519

3514-
(void)New;
3515-
LLVM_DEBUG(dbgs() << " to: " << *New << "\n");
3516-
#endif
3520+
(void)New;
3521+
LLVM_DEBUG(dbgs() << " to: " << *New << "\n");
3522+
}
35173523
return true;
35183524
}
35193525

0 commit comments

Comments
 (0)