Make sure we always have a SILFunction for region-based isolation checking

Some values (such as `undef`) might not be associated with a function.
This commit is contained in:
Doug Gregor
2024-01-16 16:37:06 -08:00
parent dc85ae3fc6
commit e96dcac7b4
2 changed files with 8 additions and 3 deletions

View File

@@ -299,7 +299,11 @@ private:
/// This only includes function arguments.
std::vector<TrackableValueID> neverTransferredValueIDs;
SILFunction *fn;
public:
RegionAnalysisValueMap(SILFunction *fn) : fn(fn) { }
/// Returns the value for this instruction if it isn't a fake "represenative
/// value" to inject actor isolatedness. Asserts in such a case.
SILValue getRepresentative(Element trackableValueID) const;