File tree 1 file changed +10
-4
lines changed
llvm/lib/Transforms/Scalar
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -3504,16 +3504,22 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
3504
3504
// for the new alloca slice.
3505
3505
Type *PointerTy = IRB.getPtrTy (OldPtr->getType ()->getPointerAddressSpace ());
3506
3506
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) {
3508
3514
Value *New;
3509
3515
if (II.getIntrinsicID () == Intrinsic::lifetime_start)
3510
3516
New = IRB.CreateLifetimeStart (Ptr , Size );
3511
3517
else
3512
3518
New = IRB.CreateLifetimeEnd (Ptr , Size );
3513
3519
3514
- (void )New;
3515
- LLVM_DEBUG (dbgs () << " to: " << *New << " \n " );
3516
- # endif
3520
+ (void )New;
3521
+ LLVM_DEBUG (dbgs () << " to: " << *New << " \n " );
3522
+ }
3517
3523
return true ;
3518
3524
}
3519
3525
You can’t perform that action at this time.
0 commit comments