Changeset 566b74f
- Timestamp:
- Feb 23, 2018, 11:38:29 AM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 2c39855
- Parents:
- d8548e2 (diff), 0304215a (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. - Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/general/Paper.tex
rd8548e2 r566b74f 117 117 _Alignas, _Alignof, __alignof, __alignof__, asm, __asm, __asm__, _At, __attribute, 118 118 __attribute__, auto, _Bool, catch, catchResume, choose, _Complex, __complex, __complex__, 119 __const, __const__, disable, dtype, enable, __extension__, fallthrough, fallthru,119 __const, __const__, disable, dtype, enable, exception, __extension__, fallthrough, fallthru, 120 120 finally, forall, ftype, _Generic, _Imaginary, inline, __label__, lvalue, _Noreturn, one_t, 121 121 otype, restrict, _Static_assert, throw, throwResume, trait, try, ttype, typeof, __typeof, … … 260 260 \Celeven did add @_Generic@ expressions, which can be used in preprocessor macros to provide a form of ad-hoc polymorphism; however, this polymorphism is both functionally and ergonomically inferior to \CFA name overloading. 261 261 The macro wrapping the generic expression imposes some limitations; as an example, it could not implement the example above, because the variables @max@ would collide with the functions @max@. 262 Ergonomic limitations of @_Generic@ include the necessity to put a fixed list of supported types in a single place and manually dispatch to appropriate overloads, as well as possible namespace pollution from the functions dispatched to, which must all have distinct names. 262 Ergonomic limitations of @_Generic@ include the necessity to put a fixed list of supported types in a single place and manually dispatch to appropriate overloads, as well as possible namespace pollution from the functions dispatched to, which must all have distinct names. 263 263 Though name-overloading removes a major use-case for @_Generic@ expressions, \CFA does implement @_Generic@ for backwards-compatibility purposes. \TODO{actually implement that} 264 264 … … 1357 1357 \subsection{Exception Handling} 1358 1358 1359 \CFA provides two forms of exception handling: \newterm{resumption} (fix-up) and \newterm{recovery} (see Figure~\ref{f:CFAExceptionHandling}). 1359 The following framework for \CFA exception handling is in place, excluding a run-time type information and dynamic casts. 1360 \CFA provides two forms of exception handling: \newterm{fix-up} and \newterm{recovery} (see Figure~\ref{f:CFAExceptionHandling}). 1360 1361 Both mechanisms provide dynamic call to a handler using dynamic name-lookup, where fix-up has dynamic return and recovery has static return from the handler. 1361 \CFA restricts exception types to those defined by aggregate type @ _Exception@.1362 \CFA restricts exception types to those defined by aggregate type @exception@. 1362 1363 The form of the raise dictates the set of handlers examined during propagation: \newterm{resumption propagation} (@resume@) only examines resumption handlers (@catchResume@); \newterm{terminating propagation} (@throw@) only examines termination handlers (@catch@). 1363 1364 If @resume@ or @throw@ have no exception type, it is a reresume/rethrow, meaning the currently exception continues propagation. 1364 If there is no current exception, the reresume/rethrow results in a nerror.1365 If there is no current exception, the reresume/rethrow results in a runtime error. 1365 1366 1366 1367 \begin{figure} … … 1370 1371 \multicolumn{1}{c@{\hspace{\parindentlnth}}}{\textbf{Resumption}} & \multicolumn{1}{c}{\textbf{Recovery}} \\ 1371 1372 \begin{cfa} 1372 ` _Exception R { int fix; };`1373 `exception R { int fix; };` 1373 1374 void f() { 1374 1375 R r; 1375 1376 ... `resume( r );` ... 1376 1377 ... r.fix // control does return here after handler 1378 } 1377 1379 `try` { 1378 1380 ... f(); ... … … 1383 1385 & 1384 1386 \begin{cfa} 1385 ` _Exception T {};`1387 `exception T {};` 1386 1388 void f() { 1387 1389 1388 1390 ... `throw( T{} );` ... 1389 1391 // control does NOT return here after handler 1392 } 1390 1393 `try` { 1391 1394 ... f(); ... … … 1420 1423 ... write( `datafile`, ... ); ... $\C{// may throw IOError}$ 1421 1424 ... write( `logfile`, ... ); ... 1422 } catch ( IOError err; `err == datafile` ) { ... } $\C{// handle datafile error}$1423 catch ( IOError err; `err == logfile` ) { ... } $\C{// handle logfile error}$1425 } catch ( IOError err; `err.file == datafile` ) { ... } $\C{// handle datafile error}$ 1426 catch ( IOError err; `err.file == logfile` ) { ... } $\C{// handle logfile error}$ 1424 1427 catch ( IOError err ) { ... } $\C{// handler error from other files}$ 1425 1428 \end{cfa} … … 1429 1432 The resumption raise can specify an alternate stack on which to raise an exception, called a \newterm{nonlocal raise}: 1430 1433 \begin{cfa} 1431 resume [ $\emph{exception-type}$ ] [ _At $\emph{alternate-stack}$ ] ; 1432 \end{cfa} 1433 The @_At@ clause raises the specified exception or the currently propagating exception (reresume) at another coroutine or task~\cite{Delisle18}. 1434 resume( $\emph{exception-type}$, $\emph{alternate-stack}$ ) 1435 resume( $\emph{alternate-stack}$ ) 1436 \end{cfa} 1437 These overloads of @resume@ raise the specified exception or the currently propagating exception (reresume) at another coroutine or task~\cite{Delisle18}. 1434 1438 Nonlocal raise is restricted to resumption to provide the exception handler the greatest flexibility because processing the exception does not unwind its stack, allowing it to continue after the handle returns. 1435 1439 … … 1622 1626 \lstMakeShortInline@% 1623 1627 \end{cquote} 1624 Specifiers must appear at the start of a \CFA routine declaration\footnote{\label{StorageClassSpecifier} .1628 Specifiers must appear at the start of a \CFA routine declaration\footnote{\label{StorageClassSpecifier} 1625 1629 The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature.~\cite[\S~6.11.5(1)]{C11}}. 1626 1630 … … 1677 1681 * [ * int, int ] ( int ) jp; $\C{// pointer to routine returning pointer to int and int, with int parameter}$ 1678 1682 \end{cfa} 1679 Note, \emph{a routine name cannot be specified}:1683 Note, a routine name cannot be specified: 1680 1684 \begin{cfa} 1681 1685 * [ int x ] f () fp; $\C{// routine name "f" is disallowed}$ … … 1994 1998 The addition of @one_t@ allows generic algorithms to handle the unit value uniformly for types where that is meaningful. 1995 1999 \TODO{Make this sentence true} In particular, polymorphic functions in the \CFA prelude define @++x@ and @x++@ in terms of @x += 1@, allowing users to idiomatically define all forms of increment for a type @T@ by defining the single function @T & ?+=(T &, one_t)@; analogous overloads for the decrement operators are present as well. 2000 1996 2001 1997 2002 \subsection{Integral Suffixes} … … 2614 2619 \section{Acknowledgments} 2615 2620 2616 The authors would like to recognize the design assistance of Glen Ditchfield, Richard Bilson, and Thierry Delisle on the features described in this paper, and thank Magnus Madsen and the three anonymous reviewers for valuable feedback.2621 The authors would like to recognize the design assistance of Glen Ditchfield, Richard Bilson, and Thierry Delisle on the features described in this paper, and thank Magnus Madsen for feedback in the writing. 2617 2622 %This work is supported in part by a corporate partnership with \grantsponsor{Huawei}{Huawei Ltd.}{http://www.huawei.com}, and Aaron Moss and Peter Buhr are funded by the \grantsponsor{Natural Sciences and Engineering Research Council} of Canada. 2618 2623 % the first author's \grantsponsor{NSERC-PGS}{NSERC PGS D}{http://www.nserc-crsng.gc.ca/Students-Etudiants/PG-CS/BellandPostgrad-BelletSuperieures_eng.asp} scholarship. -
src/Parser/DeclarationNode.cc
rd8548e2 r566b74f 10 10 // Created On : Sat May 16 12:34:05 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 20 09:21:52 201713 // Update Count : 103 112 // Last Modified On : Thu Feb 22 15:37:17 2018 13 // Update Count : 1033 14 14 // 15 15 … … 120 120 } // DeclarationNode::clone 121 121 122 bool DeclarationNode::get_hasEllipsis() const {123 return hasEllipsis;124 }125 126 122 void DeclarationNode::print( std::ostream &os, int indent ) const { 127 123 os << string( indent, ' ' ); … … 167 163 } 168 164 169 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body , bool newStyle) {165 DeclarationNode * DeclarationNode::newFunction( string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ) { 170 166 DeclarationNode * newnode = new DeclarationNode; 171 167 newnode->name = name; 172 168 newnode->type = new TypeData( TypeData::Function ); 173 169 newnode->type->function.params = param; 174 newnode->type->function.newStyle = newStyle;175 170 newnode->type->function.body = body; 176 171 -
src/Parser/ParseNode.h
rd8548e2 r566b74f 10 10 // Created On : Sat May 16 13:28:16 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Nov 27 17:33:35 201713 // Update Count : 82 412 // Last Modified On : Thu Feb 22 17:49:31 2018 13 // Update Count : 827 14 14 // 15 15 … … 209 209 enum Length { Short, Long, LongLong, NoLength }; 210 210 static const char * lengthNames[]; 211 enum Aggregate { Struct, Union, Trait, Coroutine, Monitor, Thread, NoAggregate };211 enum Aggregate { Struct, Union, Exception, Trait, Coroutine, Monitor, Thread, NoAggregate }; 212 212 static const char * aggregateNames[]; 213 213 enum TypeClass { Otype, Dtype, Ftype, Ttype, NoTypeClass }; … … 226 226 static DeclarationNode * newForall( DeclarationNode * ); 227 227 static DeclarationNode * newFromTypedef( std::string * ); 228 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body , bool newStyle = false);228 static DeclarationNode * newFunction( std::string * name, DeclarationNode * ret, DeclarationNode * param, StatementNode * body ); 229 229 static DeclarationNode * newAggregate( Aggregate kind, const std::string * name, ExpressionNode * actuals, DeclarationNode * fields, bool body ); 230 230 static DeclarationNode * newEnum( std::string * name, DeclarationNode * constants, bool body ); … … 288 288 Type * buildType() const; 289 289 290 bool get_hasEllipsis() const;291 290 LinkageSpec::Spec get_linkage() const { return linkage; } 292 291 DeclarationNode * extractAggregate() const; -
src/Parser/TypeData.cc
rd8548e2 r566b74f 10 10 // Created On : Sat May 16 15:12:51 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Mon Sep 25 18:33:41 201713 // Update Count : 5 8712 // Last Modified On : Thu Feb 22 15:49:00 2018 13 // Update Count : 597 14 14 // 15 15 … … 54 54 function.oldDeclList = nullptr; 55 55 function.body = nullptr; 56 function.newStyle = false;57 56 function.withExprs = nullptr; 58 57 break; … … 195 194 newtype->function.oldDeclList = maybeClone( function.oldDeclList ); 196 195 newtype->function.body = maybeClone( function.body ); 197 newtype->function.newStyle = function.newStyle;198 196 newtype->function.withExprs = maybeClone( function.withExprs ); 199 197 break; … … 881 879 FunctionType * buildFunction( const TypeData * td ) { 882 880 assert( td->kind == TypeData::Function ); 883 bool hasEllipsis = td->function.params ? td->function.params->get_hasEllipsis() : true; 884 if ( ! td->function.params ) hasEllipsis = ! td->function.newStyle; 885 FunctionType * ft = new FunctionType( buildQualifiers( td ), hasEllipsis ); 881 FunctionType * ft = new FunctionType( buildQualifiers( td ), ! td->function.params || td->function.params->hasEllipsis ); 886 882 buildList( td->function.params, ft->get_parameters() ); 887 883 buildForall( td->forall, ft->get_forall() ); -
src/Parser/TypeData.h
rd8548e2 r566b74f 10 10 // Created On : Sat May 16 15:18:36 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Sep 1 23:33:45 201713 // Update Count : 19 012 // Last Modified On : Thu Feb 22 15:21:23 2018 13 // Update Count : 191 14 14 // 15 15 … … 64 64 mutable DeclarationNode * oldDeclList; 65 65 StatementNode * body; 66 bool newStyle;67 66 ExpressionNode * withExprs; // expressions from function's with_clause 68 67 }; -
src/Parser/lex.ll
rd8548e2 r566b74f 10 10 * Created On : Sat Sep 22 08:58:10 2001 11 11 * Last Modified By : Peter A. Buhr 12 * Last Modified On : Wed Oct 25 13:53:56 201713 * Update Count : 63 412 * Last Modified On : Thu Feb 22 18:11:27 2018 13 * Update Count : 637 14 14 */ 15 15 … … 232 232 enum { KEYWORD_RETURN(ENUM); } 233 233 __extension__ { KEYWORD_RETURN(EXTENSION); } // GCC 234 exception { KEYWORD_RETURN(EXCEPTION); } // CFA 234 235 extern { KEYWORD_RETURN(EXTERN); } 235 236 fallthru { KEYWORD_RETURN(FALLTHRU); } // CFA -
src/Parser/parser.yy
rd8548e2 r566b74f 10 10 // Created On : Sat Sep 1 20:22:55 2001 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 15 17:12:31201813 // Update Count : 30 0612 // Last Modified On : Thu Feb 22 17:48:54 2018 13 // Update Count : 3028 14 14 // 15 15 … … 187 187 %token TYPEOF LABEL // GCC 188 188 %token ENUM STRUCT UNION 189 %token EXCEPTION // CFA 189 190 %token COROUTINE MONITOR THREAD // CFA 190 191 %token OTYPE FTYPE DTYPE TTYPE TRAIT // CFA … … 314 315 %type<decl> cfa_identifier_parameter_declarator_tuple cfa_identifier_parameter_ptr 315 316 316 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list cfa_parameter_type_list_opt317 %type<decl> cfa_parameter_declaration cfa_parameter_list cfa_parameter_type_list_opt 317 318 318 319 %type<decl> cfa_typedef_declaration cfa_variable_declaration cfa_variable_specifier … … 322 323 %type<decl> KR_declaration_list KR_declaration_list_opt 323 324 324 %type<decl> parameter_declaration parameter_list parameter_type_list 325 %type<decl> parameter_type_list_opt 325 %type<decl> parameter_declaration parameter_list parameter_type_list_opt 326 326 327 327 %type<decl> paren_identifier paren_type … … 779 779 | unary_expression assignment_operator assignment_expression 780 780 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 781 | unary_expression '=' '{' initializer_list comma_opt '}' // FIX ME782 { $$ = nullptr; }781 | unary_expression '=' '{' initializer_list comma_opt '}' 782 { throw SemanticError( yylloc, "Initializer assignment is currently unimplemented." ); $$ = nullptr; } // FIX ME 783 783 ; 784 784 … … 849 849 | waitfor_statement 850 850 | exception_statement 851 | enable_disable_statement 852 { throw SemanticError( yylloc, "enable/disable statement is currently unimplemented." ); $$ = nullptr; } // FIX ME 851 853 | asm_statement 852 854 ; … … 1064 1066 | RETURN comma_expression_opt ';' 1065 1067 { $$ = new StatementNode( build_return( $2 ) ); } 1066 | RETURN '{' initializer_list comma_opt '}' // FIX ME1067 { $$ = nullptr; }1068 | RETURN '{' initializer_list comma_opt '}' 1069 { throw SemanticError( yylloc, "Initializer return is currently unimplemented." ); $$ = nullptr; } // FIX ME 1068 1070 | THROW assignment_expression_opt ';' // handles rethrow 1069 1071 { $$ = new StatementNode( build_throw( $2 ) ); } … … 1193 1195 ; 1194 1196 1197 enable_disable_statement: 1198 enable_disable_key identifier_list compound_statement 1199 ; 1200 1201 enable_disable_key: 1202 ENABLE 1203 | DISABLE 1204 ; 1205 1195 1206 asm_statement: 1196 1207 ASM asm_volatile_opt '(' string_literal ')' ';' … … 1392 1403 DeclarationNode * ret = new DeclarationNode; 1393 1404 ret->type = maybeClone( $1->type->base ); 1394 $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr , true) );1405 $$ = $1->appendList( DeclarationNode::newFunction( $5, ret, $8, nullptr ) ); 1395 1406 } 1396 1407 ; … … 1422 1433 // To obtain LR(1 ), this rule must be factored out from function return type (see cfa_abstract_declarator). 1423 1434 { 1424 $$ = DeclarationNode::newFunction( $2, $1, $5, 0 , true);1435 $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); 1425 1436 } 1426 1437 | cfa_function_return identifier_or_type_name '(' push cfa_parameter_type_list_opt pop ')' 1427 1438 { 1428 $$ = DeclarationNode::newFunction( $2, $1, $5, 0 , true);1439 $$ = DeclarationNode::newFunction( $2, $1, $5, 0 ); 1429 1440 } 1430 1441 ; … … 1881 1892 | UNION 1882 1893 { $$ = DeclarationNode::Union; } 1894 | EXCEPTION 1895 { $$ = DeclarationNode::Exception; } 1883 1896 | COROUTINE 1884 1897 { $$ = DeclarationNode::Coroutine; } … … 1990 2003 ; 1991 2004 1992 // Minimum of one parameter after which ellipsis is allowed only at the end. 1993 1994 cfa_parameter_type_list_opt: // CFA 2005 cfa_parameter_type_list_opt: // CFA, abstract + real 1995 2006 // empty 2007 { $$ = DeclarationNode::newBasicType( DeclarationNode::Void ); } 2008 | ELLIPSIS 1996 2009 { $$ = nullptr; } 1997 | cfa_parameter_type_list 1998 ; 1999 2000 cfa_parameter_type_list: // CFA, abstract + real 2001 cfa_abstract_parameter_list 2010 | cfa_abstract_parameter_list 2002 2011 | cfa_parameter_list 2003 2012 | cfa_parameter_list pop ',' push cfa_abstract_parameter_list … … 2030 2039 // empty 2031 2040 { $$ = nullptr; } 2032 | parameter_type_list 2033 ; 2034 2035 parameter_type_list: 2036 parameter_list 2041 | ELLIPSIS 2042 { $$ = nullptr; } 2043 | parameter_list 2037 2044 | parameter_list pop ',' push ELLIPSIS 2038 2045 { $$ = $1->addVarArgs(); } -
src/libcfa/exception.c
rd8548e2 r566b74f 10 10 // Created On : Mon Jun 26 15:13:00 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Fri Feb 9 14:41:55201813 // Update Count : 812 // Last Modified On : Thu Feb 22 18:17:34 2018 13 // Update Count : 11 14 14 // 15 15 … … 52 52 struct __cfaabi_ehm__try_resume_node * current_resume; 53 53 54 exception * current_exception;54 exception_t * current_exception; 55 55 int current_handler_index; 56 56 } shared_stack = {NULL, NULL, 0, 0}; … … 71 71 // This macro should be the only thing that needs to change across machines. Used in the personality function, way down 72 72 // in termination. 73 // struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception *)73 // struct _Unwind_Context * -> _Unwind_Reason_Code(*)(exception_t *) 74 74 #define MATCHER_FROM_CONTEXT(ptr_to_context) \ 75 (*(_Unwind_Reason_Code(**)(exception *))(_Unwind_GetCFA(ptr_to_context) + 8))75 (*(_Unwind_Reason_Code(**)(exception_t *))(_Unwind_GetCFA(ptr_to_context) + 8)) 76 76 77 77 78 78 // RESUMPTION ================================================================ 79 79 80 void __cfaabi_ehm__throw_resume(exception * except) {80 void __cfaabi_ehm__throw_resume(exception_t * except) { 81 81 82 82 __cfaabi_dbg_print_safe("Throwing resumption exception\n"); … … 106 106 107 107 void __cfaabi_ehm__try_resume_setup(struct __cfaabi_ehm__try_resume_node * node, 108 _Bool (*handler)(exception * except)) {108 _Bool (*handler)(exception_t * except)) { 109 109 node->next = shared_stack.top_resume; 110 110 node->handler = handler; … … 126 126 }; 127 127 128 #define NODE_TO_EXCEPT(node) ((exception *)(1 + (node)))128 #define NODE_TO_EXCEPT(node) ((exception_t *)(1 + (node))) 129 129 #define EXCEPT_TO_NODE(except) ((struct __cfaabi_ehm__node *)(except) - 1) 130 130 131 131 // Creates a copy of the indicated exception and sets current_exception to it. 132 static void __cfaabi_ehm__allocate_exception( exception * except ) {132 static void __cfaabi_ehm__allocate_exception( exception_t * except ) { 133 133 struct exception_context_t * context = this_exception_context(); 134 134 … … 151 151 152 152 // Delete the provided exception, unsetting current_exception if relivant. 153 static void __cfaabi_ehm__delete_exception( exception * except ) {153 static void __cfaabi_ehm__delete_exception( exception_t * except ) { 154 154 struct exception_context_t * context = this_exception_context(); 155 155 … … 179 179 // If this isn't a rethrow (*except==0), delete the provided exception. 180 180 void __cfaabi_ehm__cleanup_terminate( void * except ) { 181 if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception **)except );181 if ( *(void**)except ) __cfaabi_ehm__delete_exception( *(exception_t **)except ); 182 182 } 183 183 … … 233 233 } 234 234 235 void __cfaabi_ehm__throw_terminate( exception * val ) {235 void __cfaabi_ehm__throw_terminate( exception_t * val ) { 236 236 __cfaabi_dbg_print_safe("Throwing termination exception\n"); 237 237 … … 348 348 // _Unwind_Reason_Code (*matcher)() = (_Unwind_Reason_Code (*)())lsd_info.LPStart + imatcher; 349 349 350 _Unwind_Reason_Code (*matcher)(exception *) =350 _Unwind_Reason_Code (*matcher)(exception_t *) = 351 351 MATCHER_FROM_CONTEXT(context); 352 352 int index = matcher(shared_stack.current_exception); … … 409 409 __attribute__((noinline)) 410 410 void __cfaabi_ehm__try_terminate(void (*try_block)(), 411 void (*catch_block)(int index, exception * except),412 __attribute__((unused)) int (*match_block)(exception * except)) {411 void (*catch_block)(int index, exception_t * except), 412 __attribute__((unused)) int (*match_block)(exception_t * except)) { 413 413 //! volatile int xy = 0; 414 414 //! printf("%p %p %p %p\n", &try_block, &catch_block, &match_block, &xy); -
src/libcfa/exception.h
rd8548e2 r566b74f 9 9 // Author : Andrew Beach 10 10 // Created On : Mon Jun 26 15:11:00 2017 11 // Last Modified By : Andrew Beach12 // Last Modified On : Th r Aug 17 15:44:00 201713 // Update Count : 611 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Thu Feb 22 18:11:15 2018 13 // Update Count : 8 14 14 // 15 15 … … 22 22 23 23 struct __cfaabi_ehm__base_exception_t; 24 typedef struct __cfaabi_ehm__base_exception_t exception ;24 typedef struct __cfaabi_ehm__base_exception_t exception_t; 25 25 struct __cfaabi_ehm__base_exception_t_vtable { 26 26 const struct __cfaabi_ehm__base_exception_t_vtable * parent; … … 39 39 40 40 // Used in throw statement translation. 41 void __cfaabi_ehm__throw_terminate(exception * except) __attribute__((noreturn));41 void __cfaabi_ehm__throw_terminate(exception_t * except) __attribute__((noreturn)); 42 42 void __cfaabi_ehm__rethrow_terminate() __attribute__((noreturn)); 43 void __cfaabi_ehm__throw_resume(exception * except);43 void __cfaabi_ehm__throw_resume(exception_t * except); 44 44 45 45 // Function catches termination exceptions. 46 46 void __cfaabi_ehm__try_terminate( 47 47 void (*try_block)(), 48 void (*catch_block)(int index, exception * except),49 int (*match_block)(exception * except));48 void (*catch_block)(int index, exception_t * except), 49 int (*match_block)(exception_t * except)); 50 50 51 51 // Clean-up the exception in catch blocks. … … 55 55 struct __cfaabi_ehm__try_resume_node { 56 56 struct __cfaabi_ehm__try_resume_node * next; 57 _Bool (*handler)(exception * except);57 _Bool (*handler)(exception_t * except); 58 58 }; 59 59 … … 61 61 void __cfaabi_ehm__try_resume_setup( 62 62 struct __cfaabi_ehm__try_resume_node * node, 63 _Bool (*handler)(exception * except));63 _Bool (*handler)(exception_t * except)); 64 64 void __cfaabi_ehm__try_resume_cleanup( 65 65 struct __cfaabi_ehm__try_resume_node * node); -
src/libcfa/stdhdr/math.h
rd8548e2 r566b74f 10 10 // Created On : Mon Jul 4 23:25:26 2016 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Jul 5 20:38:18 201613 // Update Count : 1 212 // Last Modified On : Thu Feb 22 18:16:07 2018 13 // Update Count : 13 14 14 // 15 15 16 16 extern "C" { 17 #if ! defined( exception ) // nesting ? 18 #define exception `exception` // make keyword an identifier 19 #define __CFA_MATH_H__ 20 #endif 21 17 22 #include_next <math.h> // has internal check for multiple expansion 23 24 #if defined( exception ) && defined( __CFA_MATH_H__ ) // reset only if set 25 #undef exception 26 #undef __CFA_MATH_H__ 27 #endif 18 28 } // extern "C" 19 29
Note: See TracChangeset
for help on using the changeset viewer.