On 27 Oct 2006 18:43:46 +0700, Egor Pasko <[EMAIL PROTECTED]> wrote:
void ControlFlowGraph::removeNode(Nodes::iterator pos, bool erase) {
Node* node = *pos;
- assert(node!=entryNode);
+ if (node == entryNode) {
+ entryNode=NULL;
+ }
if (node == returnNode) {
returnNode = NULL;
} else if(node == unwindNode) {
unwindNode = NULL;
} else if (node == exitNode) {
- assert(0);
exitNode = NULL;
}
I think this is OK. A control flow graph instance is created without any
nodes, so why not to allow to clean it up? This fuctionality is used in
jitrino testing framework: it cleans CFG before a test, setup UR template,
runs the test, and restores original CFG.
--
Mikhail Fursov