Update Devirtualizer's analysis invalidation (#31284)

* Update Devirtualizer's analysis invalidation

castValueToABICompatibleType can change CFG, Devirtualizer uses this api but doesn't check if it modified the cfg
This commit is contained in:
Meghana Gupta
2020-04-27 18:30:33 -07:00
committed by GitHub
parent 041dfb9354
commit 013387eceb
5 changed files with 89 additions and 78 deletions

View File

@@ -233,9 +233,9 @@ FullApplySite findApplyFromDevirtualizedResult(SILValue value);
/// - a type of the return value is a subclass of the expected return type.
/// - actual return type and expected return type differ in optionality.
/// - both types are tuple-types and some of the elements need to be casted.
SILValue castValueToABICompatibleType(SILBuilder *builder, SILLocation Loc,
SILValue value, SILType srcTy,
SILType destTy);
std::pair<SILValue, bool /* changedCFG */>
castValueToABICompatibleType(SILBuilder *builder, SILLocation Loc,
SILValue value, SILType srcTy, SILType destTy);
/// Peek through trivial Enum initialization, typically for pointless
/// Optionals.
///