Make reference to increment temporary an rvalue (#3659)

Signed-off-by: Krzysztof Bieganski <[email protected]>
This commit is contained in:
Krzysztof Bieganski
2022-10-10 13:58:05 +02:00
committed by GitHub
parent 6f9c585452
commit ba052beccd
5 changed files with 17 additions and 25 deletions
+2 -1
View File
@@ -189,6 +189,7 @@ private:
void visit(AstLogEq* nodep) override { unsupported_visit(nodep); }
void visit(AstLogIf* nodep) override { unsupported_visit(nodep); }
void visit(AstNodeCond* nodep) override { unsupported_visit(nodep); }
void visit(AstPropClocked* nodep) override { unsupported_visit(nodep); }
void prepost_visit(AstNodeTriop* nodep) {
// Check if we are underneath a statement
if (!m_insStmtp) {
@@ -273,7 +274,7 @@ private:
}
// Replace the node with the temporary
nodep->replaceWith(new AstVarRef(varrefp->fileline(), varp, VAccess::WRITE));
nodep->replaceWith(new AstVarRef{varrefp->fileline(), varp, VAccess::READ});
VL_DO_DANGLING(nodep->deleteTree(), nodep);
}
void visit(AstPreAdd* nodep) override { prepost_visit(nodep); }