@@ -2900,6 +2900,14 @@ class DefRewriter : SILInstructionVisitor<DefRewriter> {
2900
2900
storage.storageAddress = addrMat.materializeAddress (arg);
2901
2901
}
2902
2902
2903
+ void setStorageAddress (SILValue oldValue, SILValue addr) {
2904
+ auto &storage = pass.valueStorageMap .getStorage (oldValue);
2905
+ // getReusedStorageOperand() ensures that oldValue does not already have
2906
+ // separate storage. So there's no need to delete its alloc_stack.
2907
+ assert (!storage.storageAddress || storage.storageAddress == addr);
2908
+ storage.storageAddress = addr;
2909
+ }
2910
+
2903
2911
void beforeVisit (SILInstruction *inst) {
2904
2912
LLVM_DEBUG (llvm::dbgs () << " REWRITE DEF " ; inst->dump ());
2905
2913
if (storage.storageAddress )
@@ -3003,14 +3011,6 @@ class DefRewriter : SILInstructionVisitor<DefRewriter> {
3003
3011
addrMat.initializeComposingUse (&operand);
3004
3012
}
3005
3013
3006
- void setStorageAddress (SILValue oldValue, SILValue addr) {
3007
- auto &storage = pass.valueStorageMap .getStorage (oldValue);
3008
- // getReusedStorageOperand() ensures that oldValue does not already have
3009
- // separate storage. So there's no need to delete its alloc_stack.
3010
- assert (!storage.storageAddress || storage.storageAddress == addr);
3011
- storage.storageAddress = addr;
3012
- }
3013
-
3014
3014
void visitUnconditionalCheckedCastInst (
3015
3015
UnconditionalCheckedCastInst *uncondCheckedCast) {
3016
3016
SILValue srcVal = uncondCheckedCast->getOperand ();
0 commit comments