File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -4332,6 +4332,17 @@ class RewriteUser : SILInstructionVisitor<RewriteUser> {
43324332 assignment.markForDeletion (bc);
43334333 }
43344334
4335+ void visitUncheckedBitwiseCastInst (UncheckedBitwiseCastInst *bc) {
4336+ auto addr = assignment.getAddressForValue (bc->getOperand ());
4337+ auto builder = assignment.getBuilder (bc->getIterator ());
4338+ auto loaded = builder.createLoad (bc->getLoc (), addr,
4339+ LoadOwnershipQualifier::Unqualified);
4340+ auto newVal = builder.createUncheckedBitwiseCast (bc->getLoc (), loaded,
4341+ bc->getType ());
4342+ bc->replaceAllUsesWith (newVal);
4343+ assignment.markForDeletion (bc);
4344+ }
4345+
43354346 void visitEnumInst (EnumInst *e) {
43364347 assert (!assignment.isLargeLoadableType (e->getType ()));
43374348 auto opd = e->getOperand ();
You can’t perform that action at this time.
0 commit comments