standardize naming of tuples and tuple patterns on "elements".

Previously some parts of the compiler referred to them as "fields",
and most referred to them as "elements".  Use the more generic 'elements'
nomenclature because that's what we refer to other things in the compiler
(e.g. the elements of a bracestmt).

At the same time, make the API better by providing "getElement" consistently
and using it, instead of getElements()[i].

NFC.



Swift SVN r26894
This commit is contained in:
Chris Lattner
2015-04-02 20:23:49 +00:00
parent a85cc9c6e9
commit 79ed57f9f2
69 changed files with 397 additions and 378 deletions

View File

@@ -134,7 +134,7 @@ SILValue InstSimplifier::visitTupleInst(TupleInst *TI) {
SILValue InstSimplifier::visitTupleExtractInst(TupleExtractInst *TEI) {
// tuple_extract(tuple(x, y), 0) -> x
if (TupleInst *TheTuple = dyn_cast<TupleInst>(TEI->getOperand()))
return TheTuple->getElements()[TEI->getFieldNo()];
return TheTuple->getElement(TEI->getFieldNo());
// tuple_extract(apply([add|sub|...]overflow(x,y)), 0) -> x
// tuple_extract(apply(checked_trunc(ext(x))), 0) -> x