Restore CanType-based micro-optimizations.

This reverts commit 5036806e5a.
However, it preserves a pair of changes to the SIL optimizer
relating to walking through optional types.
This commit is contained in:
John McCall
2017-03-14 11:30:06 -04:00
parent f3bfc777be
commit 897f5ab7c5
15 changed files with 144 additions and 88 deletions

View File

@@ -1620,7 +1620,7 @@ emitEnumElementDispatch(ArrayRef<RowToSpecialize> rows,
// If the enum is @_fixed_layout, we only need one if the
// switch is not exhaustive.
bool exhaustive = false;
auto enumDecl = sourceType->getEnumOrBoundGenericEnum();
auto enumDecl = sourceType.getEnumOrBoundGenericEnum();
// The SIL values will range over Optional, so count against
// Optional's cases.