/* Build executable statement trees.
- Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2000, 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Andy Vaught
void
gfc_free_statement (gfc_code *p)
{
- if (p->expr)
- gfc_free_expr (p->expr);
+ if (p->expr1)
+ gfc_free_expr (p->expr1);
if (p->expr2)
gfc_free_expr (p->expr2);
case EXEC_GOTO:
case EXEC_CYCLE:
case EXEC_RETURN:
+ case EXEC_END_PROCEDURE:
case EXEC_IF:
case EXEC_PAUSE:
case EXEC_STOP:
+ case EXEC_ERROR_STOP:
case EXEC_EXIT:
case EXEC_WHERE:
case EXEC_IOLENGTH:
case EXEC_LABEL_ASSIGN:
case EXEC_ENTRY:
case EXEC_ARITHMETIC_IF:
+ case EXEC_CRITICAL:
+ case EXEC_SYNC_ALL:
+ case EXEC_SYNC_IMAGES:
+ case EXEC_SYNC_MEMORY:
+ break;
+
+ case EXEC_BLOCK:
+ gfc_free_namespace (p->ext.block.ns);
+ gfc_free_association_list (p->ext.block.assoc);
break;
case EXEC_COMPCALL:
break;
case EXEC_SELECT:
- if (p->ext.case_list)
- gfc_free_case_list (p->ext.case_list);
+ case EXEC_SELECT_TYPE:
+ if (p->ext.block.case_list)
+ gfc_free_case_list (p->ext.block.case_list);
break;
case EXEC_DO:
case EXEC_ALLOCATE:
case EXEC_DEALLOCATE:
- gfc_free_alloc_list (p->ext.alloc_list);
+ gfc_free_alloc_list (p->ext.alloc.list);
break;
case EXEC_OPEN:
}
}
+
+/* Free an association list (of an ASSOCIATE statement). */
+
+void
+gfc_free_association_list (gfc_association_list* assoc)
+{
+ if (!assoc)
+ return;
+
+ gfc_free_association_list (assoc->next);
+ gfc_free (assoc);
+}