Support parameterized return types of methods (#4122)

This commit is contained in:
Ryszard Rozak
2023-04-14 08:52:43 -04:00
committed by GitHub
parent f95ce886f1
commit d1b80ffa29
2 changed files with 34 additions and 0 deletions
+3
View File
@@ -546,6 +546,9 @@ class ParamProcessor final {
}
void replaceRefsRecurse(AstNode* const nodep, const AstClass* const oldClassp,
AstClass* const newClassp) {
// Some of the nodes may be already marked as visited, because they were copied. They
// should be marked as unvisited, because parameterized references have to be handled.
nodep->user5(false);
if (AstClassRefDType* const classRefp = VN_CAST(nodep, ClassRefDType)) {
if (classRefp->classp() == oldClassp) classRefp->classp(newClassp);
} else if (AstClassOrPackageRef* const classRefp = VN_CAST(nodep, ClassOrPackageRef)) {