Move swap to V3Ast, and tell which AstUser*InUse fails assertions

This commit is contained in:
Wilson Snyder
2009-09-23 23:10:46 -04:00
parent 807aecdb11
commit 2c3c990019
4 changed files with 35 additions and 29 deletions
+9
View File
@@ -559,6 +559,15 @@ void AstNode::relinkOneLink(AstNode*& pointpr, // Ref to pointer that gets set
pointpr = newp;
}
void AstNode::swapWith (AstNode* bp) {
AstNRelinker aHandle;
AstNRelinker bHandle;
this->unlinkFrBack(&aHandle);
bp->unlinkFrBack(&bHandle);
aHandle.relink(bp);
bHandle.relink(this);
}
//======================================================================
// Clone