PredictableMemOpt: Don't try to diagnose recursive value types.

They're invalid, and we don't want to blow the stack trying to decompose a type with infinite elements. Fixes rdar://problem/17920535.

Swift SVN r23775
This commit is contained in:
Joe Groff
2014-12-08 01:58:19 +00:00
parent ee145a1ac6
commit 259dad38f2
4 changed files with 33 additions and 7 deletions

View File

@@ -31,6 +31,9 @@ STATISTIC(NumAllocRemoved, "Number of allocations completely removed");
//===----------------------------------------------------------------------===//
static unsigned getNumSubElements(SILType T, SILModule &M) {
if (!M.getTypeLowering(T).isValid())
return 0;
if (auto TT = T.getAs<TupleType>()) {
unsigned NumElements = 0;
for (auto index : indices(TT.getElementTypes()))