Update of /cvsroot/monetdb/pathfinder/compiler/algebra
In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv8753/algebra

Modified Files:
      Tag: Feb2010
        core2alg.brg 
Log Message:
-- Push more type information into the algebra plan to avoid assertions
   in the MIL code generation. 


Index: core2alg.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/algebra/core2alg.brg,v
retrieving revision 1.95
retrieving revision 1.95.2.1
diff -u -d -r1.95 -r1.95.2.1
--- core2alg.brg        7 Jan 2010 15:24:27 -0000       1.95
+++ core2alg.brg        21 Jan 2010 13:58:57 -0000      1.95.2.1
@@ -2158,12 +2158,66 @@
 
         /* CoreExpr:           seqcast (seqtype, CoreExpr) */
         case 22:
+        {
             /*
              * `seqcast' nodes are only introduced for static typing.
              * They are not meant to be executed.
              */
-            A(p) = A(R(p));
-            break;
+            struct  PFla_pair_t pair = A(R(p));
+            PFty_t              t;
+            PFalg_simple_type_t algty;
+
+            t = PFty_prime (PFty_defn (L(p)->sem.type));
+
+            /*
+             * Unfortunately, we only know how to cast atomic types
+             * into (exactly) one of our builtin atomic types. We
+             * cannot sensibly cast, e.g., into subtypes thereof.
+             */
+            if (PFty_equality (t, PFty_xs_string ()))
+                algty = aat_str;
+            else if (PFty_equality (t, PFty_untypedAtomic ()))
+                algty = aat_uA;
+            else if (PFty_equality (t, PFty_xs_integer ()))
+                algty = aat_int;
+            else if (PFty_equality (t, PFty_xs_decimal ()))
+                algty = aat_dec;
+            else if (PFty_equality (t, PFty_xs_double ()))
+                algty = aat_dbl;
+            else if (PFty_equality (t, PFty_xs_boolean ()))
+                algty = aat_bln;
+            else if (PFty_equality (t, PFty_xs_datetime ()))
+                algty = aat_dtime;
+            else if (PFty_equality (t, PFty_xs_date ()))
+                algty = aat_date;
+            else if (PFty_equality (t, PFty_xs_time ()))
+                algty = aat_time;
+            else if (PFty_equality (t, PFty_xs_gyearmonth ()))
+                algty = aat_gymonth;
+            else if (PFty_equality (t, PFty_xs_gyear ()))
+                algty = aat_gyear;
+            else if (PFty_equality (t, PFty_xs_gmonthday ()))
+                algty = aat_gmday;
+            else if (PFty_equality (t, PFty_xs_gmonth ()))
+                algty = aat_gmonth;
+            else if (PFty_equality (t, PFty_xs_gday ()))
+                algty = aat_gday;
+            else if (PFty_equality (t, PFty_xs_duration ()))
+                algty = aat_duration;
+            else if (PFty_equality (t, PFty_xs_yearmonthduration ()))
+                algty = aat_ymduration;
+            else if (PFty_equality (t, PFty_xs_daytimeduration ()))
+                algty = aat_dtduration;
+            else
+                algty = 0;
+
+            if (algty)
+                A(p) = (struct PFla_pair_t) {
+                    .rel  = type_assert_pos (pair.rel, col_item, algty),
+                    .frag = pair.frag };
+            else
+                A(p) = pair;
+        }   break;
 
         /* CoreExpr:     locsteps (ancestor (seqtype), CoreExpr) */
         case 30:


------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to