Internals: Use specific types on some cloneTrees. No functional change.

This commit is contained in:
Wilson Snyder 2023-09-08 21:51:59 -04:00
parent 6e977e1024
commit 2f2f0164ff
3 changed files with 4 additions and 4 deletions

View File

@ -256,7 +256,7 @@ private:
ifp = nextifp;
} while (ifp);
AstNode* const newifp = nodep->cloneTree(false);
AstIf* const newifp = nodep->cloneTree(false);
const bool allow_none = nodep->unique0Pragma();
// Empty case means no property

View File

@ -123,7 +123,7 @@ public:
if (!m_varp->isWide() && !m_whole.m_complex && m_whole.m_assignp && !m_wordAssign) {
const AstNodeAssign* const assp = m_whole.m_assignp;
UASSERT_OBJ(assp, errp, "Reading whole that was never assigned");
return (assp->rhsp());
return assp->rhsp();
} else {
return nullptr;
}
@ -133,7 +133,7 @@ public:
if (!m_whole.m_complex && !m_whole.m_assignp && !m_words[word].m_complex) {
const AstNodeAssign* const assp = getWordAssignp(word);
UASSERT_OBJ(assp, errp, "Reading a word that was never assigned, or bad word #");
return (assp->rhsp());
return assp->rhsp();
} else {
return nullptr;
}

View File

@ -3884,7 +3884,7 @@ private:
patp = VN_AS(patp->nextp(), PatMember)) {
const int times = visitPatMemberRep(patp);
for (int i = 1; i < times; i++) {
AstNode* const newp = patp->cloneTree(false);
AstPatMember* const newp = patp->cloneTree(false);
patp->addNextHere(newp);
// This loop will see the new elements as part of nextp()
}