Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/prelude/builtins.c

    r88e79ad r36982fc  
    1616// exception implementation
    1717
    18 typedef unsigned long long __cfaabi_exception_type_t;
     18typedef unsigned long long __cfaabi_abi_exception_type_t;
    1919
    2020#include "../libcfa/virtual.h"
     
    8080} // ?\?
    8181
    82 static inline forall( otype T | { void ?{}( T & this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } )
    83 double ?\?( T x, signed long int y ) {
    84     if ( y >=  0 ) return (double)(x \ (unsigned long int)y);
    85     else return 1.0 / x \ (unsigned long int)(-y);
    86 } // ?\?
     82// FIXME (x \ (unsigned long int)y) relies on X ?\?(T, unsigned long) a function that is neither
     83// defined, nor passed as an assertion parameter. Without user-defined conversions, cannot specify
     84// X as a type that casts to double, yet it doesn't make sense to write functions with that type
     85// signature where X is double.
     86
     87// static inline forall( otype T | { void ?{}( T & this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } )
     88// double ?\?( T x, signed long int y ) {
     89//     if ( y >=  0 ) return (double)(x \ (unsigned long int)y);
     90//     else return 1.0 / x \ (unsigned long int)(-y);
     91// } // ?\?
    8792
    8893static inline long int ?\=?( long int & x, unsigned long int y ) { x = x \ y; return x; }
     
    9196static inline unsigned int ?\=?( unsigned int & x, unsigned long int y ) { x = x \ y; return x; }
    9297
    93 // type that wraps a pointer and a destructor-like function - used in generating implicit destructor calls for struct members in user-defined functions
    94 forall(dtype T)
    95 struct __Destructor {
    96   T * object;
    97   void (*dtor)(T *);
    98 };
    99 
    100 // defined destructor in the case that non-generated code wants to use __Destructor
    101 forall(dtype T)
    102 static inline void ^?{}(__Destructor(T) & x) {
    103   x.dtor(x.object);
    104 }
    105 
    106 // easy interface into __Destructor's destructor for easy codegen purposes
    107 extern "C" {
    108   forall(dtype T)
    109   static inline void __destroy_Destructor(__Destructor(T) * dtor) {
    110     ^(*dtor){};
    111   }
    112 }
    113 
    11498// Local Variables: //
    11599// mode: c //
Note: See TracChangeset for help on using the changeset viewer.