@@ -418,13 +418,13 @@ void WinEHStatePass::linkExceptionRegistration(IRBuilder<> &Builder,
418
418
// Emit the .safeseh directive for this function.
419
419
Handler->addFnAttr (" safeseh" );
420
420
421
+ LLVMContext &C = Builder.getContext ();
421
422
Type *LinkTy = getEHLinkRegistrationType ();
422
423
// Handler = Handler
423
424
Builder.CreateStore (Handler, Builder.CreateStructGEP (LinkTy, Link, 1 ));
424
425
// Next = [fs:00]
425
- Constant *FSZero =
426
- Constant::getNullValue (LinkTy->getPointerTo ()->getPointerTo (257 ));
427
- Value *Next = Builder.CreateLoad (LinkTy->getPointerTo (), FSZero);
426
+ Constant *FSZero = Constant::getNullValue (PointerType::get (C, 257 ));
427
+ Value *Next = Builder.CreateLoad (PointerType::getUnqual (C), FSZero);
428
428
Builder.CreateStore (Next, Builder.CreateStructGEP (LinkTy, Link, 0 ));
429
429
// [fs:00] = Link
430
430
Builder.CreateStore (Link, FSZero);
@@ -437,12 +437,13 @@ void WinEHStatePass::unlinkExceptionRegistration(IRBuilder<> &Builder) {
437
437
Builder.Insert (GEP);
438
438
Link = GEP;
439
439
}
440
+
441
+ LLVMContext &C = Builder.getContext ();
440
442
Type *LinkTy = getEHLinkRegistrationType ();
441
443
// [fs:00] = Link->Next
442
- Value *Next = Builder.CreateLoad (LinkTy-> getPointerTo ( ),
444
+ Value *Next = Builder.CreateLoad (PointerType::getUnqual (C ),
443
445
Builder.CreateStructGEP (LinkTy, Link, 0 ));
444
- Constant *FSZero =
445
- Constant::getNullValue (LinkTy->getPointerTo ()->getPointerTo (257 ));
446
+ Constant *FSZero = Constant::getNullValue (PointerType::get (C, 257 ));
446
447
Builder.CreateStore (Next, FSZero);
447
448
}
448
449
0 commit comments