Commit Graph

8 Commits

Author SHA1 Message Date
Slava Pestov
16d5716e71 SIL: Use the best resilience expansion when lowering types
This is a large patch; I couldn't split it up further while still
keeping things working. There are four things being changed at
once here:

- Places that call SILType::isAddressOnly()/isLoadable() now call
  the SILFunction overload and not the SILModule one.

- SILFunction's overloads of getTypeLowering() and getLoweredType()
  now pass the function's resilience expansion down, instead of
  hardcoding ResilienceExpansion::Minimal.

- Various other places with '// FIXME: Expansion' now use a better
  resilience expansion.

- A few tests were updated to reflect SILGen's improved code
  generation, and some new tests are added to cover more code paths
  that previously were uncovered and only manifested themselves as
  standard library build failures while I was working on this change.
2019-04-26 22:47:59 -04:00
Slava Pestov
1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Brent Royal-Gordon
413dd85a5a Test init(rawValue:) behavior for obsolete cases
Also touches the other version numbers so I can use realistic, but far-future, ones.
2019-02-08 14:22:55 -08:00
Brent Royal-Gordon
6d8dbfa0f1 [NFC] Style/assertion/test design improvements 2019-02-08 14:17:38 -08:00
Brent Royal-Gordon
3f4355cc20 Lower versions in new enum availability test
32-bit iOS Simulator tests are compiled with an iOS 7 depolyment target, so the “always available” case wasn’t available there, causing a spurious test failure.
2019-02-05 15:27:11 -08:00
Brent Royal-Gordon
5da6668b8a Refactor availability-checking code to handle more cases
Moves a lot of it into helper functions and types so it doesn’t disrupt the main flow of the code so much. Also makes it handle always-unavailable and obsolete cases (by skipping them).
2019-02-04 15:54:23 -08:00
Brent Royal-Gordon
cbd1c59846 Don’t run #available synthesis test on Linux 2019-01-28 18:20:44 -08:00
Brent Royal-Gordon
a6c23790f9 Add #available guards to init(rawValue:)
When a case has an @available(currentPlatform, introduced: x.y) attribute, the auto-derived init(rawValue:) will now include a “guard #available(currentPlatform x.y, *) else { return nil }” check to prevent the new case from being returned.

This requires a targeted hack to disable @available(introduced:) checks in auto-derived init(rawValue:) implementations; the availability checker is SourceLoc-based, so it can’t tell that the synthesized `guard` covers the use of the case. I’m not happy about that, but fixing the deeper problem is a much larger task than I can take on in one day.
2019-01-28 17:34:54 -08:00