@@ -946,7 +946,7 @@ void LoadableStorageAllocation::replaceLoadWithCopyAddr(
946946 LoadInst *optimizableLoad) {
947947 SILValue value = optimizableLoad->getOperand ();
948948
949- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
949+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
950950 AllocStackInst *allocInstr =
951951 allocBuilder.createAllocStack (value.getLoc (), value->getType ());
952952
@@ -1069,7 +1069,7 @@ void LoadableStorageAllocation::replaceLoadWithCopyAddrForModifiable(
10691069 }
10701070 SILValue value = unoptimizableLoad->getOperand ();
10711071
1072- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
1072+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
10731073 AllocStackInst *allocInstr =
10741074 allocBuilder.createAllocStack (value.getLoc (), value->getType ());
10751075
@@ -1411,7 +1411,7 @@ void LoadableStorageAllocation::allocateForArg(SILValue value) {
14111411
14121412 assert (!ApplySite::isa (value) && " Unexpected instruction" );
14131413
1414- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
1414+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
14151415 AllocStackInst *allocInstr =
14161416 allocBuilder.createAllocStack (value.getLoc (), value->getType ());
14171417
@@ -1438,7 +1438,7 @@ void LoadableStorageAllocation::allocateForArg(SILValue value) {
14381438AllocStackInst *
14391439LoadableStorageAllocation::allocateForApply (SILInstruction *apply,
14401440 SILType type) {
1441- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
1441+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
14421442 auto *allocInstr = allocBuilder.createAllocStack (apply->getLoc (), type);
14431443
14441444 pass.largeLoadableArgs .push_back (allocInstr);
@@ -1524,7 +1524,7 @@ static void setInstrUsers(StructLoweringState &pass, AllocStackInst *allocInstr,
15241524static void allocateAndSetForInstrOperand (StructLoweringState &pass,
15251525 SingleValueInstruction *instrOperand){
15261526 assert (instrOperand->getType ().isObject ());
1527- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
1527+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
15281528 AllocStackInst *allocInstr = allocBuilder.createAllocStack (
15291529 instrOperand->getLoc (), instrOperand->getType ());
15301530
@@ -1558,7 +1558,7 @@ static void allocateAndSetForArgumentOperand(StructLoweringState &pass,
15581558 auto *arg = dyn_cast<SILArgument>(value);
15591559 assert (arg && " non-instr operand must be an argument" );
15601560
1561- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
1561+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
15621562 AllocStackInst *allocInstr =
15631563 allocBuilder.createAllocStack (applyInst->getLoc (), value->getType ());
15641564
@@ -1677,7 +1677,8 @@ static SILValue createCopyOfEnum(StructLoweringState &pass,
16771677 auto value = orig->getOperand ();
16781678 auto type = value->getType ();
16791679 if (type.isObject ()) {
1680- SILBuilderWithScope allocBuilder (pass.F ->begin ()->begin ());
1680+ SILBuilderWithScope allocBuilder (&*pass.F ->begin ());
1681+
16811682 // support for non-address operands / enums
16821683 auto *allocInstr = allocBuilder.createAllocStack (orig->getLoc (), type);
16831684 SILBuilderWithScope storeBuilder (orig);
@@ -1696,7 +1697,7 @@ static SILValue createCopyOfEnum(StructLoweringState &pass,
16961697 }
16971698 value = allocInstr;
16981699 }
1699- SILBuilderWithScope allocBuilder (pass.F -> begin () ->begin ());
1700+ SILBuilderWithScope allocBuilder (&* pass.F ->begin ());
17001701 auto *allocInstr = allocBuilder.createAllocStack (value.getLoc (), type);
17011702
17021703 SILBuilderWithScope copyBuilder (orig);
0 commit comments