Changeset 69c5c00 for libcfa/src/exception.hfa
- Timestamp:
- Oct 7, 2020, 6:08:35 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 6fbe9a5
- Parents:
- 41b8ea4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/exception.hfa
r41b8ea4 r69c5c00 95 95 // visible anywhere you use the instantiation of the exception is used. 96 96 #define POLY_VTABLE_DECLARATION(exception_name, ...) \ 97 void mark_exception(exception_name(__VA_ARGS__) *); \97 VTABLE_TYPE(exception_name)(__VA_ARGS__) const & get_exception_vtable(exception_name(__VA_ARGS__) *); \ 98 98 extern VTABLE_TYPE(exception_name)(__VA_ARGS__) VTABLE_NAME(exception_name) 99 99 … … 160 160 161 161 #define _FORALL_CTOR0_DECLARATION(exception_name, assertions, parameters) \ 162 forall(_UNPACK assertions | VTABLE_ASSERTION(exception_name, parameters) ) \ 162 forall(_UNPACK assertions | \ 163 is_exception(exception_name parameters, VTABLE_TYPE(exception_name) parameters)) \ 163 164 void ?{}(exception_name parameters & this) 164 165 165 166 #define _FORALL_CTOR0_INSTANCE(exception_name, assertions, parameters) \ 166 167 _FORALL_CTOR0_DECLARATION(exception_name, assertions, parameters) { \ 167 VTABLE_INIT(this, exception_name); \168 (this).virtual_table = &get_exception_vtable(&this); \ 168 169 } 169 170 … … 185 186 #define _VTABLE_DECLARATION(exception_name, parent_name, ...) \ 186 187 struct exception_name; \ 187 void mark_exception(exception_name *); \188 188 VTABLE_TYPE(exception_name); \ 189 VTABLE_TYPE(exception_name) const & get_exception_vtable(exception_name *); \ 189 190 extern VTABLE_TYPE(exception_name) VTABLE_NAME(exception_name); \ 190 191 VTABLE_TYPE(exception_name) { \ … … 197 198 198 199 #define _VTABLE_INSTANCE(exception_name, parent_name, ...) \ 199 void mark_exception(exception_name *) {} \ 200 VTABLE_TYPE(exception_name) const & get_exception_vtable(exception_name *) { \ 201 return VTABLE_NAME(exception_name); \ 202 } \ 200 203 void _GLUE2(exception_name,_copy)(exception_name * this, exception_name * other) { \ 201 204 *this = *other; \ … … 218 221 219 222 #define _POLY_VTABLE_INSTANCE(exception_name, parent_name, ...) \ 220 void mark_exception(exception_name(__VA_ARGS__) *) {} \ 223 extern VTABLE_TYPE(exception_name)(__VA_ARGS__) VTABLE_NAME(exception_name); \ 224 VTABLE_TYPE(exception_name)(__VA_ARGS__) const & get_exception_vtable( \ 225 exception_name(__VA_ARGS__) *) { \ 226 return VTABLE_NAME(exception_name); \ 227 } \ 221 228 void _GLUE2(exception_name,_copy)( \ 222 229 exception_name(__VA_ARGS__) * this, exception_name(__VA_ARGS__) * other) { \
Note: See TracChangeset
for help on using the changeset viewer.