cvsuser     04/05/06 00:12:53

  Modified:    .        PLATFORMS TODO.win32
               imcc     imcc.y pcc.c symreg.c symreg.h
               t/pmc    nci.t
  Log:
  NCI sub call syntax in PIR
  
  Revision  Changes    Path
  1.21      +1 -0      parrot/PLATFORMS
  
  Index: PLATFORMS
  ===================================================================
  RCS file: /cvs/public/parrot/PLATFORMS,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -r1.20 -r1.21
  --- PLATFORMS 6 Apr 2004 15:20:48 -0000       1.20
  +++ PLATFORMS 6 May 2004 07:12:45 -0000       1.21
  @@ -31,6 +31,7 @@
   vms
   win32-bcc
   win32-cygwin                                            Y*2     Y/49
  +win32-icl_8.0.48             -    Y    -     -   -      Y       Y/2
   win32-mingw
   win32-ms-cl_13.00.9466       -    Y/2  -     -   -      Y       Y/2
   
  
  
  
  1.2       +1 -0      parrot/TODO.win32
  
  Index: TODO.win32
  ===================================================================
  RCS file: /cvs/public/parrot/TODO.win32,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -r1.1 -r1.2
  --- TODO.win32        5 May 2004 14:14:24 -0000       1.1
  +++ TODO.win32        6 May 2004 07:12:45 -0000       1.2
  @@ -19,6 +19,7 @@
          Borland C++ (bcc)             version xxx or later
          Microsoft Visual C++ (cl)     version xxx or later
          Mingw32 with GCC (gcc)                version xxx or later
  +       Intel C++ (icl)                  version 8.0.48 works
   
   =head1 OPEN ISSUES
   
  
  
  
  1.138     +6 -2      parrot/imcc/imcc.y
  
  Index: imcc.y
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/imcc.y,v
  retrieving revision 1.137
  retrieving revision 1.138
  diff -u -w -r1.137 -r1.138
  --- imcc.y    23 Apr 2004 09:20:30 -0000      1.137
  +++ imcc.y    6 May 2004 07:12:48 -0000       1.138
  @@ -52,6 +52,7 @@
   static Class * current_class;
   static Instruction * current_call;
   static SymReg *cur_obj;
  +int cur_pmc_type;      /* used in mk_ident */
   IMC_Unit * cur_unit;
   SymReg *cur_namespace; /* ugly hack for mk_address */
   
  @@ -235,6 +236,8 @@
      }
      /* FIXME use the default settings from .pragma */
      current_call->r[0]->pcc_sub->pragma = P_PROTOTYPED;
  +   if (current_call->r[0]->pcc_sub->sub->pmc_type == enum_class_NCI)
  +       current_call->r[0]->pcc_sub->nci = 1;
      if(cur_unit->type == IMC_PCCSUB)
           cur_unit->instructions->r[1]->pcc_sub->calls_a_sub = 1;
   }
  @@ -782,7 +785,8 @@
   classname:
      IDENTIFIER
            {
  -            if((pmc_type(interp, string_from_cstring(interp, $1, 0))) <= 0) {
  +            if (( cur_pmc_type = pmc_type(interp,
  +                  string_from_cstring(interp, $1, 0))) <= 0) {
                  fataly(1, sourcefile, line, "Unknown PMC type '%s'\n", $1);
               }
            }
  
  
  
  1.65      +4 -2      parrot/imcc/pcc.c
  
  Index: pcc.c
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/pcc.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -w -r1.64 -r1.65
  --- pcc.c     9 Apr 2004 09:21:25 -0000       1.64
  +++ pcc.c     6 May 2004 07:12:48 -0000       1.65
  @@ -930,6 +930,7 @@
       /*
        * emit a savetop for now
        */
  +    if (!sub->pcc_sub->nci)
       ins = insINS(interp, unit, ins, "savetop", regs, 0);
       /*
        * if we reuse the continuation, update it
  @@ -963,6 +964,7 @@
       if (sub->pcc_sub->label && ins->next->type == ITLABEL) {
           ins = ins->next;
       }
  +    if (!sub->pcc_sub->nci)
       ins = insINS(interp, unit, ins, "restoretop", regs, 0);
       if (p1) {
           regs[0] = get_pasm_reg("P1");
  
  
  
  1.50      +5 -0      parrot/imcc/symreg.c
  
  Index: symreg.c
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/symreg.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -w -r1.49 -r1.50
  --- symreg.c  13 Mar 2004 08:43:11 -0000      1.49
  +++ symreg.c  6 May 2004 07:12:48 -0000       1.50
  @@ -273,6 +273,7 @@
       return _mk_fullname(namespace, name);
   }
   
  +extern int cur_pmc_type;
   /* Makes a new identifier */
   SymReg *
   mk_ident(char * name, int t)
  @@ -289,6 +290,10 @@
       r = mk_symreg(fullname, t);
       r->type = VTIDENTIFIER;
       free(name);
  +    if (t == 'P') {
  +        r->pmc_type = cur_pmc_type;
  +        cur_pmc_type = 0;
  +    }
       return r;
   }
   
  
  
  
  1.46      +1 -0      parrot/imcc/symreg.h
  
  Index: symreg.h
  ===================================================================
  RCS file: /cvs/public/parrot/imcc/symreg.h,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -w -r1.45 -r1.46
  --- symreg.h  22 Apr 2004 08:55:01 -0000      1.45
  +++ symreg.h  6 May 2004 07:12:48 -0000       1.46
  @@ -72,6 +72,7 @@
       struct _SymReg * reg;    /* key->register for VTREGKEYs */
       struct pcc_sub_t *pcc_sub;  /* PCC subroutine */
       struct _SymReg * used;   /* used register in invoke */
  +    int pmc_type;               /* class enum */
   } SymReg;
   
   
  
  
  
  1.40      +21 -3     parrot/t/pmc/nci.t
  
  Index: nci.t
  ===================================================================
  RCS file: /cvs/public/parrot/t/pmc/nci.t,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -w -r1.39 -r1.40
  --- nci.t     4 May 2004 12:55:33 -0000       1.39
  +++ nci.t     6 May 2004 07:12:53 -0000       1.40
  @@ -1,6 +1,6 @@
   #! perl -w
   # Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -# $Id: nci.t,v 1.39 2004/05/04 12:55:33 leo Exp $
  +# $Id: nci.t,v 1.40 2004/05/06 07:12:53 leo Exp $
   
   =head1 NAME
   
  @@ -17,7 +17,7 @@
   
   =cut
   
  -use Parrot::Test tests => 32;
  +use Parrot::Test tests => 33;
   use Parrot::Config;
   
   SKIP: {
  @@ -54,6 +54,24 @@
   dlfunced
   ok 1
   ok 2
  +OUTPUT
  +
  +output_is(<<'CODE', <<'OUTPUT', "nci_d_d - PIR");
  +##PIR##
  +.sub _test @MAIN
  +  .local pmc lib
  +  .local NCI dd
  +  lib = loadlib  "libnci"
  +  print "loaded\n"
  +  dd = dlfunc lib, "nci_dd", "dd"
  +  .local float r
  +  r = dd(4.0)
  +  print r
  +  print "\n"
  +.end
  +CODE
  +loaded
  +8.000000
   OUTPUT
   
   output_is(<<'CODE', <<'OUTPUT', "nci_f_ff");
  
  
  

Reply via email to