Internals: Code movement, no functional change.

This commit is contained in:
Wilson Snyder
2020-11-28 22:01:11 -05:00
parent e09f039a36
commit aa360052a8
3 changed files with 10 additions and 7 deletions
+6
View File
@@ -1171,6 +1171,12 @@ void AstClass::repairCache() {
clearCache();
for (AstNode* itemp = membersp(); itemp; itemp = itemp->nextp()) { insertCache(itemp); }
}
bool AstClass::isClassExtendedFrom(const AstClass* refClassp, const AstClass* baseClassp) {
// TAIL RECURSIVE
if (!refClassp || !baseClassp) return false;
if (refClassp == baseClassp) return true;
return isClassExtendedFrom(refClassp->extendsp()->classp(), baseClassp);
}
void AstClass::dump(std::ostream& str) const {
this->AstNode::dump(str);
if (isExtended()) str << " [EXT]";