mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Small clean-up. Add createUncheckedBitCast to SILBuilder.
This new method eliminates repeated code sequences that all create an unchecked_trivial_bit_cast if the result type is trivial or unchecked_ref_bit_cast otherwise. NFC. Swift SVN r29486
This commit is contained in:
@@ -3000,12 +3000,8 @@ static bool emitOptimizedOptionalEvaluation(OptionalEvaluationExpr *E,
|
||||
if (optInit == nullptr) {
|
||||
auto subMV = SGF.emitRValueAsSingleValue(BO->getSubExpr());
|
||||
SILValue result;
|
||||
if (optTL.isTrivial())
|
||||
result = SGF.B.createUncheckedTrivialBitCast(E, subMV.forward(SGF),
|
||||
optTL.getLoweredType());
|
||||
else
|
||||
result = SGF.B.createUncheckedRefBitCast(E, subMV.forward(SGF),
|
||||
optTL.getLoweredType());
|
||||
result = SGF.B.createUncheckedBitCast(E, subMV.forward(SGF),
|
||||
optTL.getLoweredType());
|
||||
|
||||
LoadableResult = result;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user