Changeset f57dd25 for libcfa/prelude/builtins.c
- Timestamp:
- May 29, 2019, 3:45:00 PM (7 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 0aedb01
- Parents:
- 157a816 (diff), ebc0a85 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)links above to see all the changes relative to each parent. - File:
-
- 1 edited
-
libcfa/prelude/builtins.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/builtins.c
r157a816 rf57dd25 13 13 // Update Count : 95 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
Note:
See TracChangeset
for help on using the changeset viewer.