SIL: Made index_addr index operand dynamic.

Instead of taking an integer constant index, index_addr now takes a value operand of builtin integer type, which makes more sense.

Swift SVN r5478
This commit is contained in:
Joe Groff
2013-06-05 16:49:41 +00:00
parent b8a2426673
commit ed6b5ad497
6 changed files with 44 additions and 23 deletions

View File

@@ -433,9 +433,11 @@ public:
}
void checkIndexAddrInst(IndexAddrInst *IAI) {
require(IAI->getType().isAddress() &&
IAI->getType() == IAI->getOperand().getType(),
"invalid IndexAddrInst");
require(IAI->getType().isAddress(), "index_addr must produce an address");
require(IAI->getType() == IAI->getBase().getType(),
"index_addr must produce an address of the same type as its base");
require(IAI->getIndex().getType().is<BuiltinIntegerType>(),
"index_addr index must be of a builtin integer type");
}
void checkTupleExtractInst(TupleExtractInst *EI) {