Update of /cvsroot/monetdb/pathfinder/compiler/algebra/opt
In directory
sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14685/compiler/algebra/opt
Modified Files:
opt_algebra_cse.c
Log Message:
Bugfix: support for fun_call and friends in the CSE phase.
Index: opt_algebra_cse.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/opt/opt_algebra_cse.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- opt_algebra_cse.c 17 Mar 2008 17:41:13 -0000 1.27
+++ opt_algebra_cse.c 18 Mar 2008 16:20:37 -0000 1.28
@@ -125,6 +125,9 @@
, [la_rec_param] = "la_rec_param"
, [la_rec_arg] = "la_rec_arg"
, [la_rec_base] = "la_rec_base"
+ , [la_fun_call] = "la_fun_call"
+ , [la_fun_param] = "la_fun_param"
+ , [la_fun_frag_param] = "la_fun_frag_param"
, [la_proxy] = "la_proxy"
, [la_proxy_base] = "la_proxy_base"
, [la_cross_mvd] = "la_cross_mvd"
@@ -1176,6 +1179,11 @@
case la_rec_param:
case la_rec_arg:
case la_rec_base:
+ case la_fun_call:
+ case la_fun_param:
+ case la_fun_frag_param:
+ return false;
+
case la_proxy:
case la_proxy_base:
case la_cross_mvd:
@@ -2058,6 +2066,46 @@
}
case la_rec_base:
return PFla_rec_base (n->schema);
+
+ case la_fun_call: {
+ PFalg_schema_t schema;
+ schema.count = n->schema.count;
+ schema.items = (struct PFalg_schm_item_t*)
+ PFmalloc (schema.count *
+ sizeof (struct PFalg_schm_item_t));
+
+ /* not needed to change the schema */
+ for (unsigned int i = 0; i < schema.count; i++)
+ schema.items[i] = n->schema.items[i];
+
+ return PFla_fun_call (CSE(L(n)), CSE(R(n)),
+ schema, n->sem.fun_call.kind,
+ n->sem.fun_call.qname, n->sem.fun_call.ctx,
+ ACTATT (L(n), n->sem.fun_call.iter),
+ n->sem.fun_call.occ_ind);
+ }
+ case la_fun_param: {
+ /* copy the schema */
+ PFalg_schema_t schema;
+ schema.count = n->schema.count;
+ schema.items = (struct PFalg_schm_item_t *)
+ PFmalloc (schema.count *
+ sizeof (struct PFalg_schm_item_t));
+
+ for (unsigned int i = 0; i < schema.count; i++)
+ schema.items[i] = (struct PFalg_schm_item_t) {
+ .name = ACTATT (L(n),
n->schema.items[i].name),
+ .type = n->schema.items[i].type
+ };
+
+ return PFla_fun_param (
+ CSE (L(n)), CSE(R(n)),
+ schema);
+ }
+ case la_fun_frag_param:
+ return PFla_fun_frag_param (
+ CSE (L(n)), CSE(R(n)),
+ n->sem.col_ref.pos);
case la_proxy:
case la_proxy_base:
case la_cross_mvd:
@@ -2464,6 +2512,26 @@
ori->schema.items[i].name));
}
break;
+
+ case la_fun_call:
+ actmap = create_actatt_map ();
+ /* the schema doesn't change for this operator */
+ for (unsigned int i = 0; i < ori->schema.count; i++) {
+ INACTATT (actmap,
+ actatt (
+ ori->schema.items[i].name,
+ ori->schema.items[i].name));
+ }
+ break;
+ case la_fun_param:
+ /* simply copy the schema of the left operator */
+ actmap = actatt_map_copy (ACT(L(ori)));
+ break;
+ case la_fun_frag_param:
+ /* since this operator doesn't has an associated schema,
+ * we create an empty map */
+ actmap = create_actatt_map ();
+ break;
case la_proxy:
case la_proxy_base:
case la_cross_mvd:
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins