Support virtual interfaces (#3654)

This commit is contained in:
Arkadiusz Kozdra
2022-10-20 06:31:00 -04:00
committed by GitHub
parent e6add5e0b8
commit 0e4da3b0bf
25 changed files with 440 additions and 45 deletions
+2 -2
View File
@@ -141,7 +141,7 @@ public:
void checkRemoveAssign(const LifeMap::iterator& it) {
const AstVar* const varp = it->first->varp();
LifeVarEntry* const entp = &(it->second);
if (!varp->isSigPublic()) {
if (!varp->isSigPublic() && !varp->isUsedVirtIface()) {
// Rather than track what sigs AstUCFunc/AstUCStmt may change,
// we just don't optimize any public sigs
// Check the var entry, and remove if appropriate
@@ -186,7 +186,7 @@ public:
const auto it = m_map.find(nodep);
if (it != m_map.end()) {
if (AstConst* const constp = it->second.constNodep()) {
if (!varrefp->varp()->isSigPublic()) {
if (!varrefp->varp()->isSigPublic() && !varrefp->varp()->isUsedVirtIface()) {
// Aha, variable is constant; substitute in.
// We'll later constant propagate
UINFO(4, " replaceconst: " << varrefp << endl);