[cast-opt] Update optimization of unconditional checked cast to use SILDynamicCastInst.

This commit is contained in:
Michael Gottesman
2019-03-03 13:41:47 -08:00
parent 1755ac8aee
commit e80c394e82
3 changed files with 35 additions and 38 deletions

View File

@@ -1036,6 +1036,15 @@ namespace {
};
} // end anonymous namespace
SILValue
swift::emitSuccessfulScalarUnconditionalCast(SILBuilder &B, SILLocation loc,
SILDynamicCastInst dynamicCast) {
return emitSuccessfulScalarUnconditionalCast(
B, B.getModule().getSwiftModule(), loc, dynamicCast.getSource(),
dynamicCast.getLoweredTargetType(), dynamicCast.getSourceType(),
dynamicCast.getTargetType(), dynamicCast.getInstruction());
}
/// Emit an unconditional scalar cast that's known to succeed.
SILValue
swift::emitSuccessfulScalarUnconditionalCast(SILBuilder &B, ModuleDecl *M,