mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[region-isolation] Eliminate more of the 'task or actor isolated value cannot be transferred' warning.
Specifically, I had to teach the variable name inferrer how to infer through unchecked_enum_data and unchecked_take_enum_data_addr.
This commit is contained in:
@@ -276,6 +276,12 @@ VariableNameInferrer::findDebugInfoProvidingValueHelper(SILValue searchValue) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto *uedi = dyn_cast<UncheckedEnumDataInst>(searchValue)) {
|
||||
variableNamePath.push_back(uedi);
|
||||
searchValue = uedi->getOperand();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto *tei = dyn_cast<TupleExtractInst>(searchValue)) {
|
||||
variableNamePath.push_back(tei);
|
||||
searchValue = tei->getOperand();
|
||||
@@ -294,6 +300,12 @@ VariableNameInferrer::findDebugInfoProvidingValueHelper(SILValue searchValue) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto *e = dyn_cast<UncheckedTakeEnumDataAddrInst>(searchValue)) {
|
||||
variableNamePath.push_back(e);
|
||||
searchValue = e->getOperand();
|
||||
continue;
|
||||
}
|
||||
|
||||
if (auto *dti = dyn_cast_or_null<DestructureTupleInst>(
|
||||
searchValue->getDefiningInstruction())) {
|
||||
// Append searchValue, so we can find the specific tuple index.
|
||||
@@ -473,6 +485,11 @@ void VariableNameInferrer::popSingleVariableName() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto *uedi = dyn_cast<UncheckedEnumDataInst>(inst)) {
|
||||
resultingString += getNameFromDecl(uedi->getElement());
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto *sei = dyn_cast<StructElementAddrInst>(inst)) {
|
||||
resultingString += getNameFromDecl(sei->getField());
|
||||
return;
|
||||
@@ -484,6 +501,11 @@ void VariableNameInferrer::popSingleVariableName() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (auto *uedi = dyn_cast<UncheckedTakeEnumDataAddrInst>(inst)) {
|
||||
resultingString += getNameFromDecl(uedi->getElement());
|
||||
return;
|
||||
}
|
||||
|
||||
resultingString += "<unknown decl>";
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user