Moves dangling objc variable declaration into #if.

Swift SVN r24820
This commit is contained in:
Graham Batty
2015-01-29 20:24:02 +00:00
parent 88b7262822
commit 383dd5d6c4

View File

@@ -765,7 +765,6 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
const Metadata *srcType,
const ExistentialTypeMetadata *targetType,
DynamicCastFlags flags) {
id tmp;
// Find the actual type of the source.
OpaqueValue *srcDynamicValue;
const Metadata *srcDynamicType;
@@ -786,10 +785,9 @@ static bool _dynamicCastToExistential(OpaqueValue *dest,
// Class metadata can be used as an object when ObjC interop is available.
auto metatypePtr = reinterpret_cast<const Metadata **>(src);
auto metatype = *metatypePtr;
tmp = swift_dynamicCastMetatypeToObjectConditional(metatype);
// If the cast succeeded, use the result value as the class instance
// below.
if (tmp) {
if (id tmp = swift_dynamicCastMetatypeToObjectConditional(metatype)) {
srcDynamicValue = reinterpret_cast<OpaqueValue*>(&tmp);
srcDynamicType = reinterpret_cast<const Metadata*>(tmp);
break;