Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (11 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
dafbde8
Parents:
2f47ea4
Message:

Converting the project to use the new syntax for otype, dtype and ttytpe.

Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.

Location:
tests/zombies/gc_no_raii
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • tests/zombies/gc_no_raii/bug-repro/blockers/explicit_cast.c

    r2f47ea4 rfd54fef  
    99};
    1010
    11 forall(otype T)
     11forall(T)
    1212struct gcpointer
    1313{
     
    1515};
    1616
    17 forall(otype T)
     17forall(T)
    1818static inline gcpointer(T) gcmalloc()
    1919{
  • tests/zombies/gc_no_raii/bug-repro/blockers/recursive_realloc.c

    r2f47ea4 rfd54fef  
    33#include <stdlib.hfa>
    44
    5 trait allocator_c(otype T, otype allocator_t)
     5trait allocator_c(T, allocator_t)
    66{
    77        void realloc(allocator_t* const, size_t);
    88};
    99
    10 forall(otype T)
     10forall(T)
    1111struct heap_allocator
    1212{
     
    1515};
    1616
    17 forall(otype T)
     17forall(T)
    1818inline void realloc(heap_allocator(T) *const this, size_t size)
    1919{
  • tests/zombies/gc_no_raii/bug-repro/deref.c

    r2f47ea4 rfd54fef  
    1     forall(otype T)
     1    forall(T)
    22    struct wrap
    33    {
     
    55    };
    66
    7     forall(otype T)
     7    forall(T)
    88    T *? (wrap(T) rhs)
    99    {
  • tests/zombies/gc_no_raii/bug-repro/field.c

    r2f47ea4 rfd54fef  
    88//------------------------------------------------------------------------------
    99//Declaration
    10 trait allocator_c(otype T, otype allocator_t)
     10trait allocator_c(T, allocator_t)
    1111{
    1212        void ctor(allocator_t* const);
     
    1616};
    1717
    18 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     18forall(T, allocator_t | allocator_c(T, allocator_t))
    1919struct vector
    2020{
  • tests/zombies/gc_no_raii/bug-repro/malloc.c

    r2f47ea4 rfd54fef  
    1 forall(otype T)
     1forall(T)
    22struct wrapper
    33{
     
    55};
    66
    7 forall(otype T)
     7forall(T)
    88void ctor(wrapper(T)* this)
    99{
     
    1111}
    1212
    13 forall(otype T)
     13forall(T)
    1414wrapper(T) gcmalloc()
    1515{
     
    1919}
    2020
    21 forall(otype T)
     21forall(T)
    2222wrapper(T)* ?=? (wrapper(T)* lhs, wrapper(T)* rhs)
    2323{
  • tests/zombies/gc_no_raii/bug-repro/oddtype.c

    r2f47ea4 rfd54fef  
    1 forall(dtype T)
     1forall(T &)
    22struct wrap {
    33        int i;
    44};
    55
    6 forall(otype T) void ?{}(wrap(T)* this) {}
    7 forall(otype T) void ?=?(wrap(T)* this) {}
    8 forall(otype T) void ^?{}(wrap(T)* this) {}
     6forall(T) void ?{}(wrap(T)* this) {}
     7forall(T) void ?=?(wrap(T)* this) {}
     8forall(T) void ^?{}(wrap(T)* this) {}
    99
    1010struct List_t {
  • tests/zombies/gc_no_raii/bug-repro/push_back.h

    r2f47ea4 rfd54fef  
    11//------------------------------------------------------------------------------
    22//Declaration
    3 trait allocator_c(otype T, otype allocator_t) {
     3trait allocator_c(T, allocator_t) {
    44        void ctor(allocator_t* const);
    55        void dtor(allocator_t* const);
     
    88};
    99
    10 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     10forall(T, allocator_t | allocator_c(T, allocator_t))
    1111struct vector
    1212{
     
    1717//------------------------------------------------------------------------------
    1818//Initialization
    19 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     19forall(T, allocator_t | allocator_c(T, allocator_t))
    2020void vector_ctor(vector(T, allocator_t) *const this);
    2121
    22 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     22forall(T, allocator_t | allocator_c(T, allocator_t))
    2323void dtor(vector(T, allocator_t) *const this);
    2424
    2525//------------------------------------------------------------------------------
    2626//Allocator
    27 forall(otype T)
     27forall(T)
    2828struct heap_allocator
    2929{
     
    3232};
    3333
    34 forall(otype T)
     34forall(T)
    3535void ctor(heap_allocator(T) *const this);
    3636
    37 forall(otype T)
     37forall(T)
    3838void dtor(heap_allocator(T) *const this);
    3939
    40 forall(otype T)
     40forall(T)
    4141void realloc(heap_allocator(T) *const this, size_t size);
    4242
    43 forall(otype T)
     43forall(T)
    4444inline T* data(heap_allocator(T) *const this)
    4545{
     
    4949//------------------------------------------------------------------------------
    5050//Capacity
    51 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     51forall(T, allocator_t | allocator_c(T, allocator_t))
    5252inline bool empty(vector(T, allocator_t) *const this)
    5353{
     
    5555}
    5656
    57 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     57forall(T, allocator_t | allocator_c(T, allocator_t))
    5858inline bool size(vector(T, allocator_t) *const this)
    5959{
     
    6161}
    6262
    63 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     63forall(T, allocator_t | allocator_c(T, allocator_t))
    6464inline void reserve(vector(T, allocator_t) *const this, size_t size)
    6565{
     
    6969//------------------------------------------------------------------------------
    7070//Modifiers
    71 forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
     71forall(T, allocator_t | allocator_c(T, allocator_t))
    7272void push_back(vector(T, allocator_t) *const this, T value);
  • tests/zombies/gc_no_raii/bug-repro/realloc.c

    r2f47ea4 rfd54fef  
    11void* realloc(void*, unsigned long int);
    22
    3 forall(otype T)
     3forall(T)
    44struct wrap
    55{
     
    77};
    88
    9 forall(otype T)
     9forall(T)
    1010static inline void realloc(wrap(T) *const this, unsigned long int size)
    1111{
  • tests/zombies/gc_no_raii/bug-repro/return.c

    r2f47ea4 rfd54fef  
    1 forall(otype T)
     1forall(T)
    22struct wrapper
    33{
     
    55};
    66
    7 forall(otype T)
     7forall(T)
    88wrapper(T) create()
    99{
     
    1212}
    1313
    14 forall(otype T)
     14forall(T)
    1515wrapper(T)* ?=?(wrapper(T)* lhs, wrapper(T)* rhs)
    1616{
  • tests/zombies/gc_no_raii/bug-repro/return_template.c

    r2f47ea4 rfd54fef  
    1 forall(otype T)
     1forall(T)
    22struct wrap
    33{
     
    55};
    66
    7 forall(otype T) void ?{}(wrap(T)* this);
    8 forall(otype T) void ?{}(wrap(T)* this, wrap(T)* rhs);
    9 forall(otype T) void ^?{}(wrap(T)* this);
    10 forall(otype T) void ?=?(wrap(T)* this, wrap(T)* rhs);
     7forall(T) void ?{}(wrap(T)* this);
     8forall(T) void ?{}(wrap(T)* this, wrap(T)* rhs);
     9forall(T) void ^?{}(wrap(T)* this);
     10forall(T) void ?=?(wrap(T)* this, wrap(T)* rhs);
    1111
    12 forall(otype T)
     12forall(T)
    1313wrap(T) test()
    1414{
  • tests/zombies/gc_no_raii/bug-repro/slow_malloc.c

    r2f47ea4 rfd54fef  
    11#include <stdlib.hfa>
    22
    3 forall(otype T)
     3forall(T)
    44struct heap_allocator
    55{
  • tests/zombies/gc_no_raii/bug-repro/zero.c

    r2f47ea4 rfd54fef  
    1 forall(otype T)
     1forall(T)
    22struct wrap
    33{
     
    55};
    66
    7 forall(otype T)
     7forall(T)
    88int ?==? (wrap(T) lhs, wrap(T) rhs)
    99{
     
    1414struct wrap(int) 0;
    1515/*/
    16 forall(otype T)
     16forall(T)
    1717struct wrap(T) 0;
    1818//*/
  • tests/zombies/gc_no_raii/src/gc.h

    r2f47ea4 rfd54fef  
    1313// }
    1414
    15 forall(otype T)
     15forall(T)
    1616static inline void gcmalloc(gcpointer(T)* ptr)
    1717{
  • tests/zombies/gc_no_raii/src/gcpointers.c

    r2f47ea4 rfd54fef  
    113113#endif
    114114
    115 forall(otype T) void ?{}(gcpointer(T)* this) {
     115forall(T) void ?{}(gcpointer(T)* this) {
    116116        (&this->internal) {};
    117117}
    118118
    119 forall(otype T) void ?{}(gcpointer(T)* this, void* address) {
     119forall(T) void ?{}(gcpointer(T)* this, void* address) {
    120120        (&this->internal) { address };
    121121}
    122122
    123 forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T) other) {
     123forall(T) void ?{}(gcpointer(T)* this, gcpointer(T) other) {
    124124        (&this->internal) { other.internal };
    125125}
    126126
    127 forall(otype T) void ^?{}(gcpointer(T)* this) {
     127forall(T) void ^?{}(gcpointer(T)* this) {
    128128        ^?{}(&this->internal);
    129129}
    130130
    131 forall(otype T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs) {
     131forall(T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs) {
    132132        this->internal = rhs.internal;
    133133        return *this;
     
    136136// forall(otype T) T *?(gcpointer(T) this);
    137137
    138 forall(otype T) T* get(gcpointer(T)* this) {
     138forall(T) T* get(gcpointer(T)* this) {
    139139        return (T*)this->internal.ptr;
    140140}
    141141//
    142142// //Logical operators
    143 forall(otype T) int ?!=?(gcpointer(T) this, int zero) {
     143forall(T) int ?!=?(gcpointer(T) this, int zero) {
    144144        return this.internal.ptr != 0;
    145145}
  • tests/zombies/gc_no_raii/src/gcpointers.h

    r2f47ea4 rfd54fef  
    44#include <stdint.h>
    55
    6 forall(dtype T)
     6forall(T &)
    77struct gcpointer;
    88
     
    2929#endif
    3030
    31 forall(dtype T)
     31forall(T &)
    3232struct gcpointer
    3333{
     
    3636
    3737//
    38 forall(otype T) void ?{}(gcpointer(T)* this);
    39 forall(otype T) void ?{}(gcpointer(T)* this, void* address);
    40 forall(otype T) void ?{}(gcpointer(T)* this, gcpointer(T) other);
    41 forall(otype T) void ^?{}(gcpointer(T)* this);
    42 forall(otype T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs);
     38forall(T) void ?{}(gcpointer(T)* this);
     39forall(T) void ?{}(gcpointer(T)* this, void* address);
     40forall(T) void ?{}(gcpointer(T)* this, gcpointer(T) other);
     41forall(T) void ^?{}(gcpointer(T)* this);
     42forall(T) gcpointer(T) ?=?(gcpointer(T)* this, gcpointer(T) rhs);
    4343
    4444
    4545// forall(otype T) T *?(gcpointer(T) this);
    46 forall(otype T) T* get(gcpointer(T)* this);
     46forall(T) T* get(gcpointer(T)* this);
    4747
    4848//Logical operators
    49 forall(otype T) int ?!=?(gcpointer(T) this, int zero);
    50 forall(otype T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);
    51 forall(otype T) int ?==?(gcpointer(T) this, gcpointer(T) rhs);
     49forall(T) int ?!=?(gcpointer(T) this, int zero);
     50forall(T) int ?!=?(gcpointer(T) this, gcpointer(T) rhs);
     51forall(T) int ?==?(gcpointer(T) this, gcpointer(T) rhs);
  • tests/zombies/gc_no_raii/src/tools.h

    r2f47ea4 rfd54fef  
    1212// }
    1313
    14 trait has_equal(otype T)
     14trait has_equal(T)
    1515{
    1616        signed int ?==?(T a, T b);
    1717};
    1818
    19 trait InputIterator_t(otype T, otype InputIterator)
     19trait InputIterator_t(T, InputIterator)
    2020{
    2121        signed int ?==?(InputIterator a, InputIterator b);
     
    2626};
    2727
    28 forall(otype T | has_equal(T), otype InputIterator | InputIterator_t(T, InputIterator))
     28forall(T | has_equal(T), InputIterator | InputIterator_t(T, InputIterator))
    2929static inline InputIterator find( InputIterator first, const InputIterator* const last, T val)
    3030{
Note: See TracChangeset for help on using the changeset viewer.