Changes in libcfa/prelude/builtins.c [bf71cfd:b867278]
- File:
-
- 1 edited
-
libcfa/prelude/builtins.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/builtins.c
rbf71cfd rb867278 10 10 // Created On : Fri Jul 21 16:21:03 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 8 12:47:59201813 // Update Count : 1912 // Last Modified On : Sun Aug 5 21:40:38 2018 13 // Update Count : 20 14 14 // 15 16 // type that wraps a pointer and a destructor-like function - used in generating implicit destructor calls for struct members in user-defined functions 17 // Note: needs to occur early, because it is used to generate destructor calls during code generation 18 forall(dtype T) 19 struct __Destructor { 20 T * object; 21 void (*dtor)(T *); 22 }; 23 24 // defined destructor in the case that non-generated code wants to use __Destructor 25 forall(dtype T) 26 static inline void ^?{}(__Destructor(T) & x) { 27 if (x.object && x.dtor) { 28 x.dtor(x.object); 29 } 30 } 31 32 // easy interface into __Destructor's destructor for easy codegen purposes 33 extern "C" { 34 forall(dtype T) 35 static inline void __destroy_Destructor(__Destructor(T) * dtor) { 36 ^(*dtor){}; 37 } 38 } 15 39 16 40 // exception implementation … … 22 46 23 47 void exit( int status, const char fmt[], ... ) __attribute__ (( format(printf, 2, 3), __nothrow__, __leaf__, __noreturn__ )); 24 void abort ( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ ));48 void abort( const char fmt[], ... ) __attribute__ (( format(printf, 1, 2), __nothrow__, __leaf__, __noreturn__ )); 25 49 26 50 // increment/decrement unification
Note:
See TracChangeset
for help on using the changeset viewer.