SIL: Disable verification of switch_union bbarg types.

To do this correctly for generic unions, we'd need to be able to apply generic substitutions.

Swift SVN r8020
This commit is contained in:
Joe Groff
2013-09-07 00:39:55 +00:00
parent cb43f56edb
commit a6ec308d2f

View File

@@ -1264,10 +1264,13 @@ public:
"arguments");
if (dest->getBBArgs().size() == 1) {
/* FIXME: To verify the destination argument type we need to apply
generic substitutions.
Type eltArgTy = elt->getArgumentType();
CanType bbArgTy = dest->getBBArgs()[0]->getType().getSwiftRValueType();
require(eltArgTy->isEqual(bbArgTy),
"switch_union destination bbarg must match case arg type");
*/
require(!dest->getBBArgs()[0]->getType().isAddress(),
"switch_union destination bbarg type must not be an address");
}
@@ -1323,11 +1326,14 @@ public:
"destructive_switch_union_addr destination for case w/ args "
"must take an argument");
/* FIXME: To verify the dest argument type, we need to apply generic
substitutions.
Type eltArgTy = elt->getArgumentType();
CanType bbArgTy = dest->getBBArgs()[0]->getType().getSwiftRValueType();
require(eltArgTy->isEqual(bbArgTy),
"destructive_switch_union_addr destination bbarg must match "
"case arg type");
*/
require(dest->getBBArgs()[0]->getType().isAddress(),
"destructive_switch_union_addr destination bbarg type must "
"be an address");