[phc-internals] [phc commit] r1401 - in branches/saturn/src: analyse process_ir

codesite-noreply at google.com codesite-noreply at google.com
Tue Jul 1 15:53:53 IST 2008


Author: paul.biggar
Date: Tue Jul  1 07:53:44 2008
New Revision: 1401

Modified:
   branches/saturn/src/analyse/live.clp
   branches/saturn/src/process_ir/CLPA_unparser.h

Log:
Fix most of the analysis for HT_ITERATORS. They are now properly 
entered into, and analysed in, Calypso. However, the XML_unparser wont 
read them in, so that's the next step.


Modified: branches/saturn/src/analyse/live.clp
==============================================================================
--- branches/saturn/src/analyse/live.clp	(original)
+++ branches/saturn/src/analyse/live.clp	Tue Jul  1 07:53:44 2008
@@ -125,10 +125,25 @@
 	% here. Add +defined (VAR).
 	+used_var (BB, VAR), +handled (BB).

+% Foreach statements
+cfg_node (BB), BB = nblock {statement_Foreach_reset{foreach_reset{_, 
VAR_NAME, _}}},
+	+used_var (BB, VAR_NAME),
+	+handled (BB).
+
+cfg_node (BB), BB = nblock {statement_Foreach_end{foreach_end{_, 
VAR_NAME, _}}},
+	+used_var (BB, VAR_NAME),
+	+handled (BB).
+
+cfg_node (BB), BB = nblock {statement_Foreach_next{foreach_next{_, 
VAR_NAME, _}}},
+	+used_var (BB, VAR_NAME),
+	+handled (BB).
+



-% Generic expression handling
+
+
+% Expression handling
 predicate use_expr (BB:t_cfg_node, EXPR:t_Expr).

 % Literals
@@ -193,6 +208,17 @@
 % Constant
 use_expr (BB, expr_Constant {_}), % no used vars
 	+handled (BB).
+
+% Foreach
+use_expr (BB, expr_Foreach_has_key{foreach_has_key{_, ARRAY, _}}),
+	+used_var (BB, ARRAY), +handled (BB).
+
+use_expr (BB, expr_Foreach_get_key{foreach_get_key{_, ARRAY, _}}),
+	+used_var (BB, ARRAY), +handled (BB).
+
+% Ignore key.
+use_expr (BB, expr_Foreach_get_val{foreach_get_val{_, ARRAY, _, _}}),
+	+used_var (BB, ARRAY), +handled (BB).


 % Method invocation

Modified: branches/saturn/src/process_ir/CLPA_unparser.h
==============================================================================
--- branches/saturn/src/process_ir/CLPA_unparser.h	(original)
+++ branches/saturn/src/process_ir/CLPA_unparser.h	Tue Jul  1 07:53:44 2008
@@ -579,6 +579,12 @@
 	MIR_unparser
 >
 {
+	void pre_ht_iterator (MIR::HT_ITERATOR* in)
+	{
+		print_line (in->value);
+	}
+
+
 };

 #endif // PHC_CLPA_UNPARSER


More information about the phc-internals mailing list