Fix errors and warnings building swift/SIL on Windows using MSVC

This commit is contained in:
Hugh Bellamy
2016-11-17 17:42:34 +00:00
parent cc867af8e1
commit 36100bf21c
19 changed files with 100 additions and 7 deletions

View File

@@ -104,7 +104,7 @@ Projection::Projection(SILInstruction *I) : Value() {
}
case ValueKind::ProjectBoxInst: {
auto *PBI = cast<ProjectBoxInst>(I);
Value = ValueTy(ProjectionKind::Box, (unsigned)0);
Value = ValueTy(ProjectionKind::Box, static_cast<uintptr_t>(0));
assert(getKind() == ProjectionKind::Box);
assert(getIndex() == 0);
assert(getType(PBI->getOperand()->getType(), PBI->getModule()) ==
@@ -228,6 +228,8 @@ Projection::createObjectProjection(SILBuilder &B, SILLocation Loc,
case ProjectionKind::BitwiseCast:
return B.createUncheckedBitwiseCast(Loc, Base, getCastType(BaseTy));
}
llvm_unreachable("Unhandled ProjectionKind in switch.");
}
NullablePtr<SILInstruction>
@@ -270,6 +272,8 @@ Projection::createAddressProjection(SILBuilder &B, SILLocation Loc,
case ProjectionKind::BitwiseCast:
return B.createUncheckedAddrCast(Loc, Base, getCastType(BaseTy));
}
llvm_unreachable("Unhandled ProjectionKind in switch.");
}
void Projection::getFirstLevelProjections(SILType Ty, SILModule &Mod,