Merge pull request #78612 from gottesmm/pr-d09f63ed212874b52ff15e2838b55f7462908323

[rbi] Fix demangling of sending results.
This commit is contained in:
Michael Gottesman
2025-01-15 09:49:46 -08:00
committed by GitHub
10 changed files with 65 additions and 18 deletions

View File

@@ -4842,12 +4842,12 @@ public:
SILType getSILStorageInterfaceType() const;
/// Return a version of this result info with the type replaced.
SILResultInfo getWithInterfaceType(CanType type) const {
return SILResultInfo(type, getConvention());
return SILResultInfo(type, getConvention(), getOptions());
}
/// Return a version of this result info with the convention replaced.
SILResultInfo getWithConvention(ResultConvention c) const {
return SILResultInfo(getInterfaceType(), c);
return SILResultInfo(getInterfaceType(), c, getOptions());
}
// Does this result convention require indirect storage? This reflects a

View File

@@ -1093,7 +1093,14 @@ protected:
flags = flags.withSendable();
} else if (child->getText() == "@async") {
flags = flags.withAsync();
} else if (child->getText() == "sending-result") {
flags = flags.withSendingResult();
}
} else if (child->getKind() == NodeKind::ImplSendingResult) {
// NOTE: This flag needs to be set both at the function level and on
// each of the parameters. The flag on the function just means that
// all parameters are sending (which is always true today).
flags = flags.withSendingResult();
} else if (child->getKind() == NodeKind::ImplCoroutineKind) {
if (!child->hasText())
return MAKE_NODE_TYPE_ERROR0(child, "expected text");