dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: treecc/tests output5.out,1.5,1.6 output6.out


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: treecc/tests output5.out,1.5,1.6 output6.out,1.5,1.6 output9.out,1.5,1.6
Date: Tue, 28 Jan 2003 19:16:19 -0500

Update of /cvsroot/dotgnu-pnet/treecc/tests
In directory subversions:/tmp/cvs-serv19446/tests

Modified Files:
        output5.out output6.out output9.out 
Log Message:


Add the "allocator" and "no_allocator" options, which allow treecc's
C/C++ node allocators to be replaced with third party node allocators.


Index: output5.out
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/tests/output5.out,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** output5.out 15 Dec 2002 04:03:27 -0000      1.5
--- output5.out 29 Jan 2003 00:16:17 -0000      1.6
***************
*** 77,81 ****
  public:
  
!       void *alloc(size_t size);
        int push();
        void pop();
--- 77,82 ----
  public:
  
!       void *alloc(size_t);
!       void dealloc(void *, size_t);
        int push();
        void pop();
***************
*** 322,325 ****
--- 323,327 ----
  #define YYNODESTATE_REENTRANT 1
  #define YYNODESTATE_TRACK_LINES 1
+ #define YYNODESTATE_USE_ALLOCATOR 1
  #line 1 "cpp_skel.cc"
  /*
***************
*** 445,448 ****
--- 447,452 ----
  }
  
+ #ifdef YYNODESTATE_USE_ALLOCATOR
+ 
  /*
   * Allocate a block of memory.
***************
*** 487,490 ****
--- 491,502 ----
  
  /*
+  * Deallocate a block of memory.
+  */
+ void *YYNODESTATE::dealloc(void *ptr__, size_t size__)
+ {
+       /* Nothing to do for this type of node allocator */
+ }
+ 
+ /*
   * Push the node allocation state.
   */
***************
*** 565,568 ****
--- 577,582 ----
  }
  
+ #endif /* YYNODESTATE_USE_ALLOCATOR */
+ 
  /*
   * Default implementation of functions which may be overridden.
***************
*** 585,589 ****
  
  #endif
! #line 269 "output.c"
  intnum *YYNODESTATE::intnumCreate(int num)
  {
--- 599,603 ----
  
  #endif
! #line 282 "output.c"
  intnum *YYNODESTATE::intnumCreate(int num)
  {
***************
*** 693,697 ****
        }
  }
! #line 377 "output.c"
  
  int binary::isA(int kind) const
--- 707,711 ----
        }
  }
! #line 390 "output.c"
  
  int binary::isA(int kind) const
***************
*** 726,730 ****
        type = expr->type;
  }
! #line 410 "output.c"
  
  int unary::isA(int kind) const
--- 740,744 ----
        type = expr->type;
  }
! #line 423 "output.c"
  
  int unary::isA(int kind) const
***************
*** 758,762 ****
        type = int_type;
  }
! #line 442 "output.c"
  
  int intnum::isA(int kind) const
--- 772,776 ----
        type = int_type;
  }
! #line 455 "output.c"
  
  int intnum::isA(int kind) const
***************
*** 893,897 ****
        type = expr1->type;
  }
! #line 577 "output.c"
  
  int power::isA(int kind) const
--- 907,911 ----
        type = expr1->type;
  }
! #line 590 "output.c"
  
  int power::isA(int kind) const

Index: output6.out
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/tests/output6.out,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** output6.out 15 Dec 2002 04:03:27 -0000      1.5
--- output6.out 29 Jan 2003 00:16:17 -0000      1.6
***************
*** 78,82 ****
  public:
  
!       void *alloc(size_t size);
        int push();
        void pop();
--- 78,83 ----
  public:
  
!       void *alloc(size_t);
!       void dealloc(void *, size_t);
        int push();
        void pop();
***************
*** 301,304 ****
--- 302,306 ----
  
  #define YYNODESTATE_TRACK_LINES 1
+ #define YYNODESTATE_USE_ALLOCATOR 1
  #line 1 "cpp_skel.cc"
  /*
***************
*** 424,427 ****
--- 426,431 ----
  }
  
+ #ifdef YYNODESTATE_USE_ALLOCATOR
+ 
  /*
   * Allocate a block of memory.
***************
*** 466,469 ****
--- 470,481 ----
  
  /*
+  * Deallocate a block of memory.
+  */
+ void *YYNODESTATE::dealloc(void *ptr__, size_t size__)
+ {
+       /* Nothing to do for this type of node allocator */
+ }
+ 
+ /*
   * Push the node allocation state.
   */
***************
*** 544,547 ****
--- 556,561 ----
  }
  
+ #endif /* YYNODESTATE_USE_ALLOCATOR */
+ 
  /*
   * Default implementation of functions which may be overridden.
***************
*** 564,568 ****
  
  #endif
! #line 268 "output.c"
  void *expression::operator new(size_t size__)
  {
--- 578,582 ----
  
  #endif
! #line 281 "output.c"
  void *expression::operator new(size_t size__)
  {
***************
*** 570,576 ****
  }
  
! void expression::operator delete(void *, size_t)
  {
!       // not used: use YYNODESTATE::pop() instead
  }
  
--- 584,590 ----
  }
  
! void expression::operator delete(void *ptr__, size_t size__)
  {
!       YYNODESTATE::getState()->dealloc(ptr__, size__);
  }
  
***************
*** 839,843 ****
                                e->type = e->expr1->type;
                        }
! #line 543 "output.c"
                }
                break;
--- 853,857 ----
                                e->type = e->expr1->type;
                        }
! #line 556 "output.c"
                }
                break;
***************
*** 869,873 ****
                                }
                        }
! #line 573 "output.c"
                }
                break;
--- 883,887 ----
                                }
                        }
! #line 586 "output.c"
                }
                break;
***************
*** 882,886 ****
                                e->type = e->expr->type;
                        }
! #line 586 "output.c"
                }
                break;
--- 896,900 ----
                                e->type = e->expr->type;
                        }
! #line 599 "output.c"
                }
                break;
***************
*** 893,897 ****
                                e->type = int_type;
                        }
! #line 597 "output.c"
                }
                break;
--- 907,911 ----
                                e->type = int_type;
                        }
! #line 610 "output.c"
                }
                break;

Index: output9.out
===================================================================
RCS file: /cvsroot/dotgnu-pnet/treecc/tests/output9.out,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** output9.out 15 Dec 2002 04:03:27 -0000      1.5
--- output9.out 29 Jan 2003 00:16:17 -0000      1.6
***************
*** 78,82 ****
  public:
  
!       void *alloc(size_t size);
        int push();
        void pop();
--- 78,83 ----
  public:
  
!       void *alloc(size_t);
!       void dealloc(void *, size_t);
        int push();
        void pop();
***************
*** 307,310 ****
--- 308,312 ----
  
  #define YYNODESTATE_TRACK_LINES 1
+ #define YYNODESTATE_USE_ALLOCATOR 1
  #line 1 "cpp_skel.cc"
  /*
***************
*** 430,433 ****
--- 432,437 ----
  }
  
+ #ifdef YYNODESTATE_USE_ALLOCATOR
+ 
  /*
   * Allocate a block of memory.
***************
*** 472,475 ****
--- 476,487 ----
  
  /*
+  * Deallocate a block of memory.
+  */
+ void *YYNODESTATE::dealloc(void *ptr__, size_t size__)
+ {
+       /* Nothing to do for this type of node allocator */
+ }
+ 
+ /*
   * Push the node allocation state.
   */
***************
*** 550,553 ****
--- 562,567 ----
  }
  
+ #endif /* YYNODESTATE_USE_ALLOCATOR */
+ 
  /*
   * Default implementation of functions which may be overridden.
***************
*** 570,574 ****
  
  #endif
! #line 268 "output.c"
  void *expression::operator new(size_t size__)
  {
--- 584,588 ----
  
  #endif
! #line 281 "output.c"
  void *expression::operator new(size_t size__)
  {
***************
*** 576,582 ****
  }
  
! void expression::operator delete(void *, size_t)
  {
!       // not used: use YYNODESTATE::pop() instead
  }
  
--- 590,596 ----
  }
  
! void expression::operator delete(void *ptr__, size_t size__)
  {
!       YYNODESTATE::getState()->dealloc(ptr__, size__);
  }
  
***************
*** 845,849 ****
                                e->type = e->expr1->type;
                        }
! #line 543 "output.c"
                }
                break;
--- 859,863 ----
                                e->type = e->expr1->type;
                        }
! #line 556 "output.c"
                }
                break;
***************
*** 875,879 ****
                                }
                        }
! #line 573 "output.c"
                }
                break;
--- 889,893 ----
                                }
                        }
! #line 586 "output.c"
                }
                break;
***************
*** 888,892 ****
                                e->type = e->expr->type;
                        }
! #line 586 "output.c"
                }
                break;
--- 902,906 ----
                                e->type = e->expr->type;
                        }
! #line 599 "output.c"
                }
                break;
***************
*** 899,903 ****
                                e->type = int_type;
                        }
! #line 597 "output.c"
                }
                break;
--- 913,917 ----
                                e->type = int_type;
                        }
! #line 610 "output.c"
                }
                break;





reply via email to

[Prev in Thread] Current Thread [Next in Thread]