Changes in / [8217e8f:bd46af4]
- Location:
- src
- Files:
-
- 1 deleted
- 120 edited
-
CodeGen/CodeGenerator.cc (modified) (6 diffs)
-
CodeGen/CodeGenerator.h (modified) (1 diff)
-
CodeGen/GenType.cc (modified) (2 diffs)
-
CodeGen/OperatorTable.cc (modified) (2 diffs)
-
CodeGen/OperatorTable.h (modified) (2 diffs)
-
Common/PassVisitor.h (modified) (2 diffs)
-
Common/PassVisitor.impl.h (modified) (2 diffs)
-
Common/utility.h (modified) (2 diffs)
-
Concurrency/Keywords.cc (modified) (4 diffs)
-
GenPoly/Box.cc (modified) (11 diffs)
-
GenPoly/Lvalue.cc (modified) (5 diffs)
-
GenPoly/Lvalue.h (modified) (1 diff)
-
GenPoly/Specialize.cc (modified) (1 diff)
-
InitTweak/FixInit.cc (modified) (14 diffs)
-
InitTweak/GenInit.cc (modified) (5 diffs)
-
InitTweak/InitTweak.cc (modified) (4 diffs)
-
InitTweak/InitTweak.h (modified) (1 diff)
-
Makefile.in (modified) (5 diffs)
-
Parser/DeclarationNode.cc (modified) (3 diffs)
-
Parser/ExpressionNode.cc (modified) (2 diffs)
-
Parser/ParseNode.h (modified) (1 diff)
-
Parser/TypeData.cc (modified) (7 diffs)
-
Parser/TypeData.h (modified) (2 diffs)
-
Parser/lex.ll (modified) (1 diff)
-
Parser/parser.yy (modified) (14 diffs)
-
ResolvExpr/Alternative.cc (modified) (2 diffs)
-
ResolvExpr/Alternative.h (modified) (1 diff)
-
ResolvExpr/AlternativeFinder.cc (modified) (26 diffs)
-
ResolvExpr/CastCost.cc (modified) (6 diffs)
-
ResolvExpr/CommonType.cc (modified) (7 diffs)
-
ResolvExpr/ConversionCost.cc (modified) (11 diffs)
-
ResolvExpr/ConversionCost.h (modified) (4 diffs)
-
ResolvExpr/Cost.h (modified) (4 diffs)
-
ResolvExpr/Unify.cc (modified) (4 diffs)
-
ResolvExpr/typeops.h (modified) (1 diff)
-
SymTab/Autogen.cc (modified) (19 diffs)
-
SymTab/Autogen.h (modified) (3 diffs)
-
SymTab/Indexer.cc (modified) (4 diffs)
-
SymTab/Mangler.cc (modified) (2 diffs)
-
SymTab/Mangler.h (modified) (1 diff)
-
SymTab/Validate.cc (modified) (6 diffs)
-
SynTree/AddressExpr.cc (modified) (1 diff)
-
SynTree/ApplicationExpr.cc (modified) (1 diff)
-
SynTree/Expression.cc (modified) (7 diffs)
-
SynTree/Expression.h (modified) (1 diff)
-
SynTree/Mutator.cc (modified) (1 diff)
-
SynTree/Mutator.h (modified) (1 diff)
-
SynTree/ReferenceType.cc (deleted)
-
SynTree/SynTree.h (modified) (1 diff)
-
SynTree/Type.cc (modified) (2 diffs)
-
SynTree/Type.h (modified) (3 diffs)
-
SynTree/TypeExpr.cc (modified) (1 diff)
-
SynTree/Visitor.cc (modified) (2 diffs)
-
SynTree/Visitor.h (modified) (1 diff)
-
SynTree/module.mk (modified) (1 diff)
-
Tuples/Explode.h (modified) (2 diffs)
-
Tuples/TupleAssignment.cc (modified) (8 diffs)
-
libcfa/concurrency/alarm.c (modified) (2 diffs)
-
libcfa/concurrency/alarm.h (modified) (3 diffs)
-
libcfa/concurrency/coroutine (modified) (4 diffs)
-
libcfa/concurrency/coroutine.c (modified) (1 diff)
-
libcfa/concurrency/invoke.h (modified) (1 diff)
-
libcfa/concurrency/kernel (modified) (4 diffs)
-
libcfa/concurrency/kernel.c (modified) (13 diffs)
-
libcfa/concurrency/monitor (modified) (4 diffs)
-
libcfa/concurrency/monitor.c (modified) (5 diffs)
-
libcfa/concurrency/preemption.c (modified) (3 diffs)
-
libcfa/concurrency/preemption.h (modified) (1 diff)
-
libcfa/concurrency/thread (modified) (3 diffs)
-
libcfa/concurrency/thread.c (modified) (3 diffs)
-
libcfa/containers/maybe (modified) (1 diff)
-
libcfa/containers/maybe.c (modified) (3 diffs)
-
libcfa/containers/result (modified) (1 diff)
-
libcfa/containers/result.c (modified) (3 diffs)
-
libcfa/containers/vector (modified) (2 diffs)
-
libcfa/containers/vector.c (modified) (6 diffs)
-
libcfa/fstream (modified) (1 diff)
-
libcfa/fstream.c (modified) (2 diffs)
-
libcfa/gmp (modified) (11 diffs)
-
libcfa/interpose.c (modified) (3 diffs)
-
libcfa/iterator (modified) (2 diffs)
-
libcfa/rational (modified) (4 diffs)
-
libcfa/rational.c (modified) (4 diffs)
-
libcfa/stdlib (modified) (2 diffs)
-
libcfa/stdlib.c (modified) (3 diffs)
-
prelude/builtins.c (modified) (1 diff)
-
prelude/prelude.cf (modified) (5 diffs)
-
tests/.expect/64/KRfunctions.txt (modified) (2 diffs)
-
tests/.expect/64/attributes.txt (modified) (6 diffs)
-
tests/.expect/64/declarationSpecifier.txt (modified) (25 diffs)
-
tests/.expect/64/extension.txt (modified) (4 diffs)
-
tests/.expect/64/gccExtensions.txt (modified) (5 diffs)
-
tests/.expect/castError.txt (modified) (3 diffs)
-
tests/.expect/memberCtors-ERR1.txt (modified) (1 diff)
-
tests/.expect/memberCtors.txt (modified) (7 diffs)
-
tests/alloc.c (modified) (19 diffs)
-
tests/avltree/avl.h (modified) (2 diffs)
-
tests/avltree/avl1.c (modified) (2 diffs)
-
tests/coroutine.c (modified) (4 diffs)
-
tests/dtor-early-exit.c (modified) (1 diff)
-
tests/globals.c (modified) (7 diffs)
-
tests/init_once.c (modified) (2 diffs)
-
tests/memberCtors.c (modified) (3 diffs)
-
tests/monitor.c (modified) (2 diffs)
-
tests/multi-monitor.c (modified) (2 diffs)
-
tests/multiDimension.c (modified) (1 diff)
-
tests/operators.c (modified) (1 diff)
-
tests/preempt.c (modified) (1 diff)
-
tests/rational.c (modified) (3 diffs)
-
tests/sched-int-barge.c (modified) (4 diffs)
-
tests/sched-int-block.c (modified) (5 diffs)
-
tests/sched-int-disjoint.c (modified) (5 diffs)
-
tests/sched-int-wait.c (modified) (7 diffs)
-
tests/test.py (modified) (1 diff)
-
tests/thread.c (modified) (2 diffs)
-
tests/tupleAssign.c (modified) (1 diff)
-
tests/tupleMember.c (modified) (1 diff)
-
tests/tupleVariadic.c (modified) (2 diffs)
-
tests/vector/array.h (modified) (1 diff)
-
tests/vector/vector_int.c (modified) (2 diffs)
-
tests/vector/vector_int.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r8217e8f rbd46af4 182 182 genCommaList( aggDecl->get_parameters().begin(), aggDecl->get_parameters().end() ); 183 183 output << ")" << endl; 184 output << indent;185 184 } 186 185 … … 322 321 void CodeGenerator::visit( __attribute__((unused)) ConstructorInit * init ){ 323 322 assertf( ! genC, "ConstructorInit nodes should not reach code generation." ); 324 // pseudo-output for constructor/destructor pairs 325 output << "<ctorinit>{" << std::endl << ++indent << "ctor: "; 326 maybeAccept( init->get_ctor(), *this ); 327 output << ", " << std::endl << indent << "dtor: "; 328 maybeAccept( init->get_dtor(), *this ); 329 output << std::endl << --indent << "}"; 323 // xxx - generate something reasonable for constructor/destructor pairs 324 output << "<ctorinit>"; 330 325 } 331 326 … … 341 336 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) { 342 337 std::list< Expression* >::iterator arg = applicationExpr->get_args().begin(); 338 switch ( opInfo.type ) { 339 case OT_PREFIXASSIGN: 340 case OT_POSTFIXASSIGN: 341 case OT_INFIXASSIGN: 342 case OT_CTOR: 343 case OT_DTOR: 344 { 345 assert( arg != applicationExpr->get_args().end() ); 346 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( *arg ) ) { 347 // remove & from first assignment/ctor argument 348 *arg = addrExpr->get_arg(); 349 } else { 350 // no address-of operator, so must be a pointer - add dereference 351 // NOTE: if the assertion starts to trigger, check that the application expr isn't being shared. 352 // Since its arguments are modified here, this assertion most commonly triggers when the application 353 // is visited multiple times. 354 UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) ); 355 newExpr->get_args().push_back( *arg ); 356 Type * type = InitTweak::getPointerBase( (*arg)->get_result() ); 357 assertf( type, "First argument to a derefence must be a pointer. Ensure that expressions are not being shared." ); 358 newExpr->set_result( type->clone() ); 359 *arg = newExpr; 360 } // if 361 break; 362 } 363 364 default: 365 // do nothing 366 ; 367 } // switch 368 343 369 switch ( opInfo.type ) { 344 370 case OT_INDEX: … … 669 695 extension( commaExpr ); 670 696 output << "("; 671 if ( genC ) {672 // arg1 of a CommaExpr is never used, so it can be safely cast to void to reduce gcc warnings.673 commaExpr->set_arg1( new CastExpr( commaExpr->get_arg1() ) );674 }675 697 commaExpr->get_arg1()->accept( *this ); 676 698 output << " , "; … … 736 758 for ( Statement * stmt : stmts ) { 737 759 output << lineDirective( stmt ) << indent; 738 output << printLabels( stmt->get_labels() );760 output << printLabels( stmt->get_labels() ); 739 761 if ( i+1 == numStmts ) { 740 762 // last statement in a statement expression needs to be handled specially - … … 781 803 void CodeGenerator::visit( ExprStmt * exprStmt ) { 782 804 assert( exprStmt ); 805 Expression * expr = exprStmt->get_expr(); 783 806 if ( genC ) { 784 807 // cast the top-level expression to void to reduce gcc warnings. 785 expr Stmt->set_expr( new CastExpr( exprStmt->get_expr() ));808 expr = new CastExpr( expr ); 786 809 } 787 expr Stmt->get_expr()->accept( *this );810 expr->accept( *this ); 788 811 output << ";"; 789 812 } -
src/CodeGen/CodeGenerator.h
r8217e8f rbd46af4 19 19 #include <ostream> // for ostream, operator<< 20 20 #include <string> // for string 21 22 #include "Common/Indenter.h" // for Indenter23 21 24 22 #include "SynTree/Declaration.h" // for DeclarationWithType (ptr only), Fun... -
src/CodeGen/GenType.cc
r8217e8f rbd46af4 37 37 virtual void visit( PointerType *pointerType ); 38 38 virtual void visit( ArrayType *arrayType ); 39 virtual void visit( ReferenceType *refType );40 39 virtual void visit( StructInstType *structInst ); 41 40 virtual void visit( UnionInstType *unionInst ); … … 148 147 } 149 148 150 void GenType::visit( ReferenceType *refType ) {151 assert( refType->get_base() != 0);152 assertf( ! genC, "Reference types should not reach code generation." );153 handleQualifiers( refType );154 typeString = "&" + typeString;155 refType->get_base()->accept( *this );156 }157 158 149 void GenType::visit( FunctionType *funcType ) { 159 150 std::ostringstream os; -
src/CodeGen/OperatorTable.cc
r8217e8f rbd46af4 14 14 // 15 15 16 #include <algorithm> // for any_of 17 #include <map> // for map, _Rb_tree_const_iterator, map<>::const_iterator 18 #include <utility> // for pair 16 #include <map> // for map, _Rb_tree_const_iterator, map<>::const_iterator 17 #include <utility> // for pair 19 18 20 19 #include "OperatorTable.h" … … 94 93 } // if 95 94 } 96 97 /// determines if a given function name is one of the operator types between [begin, end)98 template<typename Iterator>99 bool isOperatorType( const std::string & funcName, Iterator begin, Iterator end ) {100 OperatorInfo info;101 if ( operatorLookup( funcName, info ) ) {102 return std::find( begin, end, info.type ) != end;103 }104 return false;105 }106 107 bool isConstructor( const std::string & funcName ) {108 static OperatorType types[] = { OT_CTOR };109 return isOperatorType( funcName, std::begin(types), std::end(types) );110 }111 112 bool isDestructor( const std::string & funcName ) {113 static OperatorType types[] = { OT_DTOR };114 return isOperatorType( funcName, std::begin(types), std::end(types) );115 }116 117 bool isAssignment( const std::string & funcName ) {118 static OperatorType types[] = { OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };119 return isOperatorType( funcName, std::begin(types), std::end(types) );120 }121 122 bool isCtorDtor( const std::string & funcName ) {123 static OperatorType types[] = { OT_CTOR, OT_DTOR };124 return isOperatorType( funcName, std::begin(types), std::end(types) );125 }126 127 bool isCtorDtorAssign( const std::string & funcName ) {128 static OperatorType types[] = { OT_CTOR, OT_DTOR, OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };129 return isOperatorType( funcName, std::begin(types), std::end(types) );130 }131 95 } // namespace CodeGen 132 96 -
src/CodeGen/OperatorTable.h
r8217e8f rbd46af4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // OperatorTable.h -- 7 // OperatorTable.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 42 42 43 43 bool operatorLookup( std::string funcName, OperatorInfo &info ); 44 45 bool isConstructor( const std::string & );46 bool isDestructor( const std::string & );47 bool isAssignment( const std::string & );48 bool isCtorDtor( const std::string & );49 bool isCtorDtorAssign( const std::string & );50 44 } // namespace CodeGen 51 45 -
src/Common/PassVisitor.h
r8217e8f rbd46af4 114 114 virtual void visit( PointerType *pointerType ) override final; 115 115 virtual void visit( ArrayType *arrayType ) override final; 116 virtual void visit( ReferenceType *referenceType ) override final;117 116 virtual void visit( FunctionType *functionType ) override final; 118 117 virtual void visit( StructInstType *aggregateUseType ) override final; … … 201 200 virtual Type* mutate( PointerType *pointerType ) override final; 202 201 virtual Type* mutate( ArrayType *arrayType ) override final; 203 virtual Type* mutate( ReferenceType *referenceType ) override final;204 202 virtual Type* mutate( FunctionType *functionType ) override final; 205 203 virtual Type* mutate( StructInstType *aggregateUseType ) override final; -
src/Common/PassVisitor.impl.h
r8217e8f rbd46af4 792 792 793 793 template< typename pass_type > 794 void PassVisitor< pass_type >::visit( ReferenceType * node ) {795 VISIT_BODY( node );796 }797 798 template< typename pass_type >799 794 void PassVisitor< pass_type >::visit( FunctionType * node ) { 800 795 VISIT_BODY( node ); … … 1134 1129 1135 1130 template< typename pass_type > 1136 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {1137 MUTATE_BODY( Type, node );1138 }1139 1140 template< typename pass_type >1141 1131 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 1142 1132 MUTATE_BODY( Type, node ); -
src/Common/utility.h
r8217e8f rbd46af4 309 309 template< typename T1, typename T2 > 310 310 struct group_iterate_t { 311 group_iterate_t( bool skipBoundsCheck,const T1 & v1, const T2 & v2 ) : args(v1, v2) {312 assertf( skipBoundsCheck || v1.size() == v2.size(), "group iteration requires containers of the same size: <%lu, %lu>.", v1.size(), v2.size());311 group_iterate_t( const T1 & v1, const T2 & v2 ) : args(v1, v2) { 312 assertf(v1.size() == v2.size(), "group iteration requires containers of the same size."); 313 313 }; 314 314 … … 335 335 }; 336 336 337 /// performs bounds check to ensure that all arguments are of the same length.338 337 template< typename... Args > 339 338 group_iterate_t<Args...> group_iterate( Args &&... args ) { 340 return group_iterate_t<Args...>(false, std::forward<Args>( args )...); 341 } 342 343 /// does not perform a bounds check - requires user to ensure that iteration terminates when appropriate. 344 template< typename... Args > 345 group_iterate_t<Args...> unsafe_group_iterate( Args &&... args ) { 346 return group_iterate_t<Args...>(true, std::forward<Args>( args )...); 339 return group_iterate_t<Args...>(std::forward<Args>( args )...); 347 340 } 348 341 -
src/Concurrency/Keywords.cc
r8217e8f rbd46af4 21 21 #include "Common/SemanticError.h" // for SemanticError 22 22 #include "Common/utility.h" // for deleteAll, map_range 23 #include "CodeGen/OperatorTable.h" // for isConstructor 24 #include "InitTweak/InitTweak.h" // for getPointerBase 23 #include "InitTweak/InitTweak.h" // for isConstructor 25 24 #include "Parser/LinkageSpec.h" // for Cforall 26 25 #include "SymTab/AddVisit.h" // for acceptAndAdd … … 290 289 LinkageSpec::Cforall, 291 290 nullptr, 292 new ReferenceType(291 new PointerType( 293 292 noQualifiers, 294 293 new StructInstType( … … 446 445 447 446 //Makes sure it's not a copy 448 ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );449 if( ! rty ) throw SemanticError( "Mutex argument must be ofreference type ", arg );447 PointerType* pty = dynamic_cast< PointerType * >( ty ); 448 if( ! pty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg ); 450 449 451 450 //Make sure the we are pointing directly to a type 452 Type* base = rty->get_base(); 453 if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg ); 454 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg ); 451 Type* base = pty->get_base(); 452 if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg ); 455 453 456 454 //Make sure that typed isn't mutex … … 522 520 Visitor::visit(decl); 523 521 524 if( ! CodeGen::isConstructor(decl->get_name()) ) return;522 if( ! InitTweak::isConstructor(decl->get_name()) ) return; 525 523 526 524 DeclarationWithType * param = decl->get_functionType()->get_parameters().front(); 527 auto type = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) ); 525 auto ptr = dynamic_cast< PointerType * >( param->get_type() ); 526 // if( ptr ) std::cerr << "FRED1" << std::endl; 527 auto type = dynamic_cast< StructInstType * >( ptr->get_base() ); 528 528 // if( type ) std::cerr << "FRED2" << std::endl; 529 529 if( type && type->get_baseStruct()->is_thread() ) { -
src/GenPoly/Box.cc
r8217e8f rbd46af4 56 56 #include "Common/UniqueName.h" 57 57 #include "Common/utility.h" 58 59 #include "CodeGen/OperatorTable.h"60 58 61 59 #include "InitTweak/InitTweak.h" … … 572 570 // To compound the issue, the right side can be *x, etc. because of lvalue-returning functions 573 571 if ( UntypedExpr * assign = dynamic_cast< UntypedExpr * >( commaExpr->get_arg1() ) ) { 574 if ( CodeGen::isAssignment( InitTweak::getFunctionName( assign ) ) ) {572 if ( InitTweak::isAssignment( InitTweak::getFunctionName( assign ) ) ) { 575 573 assert( assign->get_args().size() == 2 ); 576 574 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( assign->get_args().back() ) ) { … … 612 610 } 613 611 } else { 614 throw SemanticError( "Cannot pass non-struct type for generic struct : ", argBaseType);612 throw SemanticError( "Cannot pass non-struct type for generic struct" ); 615 613 } 616 614 } … … 1027 1025 } // if 1028 1026 if ( baseType1 || baseType2 ) { 1029 delete ret->get_result();1030 1027 ret->set_result( appExpr->get_result()->clone() ); 1031 1028 if ( appExpr->get_env() ) { … … 1041 1038 assert( ! appExpr->get_args().empty() ); 1042 1039 if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) { 1043 // remove dereference from polymorphic types since they are boxed.1044 1040 Expression *ret = appExpr->get_args().front(); 1045 // fix expr type to remove pointer1046 1041 delete ret->get_result(); 1047 1042 ret->set_result( appExpr->get_result()->clone() ); … … 1133 1128 1134 1129 assert( appExpr->get_function()->has_result() ); 1135 FunctionType * function = getFunctionType( appExpr->get_function()->get_result() );1136 assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->get_function()->get_result() ).c_str() );1130 PointerType *pointer = safe_dynamic_cast< PointerType *>( appExpr->get_function()->get_result() ); 1131 FunctionType *function = safe_dynamic_cast< FunctionType *>( pointer->get_base() ); 1137 1132 1138 1133 if ( Expression *newExpr = handleIntrinsics( appExpr ) ) { … … 1211 1206 if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->get_args().front() ) ) { 1212 1207 assert( appExpr->get_function()->has_result() ); 1213 FunctionType *function = getFunctionType( appExpr->get_function()->get_result() );1214 assert( function);1208 PointerType *pointer = safe_dynamic_cast< PointerType *>( appExpr->get_function()->get_result() ); 1209 FunctionType *function = safe_dynamic_cast< FunctionType *>( pointer->get_base() ); 1215 1210 needs = needsAdapter( function, scopeTyVars ); 1216 1211 } // if … … 1221 1216 // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward 1222 1217 // out of the if condition. 1218 bool polytype = isPolyType( addrExpr->get_arg()->get_result(), scopeTyVars, env ); 1223 1219 addrExpr->set_arg( mutateExpression( addrExpr->get_arg() ) ); 1224 // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment1225 bool polytype = isPolyType( addrExpr->get_arg()->get_result(), scopeTyVars, env );1226 1220 if ( polytype || needs ) { 1227 1221 Expression *ret = addrExpr->get_arg(); … … 1290 1284 if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) { 1291 1285 std::string adapterName = makeAdapterName( mangleName ); 1292 // adapter may not be used in body, pass along with unused attribute. 1293 paramList.push_front( new ObjectDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0, { new Attribute( "unused" ) } ) ); 1286 paramList.push_front( new ObjectDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) ); 1294 1287 adaptersDone.insert( adaptersDone.begin(), mangleName ); 1295 1288 } … … 1397 1390 std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin(); 1398 1391 std::list< DeclarationWithType *> inferredParams; 1399 // size/align/offset parameters may not be used in body, pass along with unused attribute. 1400 ObjectDecl newObj( "", Type::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0, 1401 { new Attribute( "unused" ) } ); 1392 ObjectDecl newObj( "", Type::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 ); 1402 1393 ObjectDecl newPtr( "", Type::StorageClasses(), LinkageSpec::C, 0, 1403 1394 new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 ); … … 1422 1413 for ( std::list< DeclarationWithType *>::iterator assert = (*tyParm)->get_assertions().begin(); assert != (*tyParm)->get_assertions().end(); ++assert ) { 1423 1414 // *assert = (*assert)->acceptMutator( *this ); 1424 // assertion parameters may not be used in body, pass along with unused attribute.1425 (*assert)->get_attributes().push_back( new Attribute( "unused" ) );1426 1415 inferredParams.push_back( *assert ); 1427 1416 } -
src/GenPoly/Lvalue.cc
r8217e8f rbd46af4 27 27 #include "SynTree/Mutator.h" 28 28 #include "SymTab/Indexer.h" 29 #include "SymTab/Autogen.h"30 29 31 30 #include "ResolvExpr/Resolver.h" … … 36 35 #include "Common/UniqueName.h" 37 36 #include "Common/utility.h" 38 #include "Common/PassVisitor.h"39 40 #include "InitTweak/InitTweak.h"41 42 #if 043 #define PRINT(x) x44 #else45 #define PRINT(x)46 #endif47 37 48 38 namespace GenPoly { 49 39 namespace { 50 // TODO: fold this into the general createDeref function?? 51 Expression * mkDeref( Expression * arg ) { 52 if ( SymTab::dereferenceOperator ) { 53 VariableExpr * deref = new VariableExpr( SymTab::dereferenceOperator ); 54 deref->set_result( new PointerType( Type::Qualifiers(), deref->get_result() ) ); 55 Type * base = InitTweak::getPointerBase( arg->get_result() ); 56 assertf( base, "expected pointer type in dereference (type was %s)", toString( arg->get_result() ).c_str() ); 57 ApplicationExpr * ret = new ApplicationExpr( deref, { arg } ); 58 delete ret->get_result(); 59 ret->set_result( base->clone() ); 60 ret->get_result()->set_lvalue( true ); 61 return ret; 62 } else { 63 return UntypedExpr::createDeref( arg ); 64 } 65 } 66 67 struct ReferenceConversions final { 68 Expression * postmutate( CastExpr * castExpr ); 69 Expression * postmutate( AddressExpr * addrExpr ); 40 /// Replace uses of lvalue returns with appropriate pointers 41 class Pass1 : public Mutator { 42 public: 43 Pass1(); 44 45 virtual Expression *mutate( ApplicationExpr *appExpr ); 46 virtual Statement *mutate( ReturnStmt *appExpr ); 47 virtual DeclarationWithType *mutate( FunctionDecl *funDecl ); 48 private: 49 DeclarationWithType* retval; 70 50 }; 71 51 72 /// Intrinsic functions that take reference parameters don't REALLY take reference parameters -- their reference arguments must always be implicitly dereferenced. 73 struct FixIntrinsicArgs final { 74 Expression * postmutate( ApplicationExpr * appExpr ); 75 }; 76 77 struct FixIntrinsicResult final { 78 Expression * postmutate( ApplicationExpr * appExpr ); 79 }; 80 81 /// Replace reference types with pointer types 82 struct ReferenceTypeElimination final { 83 Type * postmutate( ReferenceType * refType ); 52 /// Replace declarations of lvalue returns with appropriate pointers 53 class Pass2 : public Visitor { 54 public: 55 virtual void visit( FunctionType *funType ); 56 private: 84 57 }; 85 58 … … 87 60 /// https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Lvalues.html#Lvalues 88 61 /// Replaces &(a,b) with (a, &b), &(a ? b : c) with (a ? &b : &c) 89 struct GeneralizedLvalue final : public WithVisitorRef<GeneralizedLvalue> { 90 Expression * postmutate( AddressExpr * addressExpr ); 91 Expression * postmutate( MemberExpr * memExpr ); 62 class GeneralizedLvalue : public Mutator { 63 typedef Mutator Parent; 64 65 virtual Expression * mutate( MemberExpr * memExpr ); 66 virtual Expression * mutate( AddressExpr * addressExpr ); 92 67 93 68 template<typename Func> 94 69 Expression * applyTransformation( Expression * expr, Expression * arg, Func mkExpr ); 95 70 }; 96 97 /// Removes redundant &*/*& pattern that this pass can generate98 struct CollapseAddrDeref final {99 Expression * postmutate( AddressExpr * addressExpr );100 Expression * postmutate( ApplicationExpr * appExpr );101 };102 103 struct AddrRef final : public WithGuards {104 void premutate( AddressExpr * addrExpr );105 Expression * postmutate( AddressExpr * addrExpr );106 void premutate( Expression * expr );107 108 bool first = true;109 bool current = false;110 int refDepth = 0;111 };112 71 } // namespace 113 72 114 static bool referencesEliminated = false; 115 // used by UntypedExpr::createDeref to determine whether result type of dereference should be ReferenceType or value type. 116 bool referencesPermissable() { 117 return ! referencesEliminated; 73 void convertLvalue( std::list< Declaration* >& translationUnit ) { 74 Pass1 p1; 75 Pass2 p2; 76 GeneralizedLvalue genLval; 77 mutateAll( translationUnit, p1 ); 78 acceptAll( translationUnit, p2 ); 79 mutateAll( translationUnit, genLval ); 118 80 } 119 81 120 void convertLvalue( std::list< Declaration* >& translationUnit ) {121 std::cerr << "convertLvalue" << std::endl;122 PassVisitor<ReferenceConversions> refCvt;123 PassVisitor<ReferenceTypeElimination> elim;124 PassVisitor<GeneralizedLvalue> genLval;125 PassVisitor<FixIntrinsicArgs> fixer;126 PassVisitor<CollapseAddrDeref> collapser;127 PassVisitor<AddrRef> addrRef;128 PassVisitor<FixIntrinsicResult> intrinsicResults;129 mutateAll( translationUnit, intrinsicResults );130 mutateAll( translationUnit, addrRef );131 mutateAll( translationUnit, refCvt );132 mutateAll( translationUnit, fixer );133 mutateAll( translationUnit, collapser );134 mutateAll( translationUnit, genLval );135 mutateAll( translationUnit, elim ); // last because other passes need reference types to work136 137 // from this point forward, no other pass should create reference types.138 referencesEliminated = true;139 }140 141 82 Expression * generalizedLvalue( Expression * expr ) { 142 PassVisitor<GeneralizedLvalue>genLval;83 GeneralizedLvalue genLval; 143 84 return expr->acceptMutator( genLval ); 144 85 } 145 86 146 87 namespace { 147 // true for intrinsic function calls that return a reference 148 bool isIntrinsicReference( Expression * expr ) { 149 if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( expr ) ) { 150 std::string fname = InitTweak::getFunctionName( untyped ); 151 // known intrinsic-reference prelude functions 152 return fname == "*?" || fname == "?[?]"; 153 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) { 154 if ( DeclarationWithType * func = InitTweak::getFunction( appExpr ) ) { 155 // use type of return variable rather than expr result type, since it may have been changed to a pointer type 156 FunctionType * ftype = GenPoly::getFunctionType( func->get_type() ); 157 Type * ret = ftype->get_returnVals().empty() ? nullptr : ftype->get_returnVals().front()->get_type(); 158 return func->get_linkage() == LinkageSpec::Intrinsic && dynamic_cast<ReferenceType *>( ret ); 88 Type* isLvalueRet( FunctionType *function ) { 89 if ( function->get_returnVals().empty() ) return 0; 90 Type *ty = function->get_returnVals().front()->get_type(); 91 return ty->get_lvalue() ? ty : 0; 92 } 93 94 bool isIntrinsicApp( ApplicationExpr *appExpr ) { 95 if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( appExpr->get_function() ) ) { 96 return varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic; 97 } else { 98 return false; 99 } // if 100 } 101 102 Pass1::Pass1() { 103 } 104 105 DeclarationWithType * Pass1::mutate( FunctionDecl *funcDecl ) { 106 if ( funcDecl->get_statements() ) { 107 DeclarationWithType* oldRetval = retval; 108 retval = 0; 109 if ( ! LinkageSpec::isBuiltin( funcDecl->get_linkage() ) && isLvalueRet( funcDecl->get_functionType() ) ) { 110 retval = funcDecl->get_functionType()->get_returnVals().front(); 159 111 } 160 } 161 return false; 162 } 163 164 Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) { 165 if ( isIntrinsicReference( appExpr ) ) { 166 // eliminate reference types from intrinsic applications - now they return lvalues 167 Type * result = appExpr->get_result(); 168 appExpr->set_result( result->stripReferences()->clone() ); 169 appExpr->get_result()->set_lvalue( true ); 170 Expression * ret = new CastExpr( appExpr, result ); 171 ret->set_env( appExpr->get_env() ); 172 appExpr->set_env( nullptr ); 173 return ret; 174 } 175 return appExpr; 176 } 177 178 Expression * FixIntrinsicArgs::postmutate( ApplicationExpr * appExpr ) { 179 // intrinsic functions don't really take reference-typed parameters, so they require an implicit dereference on their arguments. 180 if ( DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) { 181 FunctionType * ftype = GenPoly::getFunctionType( function->get_type() ); 182 assertf( ftype, "Function declaration does not have function type." ); 183 // can be of differing lengths only when function is variadic 184 assertf( ftype->get_parameters().size() == appExpr->get_args().size() || ftype->get_isVarArgs(), "ApplicationExpr args do not match formal parameter type." ); 185 186 187 unsigned int i = 0; 188 const unsigned int end = ftype->get_parameters().size(); 189 for ( auto p : unsafe_group_iterate( appExpr->get_args(), ftype->get_parameters() ) ) { 190 if (i == end) break; 191 Expression *& arg = std::get<0>( p ); 192 Type * formal = std::get<1>( p )->get_type(); 193 PRINT( 194 std::cerr << "pair<0>: " << arg << std::endl; 195 std::cerr << "pair<1>: " << formal << std::endl; 196 ) 197 if ( dynamic_cast<ReferenceType*>( formal ) ) { 198 if ( isIntrinsicReference( arg ) ) { // do not combine conditions, because that changes the meaning of the else if 199 if ( function->get_linkage() != LinkageSpec::Intrinsic ) { // intrinsic functions that turn pointers into references 200 // if argument is dereference or array subscript, the result isn't REALLY a reference, so it's not necessary to fix the argument 201 PRINT( 202 std::cerr << "===is intrinsic arg in non-intrinsic call - adding address" << std::endl; 203 ) 204 arg = new AddressExpr( arg ); 205 } 206 } else if ( function->get_linkage() == LinkageSpec::Intrinsic ) { 207 // std::cerr << "===adding deref to arg" << std::endl; 208 // if the parameter is a reference, add a dereference to the reference-typed argument. 209 Type * baseType = InitTweak::getPointerBase( arg->get_result() ); 210 assertf( baseType, "parameter is reference, arg must be pointer or reference: %s", toString( arg->get_result() ).c_str() ); 211 PointerType * ptrType = new PointerType( Type::Qualifiers(), baseType->clone() ); 212 delete arg->get_result(); 213 arg->set_result( ptrType ); 214 arg = mkDeref( arg ); 215 } 216 } 217 ++i; 112 // fix expressions and return statements in this function 113 funcDecl->set_statements( funcDecl->get_statements()->acceptMutator( *this ) ); 114 retval = oldRetval; 115 } // if 116 return funcDecl; 117 } 118 119 Expression * Pass1::mutate( ApplicationExpr *appExpr ) { 120 appExpr->get_function()->acceptMutator( *this ); 121 mutateAll( appExpr->get_args(), *this ); 122 123 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() ); 124 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 125 126 Type *funType = isLvalueRet( function ); 127 if ( funType && ! isIntrinsicApp( appExpr ) ) { 128 Expression *expr = appExpr; 129 Type *appType = appExpr->get_result(); 130 if ( isPolyType( funType ) && ! isPolyType( appType ) ) { 131 // make sure cast for polymorphic type is inside dereference 132 expr = new CastExpr( appExpr, new PointerType( Type::Qualifiers(), appType->clone() ) ); 218 133 } 219 } 220 return appExpr; 221 } 222 223 // idea: &&&E: get outer &, inner & 224 // at inner &, record depth D of reference type 225 // at outer &, add D derefs. 226 void AddrRef::premutate( Expression * expr ) { 227 GuardValue( current ); 228 GuardValue( first ); 229 current = false; 230 first = true; 231 } 232 233 void AddrRef::premutate( AddressExpr * addrExpr ) { 234 GuardValue( current ); 235 GuardValue( first ); 236 current = first; 237 first = false; 238 if ( current ) { 239 GuardValue( refDepth ); 240 refDepth = 0; 241 } 242 } 243 244 Expression * AddrRef::postmutate( AddressExpr * addrExpr ) { 245 if ( refDepth == 0 ) { 246 if ( ! isIntrinsicReference( addrExpr->get_arg() ) ) { 247 // try to avoid ?[?] 248 refDepth = addrExpr->get_arg()->get_result()->referenceDepth(); 249 } 250 } 251 if ( current ) { 252 Expression * ret = addrExpr; 253 while ( refDepth ) { 254 ret = mkDeref( ret ); 255 refDepth--; 256 } 257 return ret; 258 } 259 return addrExpr; 260 } 261 262 Expression * ReferenceConversions::postmutate( AddressExpr * addrExpr ) { 263 // Inner expression may have been lvalue to reference conversion, which becomes an address expression. 264 // In this case, remove the outer address expression and return the argument. 265 // TODO: It's possible that this might catch too much and require a more sophisticated check. 266 return addrExpr; 267 } 268 269 Expression * ReferenceConversions::postmutate( CastExpr * castExpr ) { 270 // xxx - is it possible to convert directly between reference types with a different base? E.g., 271 // int x; 272 // (double&)x; 273 // At the moment, I am working off of the assumption that this is illegal, thus the cast becomes redundant 274 // after this pass, so trash the cast altogether. If that changes, care must be taken to insert the correct 275 // pointer casts in the right places. 276 277 // conversion to reference type 278 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_result() ) ) { 279 (void)refType; 280 if ( ReferenceType * otherRef = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 281 // nothing to do if casting from reference to reference. 282 (void)otherRef; 283 PRINT( std::cerr << "convert reference to reference -- nop" << std::endl; ) 284 if ( isIntrinsicReference( castExpr->get_arg() ) ) { 285 Expression * callExpr = castExpr->get_arg(); 286 PRINT( 287 std::cerr << "but arg is deref -- &" << std::endl; 288 std::cerr << callExpr << std::endl; 289 ) 290 callExpr = new AddressExpr( callExpr ); // this doesn't work properly for multiple casts 291 delete callExpr->get_result(); 292 callExpr->set_result( refType->clone() ); 293 // move environment out to new top-level 294 callExpr->set_env( castExpr->get_env() ); 295 castExpr->set_arg( nullptr ); 296 castExpr->set_env( nullptr ); 297 delete castExpr; 298 return callExpr; 299 } 300 int depth1 = refType->referenceDepth(); 301 int depth2 = otherRef->referenceDepth(); 302 assertf( depth1 == depth2, "non-intrinsic reference with cast of reference to reference not yet supported: %d %d %s", depth1, depth2, toString( castExpr ).c_str() ); 303 PRINT( std::cerr << castExpr << std::endl; ) 304 return castExpr; 305 } else if ( castExpr->get_arg()->get_result()->get_lvalue() ) { 306 // conversion from lvalue to reference 307 // xxx - keep cast, but turn into pointer cast?? 308 // xxx - memory 309 PRINT( 310 std::cerr << "convert lvalue to reference -- &" << std::endl; 311 std::cerr << castExpr->get_arg() << std::endl; 312 ) 313 AddressExpr * ret = new AddressExpr( castExpr->get_arg() ); 314 if ( refType->get_base()->get_qualifiers() != castExpr->get_arg()->get_result()->get_qualifiers() ) { 315 // must keep cast if cast-to type is different from the actual type 316 castExpr->set_arg( ret ); 317 return castExpr; 318 } 319 ret->set_env( castExpr->get_env() ); 320 delete ret->get_result(); 321 ret->set_result( castExpr->get_result() ); 322 castExpr->set_env( nullptr ); 323 castExpr->set_arg( nullptr ); 324 castExpr->set_result( nullptr ); 325 delete castExpr; 326 return ret; 134 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); 135 deref->set_result( appType->clone() ); 136 appExpr->set_result( new PointerType( Type::Qualifiers(), appType ) ); 137 deref->get_args().push_back( expr ); 138 return deref; 139 } else { 140 return appExpr; 141 } // if 142 } 143 144 Statement * Pass1::mutate(ReturnStmt *retStmt) { 145 if ( retval && retStmt->get_expr() ) { 146 if ( retStmt->get_expr()->get_result()->get_lvalue() ) { 147 // ***** Code Removal ***** because casts may be stripped already 148 149 // strip casts because not allowed to take address of cast 150 // while ( CastExpr *castExpr = dynamic_cast< CastExpr* >( retStmt->get_expr() ) ) { 151 // retStmt->set_expr( castExpr->get_arg() ); 152 // retStmt->get_expr()->set_env( castExpr->get_env() ); 153 // castExpr->set_env( 0 ); 154 // castExpr->set_arg( 0 ); 155 // delete castExpr; 156 // } // while 157 retStmt->set_expr( new AddressExpr( retStmt->get_expr()->acceptMutator( *this ) ) ); 327 158 } else { 328 // rvalue to reference conversion -- introduce temporary 329 } 330 assertf( false, "Only conversions to reference from lvalue are currently supported: %s", toString( castExpr ).c_str() ); 331 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 332 (void)refType; 333 // conversion from reference to rvalue 334 PRINT( 335 std::cerr << "convert reference to rvalue -- *" << std::endl; 336 std::cerr << "was = " << castExpr << std::endl; 337 ) 338 Expression * ret = castExpr->get_arg(); 339 TypeSubstitution * env = castExpr->get_env(); 340 castExpr->set_env( nullptr ); 341 if ( ! isIntrinsicReference( ret ) ) { 342 // dereference if not already dereferenced 343 ret = mkDeref( ret ); 344 } 345 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( castExpr->get_result(), castExpr->get_arg()->get_result()->stripReferences(), SymTab::Indexer() ) ) { 346 // can remove cast if types are compatible, changing expression type to value type 347 ret->set_result( castExpr->get_result()->clone() ); 348 castExpr->set_arg( nullptr ); 349 delete castExpr; 350 } else { 351 // must keep cast if types are different 352 castExpr->set_arg( ret ); 353 ret = castExpr; 354 } 355 ret->set_env( env ); 356 PRINT( std::cerr << "now: " << ret << std::endl; ) 357 return ret; 358 } 359 return castExpr; 360 } 361 362 Type * ReferenceTypeElimination::postmutate( ReferenceType * refType ) { 363 Type * base = refType->get_base(); 364 Type::Qualifiers qualifiers = refType->get_qualifiers(); 365 refType->set_base( nullptr ); 366 delete refType; 367 return new PointerType( qualifiers, base ); 159 throw SemanticError( "Attempt to return non-lvalue from an lvalue-qualified function" ); 160 } // if 161 } // if 162 return retStmt; 163 } 164 165 void Pass2::visit( FunctionType *funType ) { 166 std::string typeName; 167 if ( isLvalueRet( funType ) ) { 168 DeclarationWithType *retParm = funType->get_returnVals().front(); 169 170 // make a new parameter that is a pointer to the type of the old return value 171 retParm->set_type( new PointerType( Type::Qualifiers(), retParm->get_type() ) ); 172 } // if 173 174 Visitor::visit( funType ); 368 175 } 369 176 … … 373 180 Expression * arg1 = commaExpr->get_arg1()->clone(); 374 181 Expression * arg2 = commaExpr->get_arg2()->clone(); 375 Expression * ret = new CommaExpr( arg1, mkExpr( arg2 ) ->acceptMutator( *visitor ));182 Expression * ret = new CommaExpr( arg1, mkExpr( arg2 ) ); 376 183 ret->set_env( expr->get_env() ); 377 184 expr->set_env( nullptr ); 378 185 delete expr; 379 return ret ;186 return ret->acceptMutator( *this ); 380 187 } else if ( ConditionalExpr * condExpr = dynamic_cast< ConditionalExpr * >( arg ) ) { 381 188 Expression * arg1 = condExpr->get_arg1()->clone(); 382 189 Expression * arg2 = condExpr->get_arg2()->clone(); 383 190 Expression * arg3 = condExpr->get_arg3()->clone(); 384 ConditionalExpr * ret = new ConditionalExpr( arg1, mkExpr( arg2 ) ->acceptMutator( *visitor ), mkExpr( arg3 )->acceptMutator( *visitor) );191 ConditionalExpr * ret = new ConditionalExpr( arg1, mkExpr( arg2 ), mkExpr( arg3 ) ); 385 192 ret->set_env( expr->get_env() ); 386 193 expr->set_env( nullptr ); … … 395 202 unify( ret->get_arg2()->get_result(), ret->get_arg3()->get_result(), newEnv, needAssertions, haveAssertions, openVars, SymTab::Indexer(), commonType ); 396 203 ret->set_result( commonType ? commonType : ret->get_arg2()->get_result()->clone() ); 397 return ret ;204 return ret->acceptMutator( *this ); 398 205 } 399 206 return expr; 400 207 } 401 208 402 Expression * GeneralizedLvalue::postmutate( MemberExpr * memExpr ) { 209 Expression * GeneralizedLvalue::mutate( MemberExpr * memExpr ) { 210 Parent::mutate( memExpr ); 403 211 return applyTransformation( memExpr, memExpr->get_aggregate(), [=]( Expression * aggr ) { return new MemberExpr( memExpr->get_member(), aggr ); } ); 404 212 } 405 213 406 Expression * GeneralizedLvalue::postmutate( AddressExpr * addrExpr ) { 214 Expression * GeneralizedLvalue::mutate( AddressExpr * addrExpr ) { 215 addrExpr = safe_dynamic_cast< AddressExpr * >( Parent::mutate( addrExpr ) ); 407 216 return applyTransformation( addrExpr, addrExpr->get_arg(), []( Expression * arg ) { return new AddressExpr( arg ); } ); 408 }409 410 Expression * CollapseAddrDeref::postmutate( AddressExpr * addrExpr ) {411 Expression * arg = addrExpr->get_arg();412 if ( isIntrinsicReference( arg ) ) {413 std::string fname = InitTweak::getFunctionName( arg );414 if ( fname == "*?" ) {415 Expression *& arg0 = InitTweak::getCallArg( arg, 0 );416 Expression * ret = arg0;417 ret->set_env( addrExpr->get_env() );418 arg0 = nullptr;419 addrExpr->set_env( nullptr );420 delete addrExpr;421 return ret;422 }423 }424 return addrExpr;425 }426 427 Expression * CollapseAddrDeref::postmutate( ApplicationExpr * appExpr ) {428 if ( isIntrinsicReference( appExpr ) ) {429 std::string fname = InitTweak::getFunctionName( appExpr );430 if ( fname == "*?" ) {431 Expression * arg = InitTweak::getCallArg( appExpr, 0 );432 // xxx - this isn't right, because it can remove casts that should be there...433 // while ( CastExpr * castExpr = dynamic_cast< CastExpr * >( arg ) ) {434 // arg = castExpr->get_arg();435 // }436 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( arg ) ) {437 Expression * ret = addrExpr->get_arg();438 ret->set_env( appExpr->get_env() );439 addrExpr->set_arg( nullptr );440 appExpr->set_env( nullptr );441 delete appExpr;442 return ret;443 }444 }445 }446 return appExpr;447 217 } 448 218 } // namespace -
src/GenPoly/Lvalue.h
r8217e8f rbd46af4 24 24 void convertLvalue( std::list< Declaration* >& translationUnit ); 25 25 26 /// true after reference types have been eliminated from the source code. After this point, reference types should not be added to the AST.27 bool referencesPermissable();28 29 26 /// applies transformations that allow GCC to accept more complicated lvalue expressions, e.g. &(a, b) 30 27 Expression * generalizedLvalue( Expression * expr ); -
src/GenPoly/Specialize.cc
r8217e8f rbd46af4 101 101 // conversion of 0 (null) to function type does not require tuple specialization 102 102 if ( dynamic_cast< ZeroType * >( actualType ) ) return false; 103 FunctionType * aftype = getFunctionType( actualType ->stripReferences());104 assertf( aftype, "formal type is a function type, but actual type is not : %s", toString( actualType ).c_str());103 FunctionType * aftype = getFunctionType( actualType ); 104 assertf( aftype, "formal type is a function type, but actual type is not." ); 105 105 if ( fftype->get_parameters().size() != aftype->get_parameters().size() ) return true; 106 106 for ( auto params : group_iterate( fftype->get_parameters(), aftype->get_parameters() ) ) { -
src/InitTweak/FixInit.cc
r8217e8f rbd46af4 26 26 #include "FixGlobalInit.h" 27 27 #include "CodeGen/GenType.h" // for warning/error messages 28 #include "CodeGen/OperatorTable.h"29 28 #include "Common/PassVisitor.h" 30 29 #include "GenPoly/DeclMutator.h" … … 239 238 SemanticError errors; 240 239 private: 240 void handleFirstParam( Expression * firstParam ); 241 241 template< typename... Params > 242 242 void emit( CodeLocation, const Params &... params ); … … 363 363 FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->get_type() ) ); 364 364 assert( ftype ); 365 if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) {366 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type());365 if ( isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) { 366 Type * t1 = ftype->get_parameters().front()->get_type(); 367 367 Type * t2 = ftype->get_parameters().back()->get_type(); 368 assert( t1 );369 370 if ( ResolvExpr::typesCompatible( t1, t2, SymTab::Indexer() ) ) {368 PointerType * ptrType = safe_dynamic_cast< PointerType * > ( t1 ); 369 370 if ( ResolvExpr::typesCompatible( ptrType->get_base(), t2, SymTab::Indexer() ) ) { 371 371 // optimization: don't need to copy construct in order to call a copy constructor 372 372 return appExpr; 373 373 } // if 374 } else if ( CodeGen::isDestructor( funcDecl->get_name() ) ) {374 } else if ( isDestructor( funcDecl->get_name() ) ) { 375 375 // correctness: never copy construct arguments to a destructor 376 376 return appExpr; … … 401 401 402 402 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { 403 return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( type ) ||GenPoly::getFunctionType( type ) || Tuples::isTtype( type );403 return dynamic_cast< VarArgsType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type ); 404 404 } 405 405 … … 489 489 impCpCtorExpr->get_returnDecls().push_back( ret ); 490 490 CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; ) 491 if ( ! dynamic_cast< ReferenceType * >( result) ) {491 if ( ! result->get_lvalue() ) { 492 492 // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary 493 493 destructRet( ret, impCpCtorExpr ); … … 975 975 if ( ! funcDecl ) return false; 976 976 if ( ! funcDecl->get_statements() ) return false; 977 return CodeGen::isCtorDtor( funcDecl->get_name() ) && ! LinkageSpec::isOverridable( funcDecl->get_linkage() );977 return isCtorDtor( funcDecl->get_name() ) && ! LinkageSpec::isOverridable( funcDecl->get_linkage() ); 978 978 } 979 979 … … 992 992 993 993 function = funcDecl; 994 isCtor = CodeGen::isConstructor( function->get_name() );994 isCtor = isConstructor( function->get_name() ); 995 995 if ( checkWarnings( function ) ) { 996 996 FunctionType * type = function->get_functionType(); 997 997 assert( ! type->get_parameters().empty() ); 998 998 thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() ); 999 Type * thisType = getPointerBase( thisParam->get_type() );1000 StructInstType * structType = dynamic_cast< StructInstType * >( thisType);999 PointerType * ptrType = safe_dynamic_cast< PointerType * > ( thisParam->get_type() ); 1000 StructInstType * structType = dynamic_cast< StructInstType * >( ptrType->get_base() ); 1001 1001 if ( structType ) { 1002 1002 structDecl = structType->get_baseStruct(); … … 1031 1031 1032 1032 if ( ! unhandled.empty() ) { 1033 // need to explicitly re-add function parameters to the indexerin order to resolve copy constructors1033 // need to explicitly re-add function parameters in order to resolve copy constructors 1034 1034 enterScope(); 1035 1035 maybeAccept( function->get_functionType(), *this ); … … 1046 1046 // insert and resolve default/copy constructor call for each field that's unhandled 1047 1047 std::list< Statement * > stmt; 1048 UntypedExpr * deref = UntypedExpr::createDeref( new VariableExpr( thisParam ) ); 1049 1048 1050 Expression * arg2 = 0; 1049 1051 if ( isCopyConstructor( function ) ) { … … 1054 1056 } 1055 1057 InitExpander srcParam( arg2 ); 1056 // cast away reference type and construct field. 1057 Expression * thisExpr = new CastExpr( new VariableExpr( thisParam ), thisParam->get_type()->stripReferences()->clone() ); 1058 Expression * memberDest = new MemberExpr( field, thisExpr ); 1059 SymTab::genImplicitCall( srcParam, memberDest, function->get_name(), back_inserter( stmt ), field, isCtor ); 1058 SymTab::genImplicitCall( srcParam, new MemberExpr( field, deref ), function->get_name(), back_inserter( stmt ), field, isCtor ); 1060 1059 1061 1060 assert( stmt.size() <= 1 ); … … 1084 1083 } 1085 1084 1086 /// true if expr is effectively just the 'this' parameter1087 bool isThisExpression( Expression * expr, DeclarationWithType * thisParam ) {1088 // TODO: there are more complicated ways to pass 'this' to a constructor, e.g. &*, *&, etc.1089 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {1090 return varExpr->get_var() == thisParam;1091 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( expr ) ) {1092 return isThisExpression( castExpr->get_arg(), thisParam );1093 }1094 return false;1095 }1096 1097 /// returns a MemberExpr if expr is effectively just member access on the 'this' parameter, else nullptr1098 MemberExpr * isThisMemberExpr( Expression * expr, DeclarationWithType * thisParam ) {1099 if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( expr ) ) {1100 if ( isThisExpression( memberExpr->get_aggregate(), thisParam ) ) {1101 return memberExpr;1102 }1103 } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {1104 return isThisMemberExpr( castExpr->get_arg(), thisParam );1105 }1106 return nullptr;1107 }1108 1109 1085 void GenStructMemberCalls::visit( ApplicationExpr * appExpr ) { 1110 1086 if ( ! checkWarnings( function ) ) return; … … 1115 1091 Expression * firstParam = appExpr->get_args().front(); 1116 1092 1117 if ( isThisExpression( firstParam, thisParam ) ) {1093 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( firstParam ) ) { 1118 1094 // if calling another constructor on thisParam, assume that function handles 1119 1095 // all members - if it doesn't a warning will appear in that function. 1120 unhandled.clear(); 1121 } else if ( MemberExpr * memberExpr = isThisMemberExpr( firstParam, thisParam ) ) { 1122 // if first parameter is a member expression on the this parameter, 1123 // then remove the member from unhandled set. 1124 if ( isThisExpression( memberExpr->get_aggregate(), thisParam ) ) { 1125 unhandled.erase( memberExpr->get_member() ); 1096 if ( varExpr->get_var() == thisParam ) { 1097 unhandled.clear(); 1098 } 1099 } else { 1100 // if first parameter is a member expression then 1101 // remove the member from unhandled set. 1102 handleFirstParam( firstParam ); 1103 } 1104 } 1105 1106 Parent::visit( appExpr ); 1107 } 1108 1109 void GenStructMemberCalls::handleFirstParam( Expression * firstParam ) { 1110 using namespace std; 1111 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( firstParam ) ) { 1112 if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( addrExpr->get_arg() ) ) { 1113 if ( ApplicationExpr * deref = dynamic_cast< ApplicationExpr * >( memberExpr->get_aggregate() ) ) { 1114 if ( getFunctionName( deref ) == "*?" && deref->get_args().size() == 1 ) { 1115 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( deref->get_args().front() ) ) { 1116 if ( varExpr->get_var() == thisParam ) { 1117 unhandled.erase( memberExpr->get_member() ); 1118 } 1119 } 1120 } 1126 1121 } 1127 1122 } 1128 1123 } 1129 Parent::visit( appExpr );1130 1124 } 1131 1125 … … 1134 1128 if ( ! isCtor ) return; 1135 1129 1136 if ( isThisExpression( memberExpr->get_aggregate(), thisParam ) ) { 1137 if ( unhandled.count( memberExpr->get_member() ) ) { 1138 // emit a warning because a member was used before it was constructed 1139 usedUninit.insert( { memberExpr->get_member(), memberExpr->location } ); 1130 if ( ApplicationExpr * deref = dynamic_cast< ApplicationExpr * >( memberExpr->get_aggregate() ) ) { 1131 if ( getFunctionName( deref ) == "*?" && deref->get_args().size() == 1 ) { 1132 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( deref->get_args().front() ) ) { 1133 if ( varExpr->get_var() == thisParam ) { 1134 if ( unhandled.count( memberExpr->get_member() ) ) { 1135 // emit a warning because a member was used before it was constructed 1136 usedUninit.insert( { memberExpr->get_member(), memberExpr->location } ); 1137 } 1138 } 1139 } 1140 1140 } 1141 1141 } … … 1183 1183 ctorExpr->set_callExpr( nullptr ); 1184 1184 ctorExpr->set_env( nullptr ); 1185 1186 Expression *& firstArg = callExpr->get_args().front(); 1187 UntypedExpr * assign = new UntypedExpr( new NameExpr( "?=?" ) ); 1188 assign->get_args().push_back( new VariableExpr( tmp ) ); 1189 assign->get_args().push_back( firstArg ); 1190 assign->set_result( ctorExpr->get_result()->clone() ); 1191 firstArg = assign; 1192 1193 CommaExpr * commaExpr = new CommaExpr( callExpr, new VariableExpr( tmp ) ); 1194 commaExpr->set_env( env ); 1185 1195 delete ctorExpr; 1186 1187 Expression *& firstArg = callExpr->get_args().front();1188 1189 // xxx - hack in 'fake' assignment operator until resolver can easily be called in this pass. Once the resolver can be used in PassVisitor, this hack goes away.1190 1191 // generate the type of assignment operator using the type of tmp minus any reference types1192 Type * type = tmp->get_type()->stripReferences();1193 FunctionType * ftype = SymTab::genAssignType( type );1194 1195 // generate fake assignment decl and call it using &tmp and &firstArg1196 // since tmp is guaranteed to be a reference and we want to assign pointers1197 FunctionDecl * assignDecl = new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Intrinsic, ftype, nullptr );1198 ApplicationExpr * assign = new ApplicationExpr( VariableExpr::functionPointer( assignDecl ) );1199 assign->get_args().push_back( new AddressExpr( new VariableExpr( tmp ) ) );1200 Expression * addrArg = new AddressExpr( firstArg );1201 // if firstArg has type T&&, then &firstArg has type T*&.1202 // Cast away the reference to a value type so that the argument1203 // matches the assignment's parameter types1204 if ( dynamic_cast<ReferenceType *>( addrArg->get_result() ) ) {1205 addrArg = new CastExpr( addrArg, addrArg->get_result()->stripReferences()->clone() );1206 }1207 assign->get_args().push_back( addrArg );1208 firstArg = new VariableExpr( tmp );1209 1210 // for constructor expr:1211 // T x;1212 // x{};1213 // results in:1214 // T x;1215 // T & tmp;1216 // &tmp = &x, ?{}(tmp), tmp1217 CommaExpr * commaExpr = new CommaExpr( assign, new CommaExpr( callExpr, new VariableExpr( tmp ) ) );1218 commaExpr->set_env( env );1219 1196 return commaExpr; 1220 1197 } -
src/InitTweak/GenInit.cc
r8217e8f rbd46af4 21 21 22 22 #include "Common/PassVisitor.h" 23 #include "CodeGen/OperatorTable.h"24 23 25 24 #include "GenPoly/DeclMutator.h" … … 55 54 56 55 protected: 57 FunctionType * ftype = nullptr;56 FunctionType * ftype; 58 57 std::string funcName; 59 58 }; … … 138 137 std::list< DeclarationWithType * > & returnVals = ftype->get_returnVals(); 139 138 assert( returnVals.size() == 0 || returnVals.size() == 1 ); 140 // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address139 // hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address 141 140 // is being returned 142 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type()) ) {141 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! returnVals.front()->get_type()->get_lvalue() ) { 143 142 // explicitly construct the return value using the return expression and the retVal object 144 143 assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() ); 145 146 stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) ); 144 UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) ); 145 construct->get_args().push_back( new AddressExpr( new VariableExpr( returnVals.front() ) ) ); 146 construct->get_args().push_back( returnStmt->get_expr() ); 147 stmtsToAddBefore.push_back(new ExprStmt(noLabels, construct)); 147 148 148 149 // return the retVal object … … 211 212 212 213 bool CtorDtor::isManaged( Type * type ) const { 213 // at least for now, references are never constructed214 if ( dynamic_cast< ReferenceType * >( type ) ) return false;215 214 // need to clear and reset qualifiers when determining if a type is managed 216 215 ValueGuard< Type::Qualifiers > qualifiers( type->get_qualifiers() ); … … 236 235 void CtorDtor::handleDWT( DeclarationWithType * dwt ) { 237 236 // if this function is a user-defined constructor or destructor, mark down the type as "managed" 238 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) {237 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && isCtorDtor( dwt->get_name() ) ) { 239 238 std::list< DeclarationWithType * > & params = GenPoly::getFunctionType( dwt->get_type() )->get_parameters(); 240 239 assert( ! params.empty() ); 241 Type * type = InitTweak::getPointerBase( params.front()->get_type() ); 242 assert( type ); 243 managedTypes.insert( SymTab::Mangler::mangle( type ) ); 240 PointerType * type = safe_dynamic_cast< PointerType * >( params.front()->get_type() ); 241 managedTypes.insert( SymTab::Mangler::mangle( type->get_base() ) ); 244 242 } 245 243 } -
src/InitTweak/InitTweak.cc
r8217e8f rbd46af4 170 170 171 171 UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) ); 172 increment->get_args().push_back( index->clone() );172 increment->get_args().push_back( new AddressExpr( index->clone() ) ); 173 173 *out++ = new ExprStmt( noLabels, increment ); 174 174 } … … 380 380 template<typename CallExpr> 381 381 Expression *& callArg( CallExpr * callExpr, unsigned int pos ) { 382 if ( pos >= callExpr->get_args().size() ) assertf( false, " getCallArg for argument that doesn't exist: (%u); %s.", pos, toString( callExpr ).c_str());382 if ( pos >= callExpr->get_args().size() ) assertf( false, "asking for argument that doesn't exist. Return NULL/throw exception?" ); 383 383 for ( Expression *& arg : callExpr->get_args() ) { 384 384 if ( pos == 0 ) return arg; … … 458 458 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 459 459 return arrayType->get_base(); 460 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) {461 return refType->get_base();462 460 } else { 463 461 return NULL; … … 545 543 if ( ftype->get_parameters().size() != 2 ) return 0; 546 544 547 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type());545 Type * t1 = ftype->get_parameters().front()->get_type(); 548 546 Type * t2 = ftype->get_parameters().back()->get_type(); 549 assert( t1 ); 550 551 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, SymTab::Indexer() ) ) { 547 PointerType * ptrType = dynamic_cast< PointerType * > ( t1 ); 548 assert( ptrType ); 549 550 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( ptrType->get_base(), t2, SymTab::Indexer() ) ) { 552 551 return function; 553 552 } else { -
src/InitTweak/InitTweak.h
r8217e8f rbd46af4 25 25 // helper functions for initialization 26 26 namespace InitTweak { 27 bool isConstructor( const std::string & ); 28 bool isDestructor( const std::string & ); 29 bool isAssignment( const std::string & ); 30 bool isCtorDtor( const std::string & ); 31 bool isCtorDtorAssign( const std::string & ); 32 27 33 FunctionDecl * isAssignment( Declaration * decl ); 28 34 FunctionDecl * isDestructor( Declaration * decl ); -
src/Makefile.in
r8217e8f rbd46af4 224 224 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT) \ 225 225 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT) \ 226 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT) \227 226 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT) \ 228 227 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT) \ … … 521 520 SynTree/VoidType.cc SynTree/BasicType.cc \ 522 521 SynTree/PointerType.cc SynTree/ArrayType.cc \ 523 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ 524 SynTree/ReferenceToType.cc SynTree/TupleType.cc \ 525 SynTree/TypeofType.cc SynTree/AttrType.cc \ 522 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ 523 SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \ 526 524 SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \ 527 525 SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \ … … 869 867 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 870 868 SynTree/$(DEPDIR)/$(am__dirstamp) 871 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT): \872 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)873 869 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT): \ 874 870 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) … … 1074 1070 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po@am__quote@ 1075 1071 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po@am__quote@ 1076 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po@am__quote@1077 1072 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po@am__quote@ 1078 1073 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po@am__quote@ … … 2172 2167 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2173 2168 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ArrayType.obj `if test -f 'SynTree/ArrayType.cc'; then $(CYGPATH_W) 'SynTree/ArrayType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ArrayType.cc'; fi` 2174 2175 SynTree/driver_cfa_cpp-ReferenceType.o: SynTree/ReferenceType.cc2176 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc2177 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2178 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.o' libtool=no @AMDEPBACKSLASH@2179 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2180 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc2181 2182 SynTree/driver_cfa_cpp-ReferenceType.obj: SynTree/ReferenceType.cc2183 @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`2184 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2185 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.obj' libtool=no @AMDEPBACKSLASH@2186 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@2187 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`2188 2169 2189 2170 SynTree/driver_cfa_cpp-FunctionType.o: SynTree/FunctionType.cc -
src/Parser/DeclarationNode.cc
r8217e8f rbd46af4 331 331 } // DeclarationNode::newTypeDecl 332 332 333 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers , OperKinds kind) {334 DeclarationNode * newnode = new DeclarationNode; 335 newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference);333 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) { 334 DeclarationNode * newnode = new DeclarationNode; 335 newnode->type = new TypeData( TypeData::Pointer ); 336 336 if ( qualifiers ) { 337 337 return newnode->addQualifiers( qualifiers ); … … 750 750 DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) { 751 751 if ( p ) { 752 assert( p->type->kind == TypeData::Pointer || TypeData::Reference);752 assert( p->type->kind == TypeData::Pointer ); 753 753 setBase( p->type ); 754 754 p->type = nullptr; … … 772 772 DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) { 773 773 if ( p ) { 774 assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference);774 assert( p->type->kind == TypeData::Pointer ); 775 775 if ( type ) { 776 776 switch ( type->kind ) { -
src/Parser/ExpressionNode.cc
r8217e8f rbd46af4 305 305 Expression * build_unary_ptr( OperKinds op, ExpressionNode * expr_node ) { 306 306 std::list< Expression * > args; 307 args.push_back( maybeMoveBuild< Expression >(expr_node) ); // xxx307 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node) ) ); 308 308 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); 309 309 } // build_unary_ptr … … 318 318 Expression * build_binary_ptr( OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ) { 319 319 std::list< Expression * > args; 320 args.push_back( maybeMoveBuild< Expression >(expr_node1) );320 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node1) ) ); 321 321 args.push_back( maybeMoveBuild< Expression >(expr_node2) ); 322 322 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); -
src/Parser/ParseNode.h
r8217e8f rbd46af4 237 237 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); 238 238 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams ); 239 static DeclarationNode * newPointer( DeclarationNode * qualifiers , OperKinds kind);239 static DeclarationNode * newPointer( DeclarationNode * qualifiers ); 240 240 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); 241 241 static DeclarationNode * newVarArray( DeclarationNode * qualifiers ); -
src/Parser/TypeData.cc
r8217e8f rbd46af4 30 30 case Unknown: 31 31 case Pointer: 32 case Reference:33 32 case EnumConstant: 34 33 // nothing else to initialize … … 100 99 case Unknown: 101 100 case Pointer: 102 case Reference:103 101 case EnumConstant: 104 102 // nothing to destroy … … 167 165 case EnumConstant: 168 166 case Pointer: 169 case Reference:170 167 // nothing else to copy 171 168 break; … … 403 400 // add dtor: void ^?{}(T *) 404 401 FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false ); 405 dtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );402 dtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 406 403 td->get_assertions().push_front( new FunctionDecl( "^?{}", Type::StorageClasses(), LinkageSpec::Cforall, dtorType, nullptr ) ); 407 404 408 405 // add copy ctor: void ?{}(T *, T) 409 406 FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false ); 410 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );407 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 411 408 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 412 409 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, copyCtorType, nullptr ) ); … … 414 411 // add default ctor: void ?{}(T *) 415 412 FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false ); 416 ctorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );413 ctorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 417 414 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, ctorType, nullptr ) ); 418 415 419 416 // add assignment operator: T * ?=?(T *, T) 420 417 FunctionType * assignType = new FunctionType( Type::Qualifiers(), false ); 421 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) );418 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), new TypeInstType( Type::Qualifiers(), td->get_name(), *i ) ), nullptr ) ); 422 419 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 423 420 assignType->get_returnVals().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); … … 439 436 case TypeData::Array: 440 437 return buildArray( td ); 441 case TypeData::Reference:442 return buildReference( td );443 438 case TypeData::Function: 444 439 return buildFunction( td ); … … 619 614 buildForall( td->forall, at->get_forall() ); 620 615 return at; 621 } // buildArray 622 623 ReferenceType * buildReference( const TypeData * td ) { 624 ReferenceType * rt; 625 if ( td->base ) { 626 rt = new ReferenceType( buildQualifiers( td ), typebuild( td->base ) ); 627 } else { 628 rt = new ReferenceType( buildQualifiers( td ), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 629 } // if 630 buildForall( td->forall, rt->get_forall() ); 631 return rt; 632 } // buildReference 616 } // buildPointer 633 617 634 618 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { -
src/Parser/TypeData.h
r8217e8f rbd46af4 20 20 21 21 struct TypeData { 22 enum Kind { Basic, Pointer, Array, Reference,Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,22 enum Kind { Basic, Pointer, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 23 23 SymbolicInst, Tuple, Typeof, Builtin, Unknown }; 24 24 … … 103 103 PointerType * buildPointer( const TypeData * ); 104 104 ArrayType * buildArray( const TypeData * ); 105 ReferenceType * buildReference( const TypeData * );106 105 AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > ); 107 106 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ); -
src/Parser/lex.ll
r8217e8f rbd46af4 236 236 __label__ { KEYWORD_RETURN(LABEL); } // GCC 237 237 long { KEYWORD_RETURN(LONG); } 238 lvalue { KEYWORD_RETURN(LVALUE); } // CFA 238 239 monitor { KEYWORD_RETURN(MONITOR); } // CFA 239 240 mutex { KEYWORD_RETURN(MUTEX); } // CFA -
src/Parser/parser.yy
r8217e8f rbd46af4 118 118 %token RESTRICT // C99 119 119 %token ATOMIC // C11 120 %token FORALL MUTEX VIRTUAL // CFA120 %token FORALL LVALUE MUTEX VIRTUAL // CFA 121 121 %token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED 122 122 %token BOOL COMPLEX IMAGINARY // C99 … … 668 668 conditional_expression 669 669 | unary_expression assignment_operator assignment_expression 670 { $$ = new ExpressionNode( build_binary_ val( $2, $1, $3 ) ); }670 { $$ = new ExpressionNode( build_binary_ptr( $2, $1, $3 ) ); } 671 671 ; 672 672 … … 1425 1425 | VOLATILE 1426 1426 { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); } 1427 | LVALUE // CFA 1428 { $$ = DeclarationNode::newTypeQualifier( Type::Lvalue ); } 1427 1429 | MUTEX 1428 1430 { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); } … … 2405 2407 variable_ptr: 2406 2408 ptrref_operator variable_declarator 2407 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2409 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2408 2410 | ptrref_operator type_qualifier_list variable_declarator 2409 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2411 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2410 2412 | '(' variable_ptr ')' attribute_list_opt 2411 2413 { $$ = $2->addQualifiers( $4 ); } // redundant parenthesis … … 2453 2455 function_ptr: 2454 2456 ptrref_operator function_declarator 2455 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2457 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2456 2458 | ptrref_operator type_qualifier_list function_declarator 2457 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2459 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2458 2460 | '(' function_ptr ')' 2459 2461 { $$ = $2; } … … 2493 2495 KR_function_ptr: 2494 2496 ptrref_operator KR_function_declarator 2495 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2497 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2496 2498 | ptrref_operator type_qualifier_list KR_function_declarator 2497 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2499 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2498 2500 | '(' KR_function_ptr ')' 2499 2501 { $$ = $2; } … … 2537 2539 type_ptr: 2538 2540 ptrref_operator variable_type_redeclarator 2539 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2541 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2540 2542 | ptrref_operator type_qualifier_list variable_type_redeclarator 2541 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2543 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2542 2544 | '(' type_ptr ')' attribute_list_opt 2543 2545 { $$ = $2->addQualifiers( $4 ); } … … 2581 2583 identifier_parameter_ptr: 2582 2584 ptrref_operator identifier_parameter_declarator 2583 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2585 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2584 2586 | ptrref_operator type_qualifier_list identifier_parameter_declarator 2585 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2587 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2586 2588 | '(' identifier_parameter_ptr ')' attribute_list_opt 2587 2589 { $$ = $2->addQualifiers( $4 ); } … … 2641 2643 type_parameter_ptr: 2642 2644 ptrref_operator type_parameter_redeclarator 2643 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2645 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2644 2646 | ptrref_operator type_qualifier_list type_parameter_redeclarator 2645 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2647 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2646 2648 | '(' type_parameter_ptr ')' attribute_list_opt 2647 2649 { $$ = $2->addQualifiers( $4 ); } … … 2684 2686 abstract_ptr: 2685 2687 ptrref_operator 2686 { $$ = DeclarationNode::newPointer( 0 , $1); }2688 { $$ = DeclarationNode::newPointer( 0 ); } 2687 2689 | ptrref_operator type_qualifier_list 2688 { $$ = DeclarationNode::newPointer( $2 , $1); }2690 { $$ = DeclarationNode::newPointer( $2 ); } 2689 2691 | ptrref_operator abstract_declarator 2690 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2692 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2691 2693 | ptrref_operator type_qualifier_list abstract_declarator 2692 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2694 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2693 2695 | '(' abstract_ptr ')' attribute_list_opt 2694 2696 { $$ = $2->addQualifiers( $4 ); } … … 2773 2775 abstract_parameter_ptr: 2774 2776 ptrref_operator 2775 { $$ = DeclarationNode::newPointer( nullptr , $1); }2777 { $$ = DeclarationNode::newPointer( nullptr ); } 2776 2778 | ptrref_operator type_qualifier_list 2777 { $$ = DeclarationNode::newPointer( $2 , $1); }2779 { $$ = DeclarationNode::newPointer( $2 ); } 2778 2780 | ptrref_operator abstract_parameter_declarator 2779 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr , $1) ); }2781 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr ) ); } 2780 2782 | ptrref_operator type_qualifier_list abstract_parameter_declarator 2781 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2783 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2782 2784 | '(' abstract_parameter_ptr ')' attribute_list_opt 2783 2785 { $$ = $2->addQualifiers( $4 ); } … … 2852 2854 variable_abstract_ptr: 2853 2855 ptrref_operator 2854 { $$ = DeclarationNode::newPointer( 0 , $1); }2856 { $$ = DeclarationNode::newPointer( 0 ); } 2855 2857 | ptrref_operator type_qualifier_list 2856 { $$ = DeclarationNode::newPointer( $2 , $1); }2858 { $$ = DeclarationNode::newPointer( $2 ); } 2857 2859 | ptrref_operator variable_abstract_declarator 2858 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2860 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2859 2861 | ptrref_operator type_qualifier_list variable_abstract_declarator 2860 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2862 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 2861 2863 | '(' variable_abstract_ptr ')' attribute_list_opt 2862 2864 { $$ = $2->addQualifiers( $4 ); } … … 2898 2900 // No SUE declaration in parameter list. 2899 2901 ptrref_operator type_specifier_nobody 2900 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2902 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2901 2903 | type_qualifier_list ptrref_operator type_specifier_nobody 2902 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2904 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2903 2905 | ptrref_operator cfa_abstract_function 2904 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2906 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2905 2907 | type_qualifier_list ptrref_operator cfa_abstract_function 2906 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2908 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2907 2909 | ptrref_operator cfa_identifier_parameter_declarator_tuple 2908 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2910 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2909 2911 | type_qualifier_list ptrref_operator cfa_identifier_parameter_declarator_tuple 2910 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2912 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2911 2913 ; 2912 2914 … … 2986 2988 cfa_abstract_ptr: // CFA 2987 2989 ptrref_operator type_specifier 2988 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2990 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2989 2991 | type_qualifier_list ptrref_operator type_specifier 2990 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2992 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2991 2993 | ptrref_operator cfa_abstract_function 2992 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2994 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2993 2995 | type_qualifier_list ptrref_operator cfa_abstract_function 2994 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2996 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2995 2997 | ptrref_operator cfa_abstract_declarator_tuple 2996 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2998 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2997 2999 | type_qualifier_list ptrref_operator cfa_abstract_declarator_tuple 2998 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }3000 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2999 3001 ; 3000 3002 -
src/ResolvExpr/Alternative.cc
r8217e8f rbd46af4 28 28 : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ) {} 29 29 30 Alternative::Alternative( const Alternative &other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( maybeClone( other.expr ) ), env( other.env ) { 30 Alternative::Alternative( const Alternative &other ) { 31 initialize( other, *this ); 31 32 } 32 33 33 34 Alternative &Alternative::operator=( const Alternative &other ) { 34 35 if ( &other == this ) return *this; 35 delete expr; 36 cost = other.cost; 37 cvtCost = other.cvtCost; 38 expr = maybeClone( other.expr ); 39 env = other.env; 36 initialize( other, *this ); 40 37 return *this; 41 38 } … … 54 51 other.expr = nullptr; 55 52 return *this; 53 } 54 55 void Alternative::initialize( const Alternative &src, Alternative &dest ) { 56 dest.cost = src.cost; 57 dest.cvtCost = src.cvtCost; 58 dest.expr = maybeClone( src.expr ); 59 dest.env = src.env; 56 60 } 57 61 -
src/ResolvExpr/Alternative.h
r8217e8f rbd46af4 35 35 ~Alternative(); 36 36 37 void initialize( const Alternative &src, Alternative &dest ); 38 37 39 void print( std::ostream &os, int indent = 0 ) const; 38 40 -
src/ResolvExpr/AlternativeFinder.cc
r8217e8f rbd46af4 67 67 68 68 Cost sumCost( const AltList &in ) { 69 Cost total = Cost::zero;69 Cost total; 70 70 for ( AltList::const_iterator i = in.begin(); i != in.end(); ++i ) { 71 71 total += i->cost; … … 144 144 expr->get_result()->accept( global_renamer ); 145 145 } 146 147 void referenceToRvalueConversion( Expression *& expr ) { 148 if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) { 149 // cast away reference from expr 150 expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() ); 151 } 152 } 153 } // namespace 146 } 154 147 155 148 template< typename InputIterator, typename OutputIterator > … … 220 213 void AlternativeFinder::addAnonConversions( const Alternative & alt ) { 221 214 // adds anonymous member interpretations whenever an aggregate value type is seen. 222 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value 223 std::unique_ptr<Expression> aggrExpr( alt.expr->clone() ); 224 alt.env.apply( aggrExpr->get_result() ); 225 Type * aggrType = aggrExpr->get_result(); 226 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 227 aggrType = aggrType->stripReferences(); 228 aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) ); 229 } 230 231 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 215 Expression * expr = alt.expr->clone(); 216 std::unique_ptr< Expression > manager( expr ); // RAII for expr 217 alt.env.apply( expr->get_result() ); 218 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( expr->get_result() ) ) { 232 219 NameExpr nameExpr( "" ); 233 addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr );234 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) {220 addAggMembers( structInst, expr, alt.cost+Cost( 0, 0, 1 ), alt.env, &nameExpr ); 221 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( expr->get_result() ) ) { 235 222 NameExpr nameExpr( "" ); 236 addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr );223 addAggMembers( unionInst, expr, alt.cost+Cost( 0, 0, 1 ), alt.env, &nameExpr ); 237 224 } // if 238 225 } … … 290 277 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 291 278 292 Cost convCost = Cost::zero;279 Cost convCost( 0, 0, 0 ); 293 280 std::list< DeclarationWithType* >& formals = function->get_parameters(); 294 281 std::list< DeclarationWithType* >::iterator formal = formals.begin(); … … 303 290 actualType->print( std::cerr, 8 ); 304 291 ) 305 Cost actualCost = Cost::zero;292 Cost actualCost; 306 293 if ( formal == formals.end() ) { 307 294 if ( function->get_isVarArgs() ) { 308 convCost.incUnsafe(); 309 // convert reference-typed expressions to value-typed expressions 310 referenceToRvalueConversion( *actualExpr ); 295 convCost += Cost( 1, 0, 0 ); 311 296 continue; 312 297 } else { … … 320 305 std::cerr << std::endl << " to "; 321 306 formalType->print( std::cerr, 8 ); 322 std::cerr << std::endl << "environment is: ";323 alt.env.print( std::cerr, 8 );324 std::cerr << std::endl;325 307 ) 326 308 Cost newCost = conversionCost( actualType, formalType, indexer, alt.env ); … … 334 316 convCost += newCost; 335 317 actualCost += newCost; 336 if ( actualCost != Cost ::zero) {318 if ( actualCost != Cost( 0, 0, 0 ) ) { 337 319 Type *newType = formalType->clone(); 338 320 alt.env.apply( newType ); 339 321 *actualExpr = new CastExpr( *actualExpr, newType ); 340 322 } 341 convCost .incPoly( polyCost( formalType, alt.env, indexer ) + polyCost( actualType, alt.env, indexer ));323 convCost += Cost( 0, polyCost( formalType, alt.env, indexer ) + polyCost( actualType, alt.env, indexer ), 0 ); 342 324 ++formal; // can't be in for-loop update because of the continue 343 325 } … … 361 343 } 362 344 convCost += newCost; 363 convCost .incPoly( polyCost( assert->second.formalType, alt.env, indexer ) + polyCost( assert->second.actualType, alt.env, indexer ));345 convCost += Cost( 0, polyCost( assert->second.formalType, alt.env, indexer ) + polyCost( assert->second.actualType, alt.env, indexer ), 0 ); 364 346 } 365 347 … … 418 400 Expression * actual = actualIt->expr; 419 401 Type * actualType = actual->get_result(); 420 421 402 PRINT( 422 403 std::cerr << "formal type is "; … … 427 408 ) 428 409 if ( ! unify( formalType, actualType, resultEnv, resultNeed, resultHave, openVars, indexer ) ) { 429 // std::cerr << "unify failed" << std::endl;430 410 return false; 431 411 } … … 472 452 // match flattened actuals with formal parameters - actuals will be grouped to match 473 453 // with formals as appropriate 474 Cost cost = Cost::zero;454 Cost cost; 475 455 std::list< Expression * > newExprs; 476 456 ObjectDecl * obj = safe_dynamic_cast< ObjectDecl * >( formal ); … … 633 613 AssertionSet newNeed; 634 614 //AssertionParentSet needParents; 635 PRINT(636 std::cerr << "env is: " << std::endl;637 newAlt.env.print( std::cerr, 0 );638 std::cerr << std::endl;639 )640 641 615 inferRecursive( need.begin(), need.end(), newAlt, openVars, decls, newNeed, /*needParents,*/ 0, indexer, out ); 642 616 // PRINT( … … 669 643 makeExprList( instantiatedActuals, appExpr->get_args() ); 670 644 PRINT( 671 std::cerr << "instantiate function success: " << appExpr << std::endl;672 645 std::cerr << "need assertions:" << std::endl; 673 646 printAssertionSet( resultNeed, std::cerr, 8 ); … … 690 663 UntypedExpr *vexpr = untypedExpr->clone(); 691 664 vexpr->set_result( pt.clone() ); 692 alternatives.push_back( Alternative( vexpr, env, Cost ::zero) );665 alternatives.push_back( Alternative( vexpr, env, Cost()) ); 693 666 return; 694 667 } … … 708 681 AltList candidates; 709 682 SemanticError errors; 710 for ( AltList:: iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) {683 for ( AltList::const_iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) { 711 684 try { 712 685 PRINT( … … 715 688 ) 716 689 // check if the type is pointer to function 717 if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->get_result()->stripReferences() ) ) { 690 PointerType *pointer; 691 if ( ( pointer = dynamic_cast< PointerType* >( func->expr->get_result() ) ) ) { 718 692 if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) { 719 referenceToRvalueConversion( func->expr );720 693 for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) { 721 694 // XXX … … 723 696 makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) ); 724 697 } 725 } 726 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer) 727 referenceToRvalueConversion( func->expr ); 728 EqvClass eqvClass; 729 if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) { 730 if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) { 731 for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) { 732 makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) ); 733 } // for 698 } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( pointer->get_base() ) ) { 699 EqvClass eqvClass; 700 if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) { 701 if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) { 702 for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) { 703 makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) ); 704 } // for 705 } // if 734 706 } // if 735 707 } // if … … 750 722 } 751 723 752 for ( AltList:: iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {724 for ( AltList::const_iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) { 753 725 // check if the type is pointer to function 754 if ( PointerType *pointer = dynamic_cast< PointerType* >( funcOp->expr->get_result()->stripReferences() ) ) { 726 PointerType *pointer; 727 if ( ( pointer = dynamic_cast< PointerType* >( funcOp->expr->get_result() ) ) ) { 755 728 if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) { 756 referenceToRvalueConversion( funcOp->expr );757 729 for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) { 758 730 AltList currentAlt; … … 781 753 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() ); 782 754 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 783 std::cerr << "Case +++++++++++++ " << appExpr->get_function()<< std::endl;755 std::cerr << "Case +++++++++++++" << std::endl; 784 756 std::cerr << "formals are:" << std::endl; 785 757 printAll( function->get_parameters(), std::cerr, 8 ); … … 824 796 bool isLvalue( Expression *expr ) { 825 797 // xxx - recurse into tuples? 826 return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ));798 return expr->has_result() && expr->get_result()->get_lvalue(); 827 799 } 828 800 … … 838 810 839 811 Expression * restructureCast( Expression * argExpr, Type * toType ) { 840 if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() && ! dynamic_cast<ReferenceType *>( toType ) ) { 841 // Argument expression is a tuple and the target type is not void and not a reference type. 842 // Cast each member of the tuple to its corresponding target type, producing the tuple of those 843 // cast expressions. If there are more components of the tuple than components in the target type, 844 // then excess components do not come out in the result expression (but UniqueExprs ensure that 845 // side effects will still be done). 812 if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() ) { 813 // Argument expression is a tuple and the target type is not void. Cast each member of the tuple 814 // to its corresponding target type, producing the tuple of those cast expressions. If there are 815 // more components of the tuple than components in the target type, then excess components do not 816 // come out in the result expression (but UniqueExprs ensure that side effects will still be done). 846 817 if ( Tuples::maybeImpure( argExpr ) && ! dynamic_cast< UniqueExpr * >( argExpr ) ) { 847 818 // expressions which may contain side effects require a single unique instance of the expression. … … 884 855 // that are cast directly. The candidate is invalid if it has fewer results than there are types to cast 885 856 // to. 886 int discardedValues = i->expr->get_result()->size() - castExpr->get_result()->size();857 int discardedValues = (*i).expr->get_result()->size() - castExpr->get_result()->size(); 887 858 if ( discardedValues < 0 ) continue; 888 859 // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not 889 860 // allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3])) 890 861 // unification run for side-effects 891 unify( castExpr->get_result(), i->expr->get_result(), i->env, needAssertions, haveAssertions, openVars, indexer );892 Cost thisCost = castCost( i->expr->get_result(), castExpr->get_result(), indexer, i->env );862 unify( castExpr->get_result(), (*i).expr->get_result(), i->env, needAssertions, haveAssertions, openVars, indexer ); 863 Cost thisCost = castCost( (*i).expr->get_result(), castExpr->get_result(), indexer, i->env ); 893 864 if ( thisCost != Cost::infinity ) { 894 865 // count one safe conversion for each value that is thrown away 895 thisCost .incSafe(discardedValues );866 thisCost += Cost( 0, 0, discardedValues ); 896 867 897 868 candidates.push_back( Alternative( restructureCast( i->expr->clone(), toType ), i->env, i->cost, thisCost ) ); … … 924 895 funcFinder.findWithAdjustment( memberExpr->get_aggregate() ); 925 896 for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) { 926 // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value 927 std::unique_ptr<Expression> aggrExpr( agg->expr->clone() ); 928 Type * aggrType = aggrExpr->get_result(); 929 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 930 aggrType = aggrType->stripReferences(); 931 aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) ); 932 } 933 // find member of the given type 934 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 935 addAggMembers( structInst, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() ); 936 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) { 937 addAggMembers( unionInst, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() ); 938 } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( aggrExpr->get_result() ) ) { 939 addTupleMembers( tupleType, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() ); 897 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_result() ) ) { 898 addAggMembers( structInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() ); 899 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_result() ) ) { 900 addAggMembers( unionInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() ); 901 } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( agg->expr->get_result() ) ) { 902 addTupleMembers( tupleType, agg->expr, agg->cost, agg->env, memberExpr->get_member() ); 940 903 } // if 941 904 } // for … … 952 915 for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) { 953 916 VariableExpr newExpr( *i, nameExpr->get_argName() ); 954 alternatives.push_back( Alternative( newExpr.clone(), env, Cost ::zero) );917 alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) ); 955 918 PRINT( 956 919 std::cerr << "decl is "; … … 1096 1059 for ( std::list< DeclarationWithType* >::iterator i = attrList.begin(); i != attrList.end(); ++i ) { 1097 1060 VariableExpr newExpr( *i ); 1098 alternatives.push_back( Alternative( newExpr.clone(), env, Cost ::zero) );1061 alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) ); 1099 1062 renameTypes( alternatives.back().expr ); 1100 1063 } // for … … 1269 1232 if ( thisCost != Cost::infinity ) { 1270 1233 // count one safe conversion for each value that is thrown away 1271 thisCost .incSafe(discardedValues );1234 thisCost += Cost( 0, 0, discardedValues ); 1272 1235 candidates.push_back( Alternative( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ) ); 1273 1236 } -
src/ResolvExpr/CastCost.cc
r8217e8f rbd46af4 46 46 assert( type ); 47 47 if ( type->get_base() ) { 48 return castCost( src, type->get_base(), indexer, env ) + Cost ::safe;48 return castCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 ); 49 49 } // if 50 50 } // if 51 51 } // if 52 52 if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) { 53 return Cost ::zero;53 return Cost( 0, 0, 0 ); 54 54 } else if ( dynamic_cast< VoidType* >( dest ) ) { 55 return Cost::safe; 56 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 57 return convertToReferenceCost( src, refType, indexer, env ); 55 return Cost( 0, 0, 1 ); 58 56 } else { 59 57 CastCost converter( dest, indexer, env ); … … 63 61 } else { 64 62 // xxx - why are we adding cost 0 here? 65 return converter.get_cost() + Cost ::zero;63 return converter.get_cost() + Cost( 0, 0, 0 ); 66 64 } // if 67 65 } // if … … 76 74 if ( destAsPointer && basicType->isInteger() ) { 77 75 // necessary for, e.g. unsigned long => void* 78 cost = Cost ::unsafe;76 cost = Cost( 1, 0, 0 ); 79 77 } else { 80 cost = conversionCost( basicType, dest, indexer, env);78 ConversionCost::visit( basicType ); 81 79 } // if 82 80 } … … 85 83 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 86 84 if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 87 cost = Cost ::safe;85 cost = Cost( 0, 0, 1 ); 88 86 } else { 89 87 TypeEnvironment newEnv( env ); … … 92 90 int castResult = ptrsCastable( pointerType->get_base(), destAsPtr->get_base(), newEnv, indexer ); 93 91 if ( castResult > 0 ) { 94 cost = Cost ::safe;92 cost = Cost( 0, 0, 1 ); 95 93 } else if ( castResult < 0 ) { 96 94 cost = Cost::infinity; … … 100 98 if ( destAsBasic->isInteger() ) { 101 99 // necessary for, e.g. void* => unsigned long 102 cost = Cost ::unsafe;100 cost = Cost( 1, 0, 0 ); 103 101 } // if 104 102 } -
src/ResolvExpr/CommonType.cc
r8217e8f rbd46af4 17 17 #include "SynTree/Type.h" 18 18 #include "Unify.h" 19 19 20 20 21 /// #define DEBUG … … 30 31 virtual void visit( PointerType *pointerType ); 31 32 virtual void visit( ArrayType *arrayType ); 32 virtual void visit( ReferenceType *refType );33 33 virtual void visit( FunctionType *functionType ); 34 34 virtual void visit( StructInstType *aggregateUseType ); … … 42 42 virtual void visit( OneType *oneType ); 43 43 44 template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ); 45 template< typename RefType > void handleRefType( RefType *inst, Type *other ); 44 void getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ); 46 45 47 46 Type *result; … … 53 52 }; 54 53 55 Type * handleReference( ReferenceType * refType, Type * other, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) {56 Type * result = nullptr, * common = nullptr;57 AssertionSet have, need;58 OpenVarSet newOpen( openVars );59 // need unify to bind type variables60 if ( unify( refType->get_base(), other, env, have, need, newOpen, indexer, common ) ) {61 // std::cerr << "unify success" << std::endl;62 if ( widenSecond ) {63 if ( widenFirst || other->get_qualifiers() <= refType->get_qualifiers() ) {64 result = new ReferenceType( refType->get_qualifiers(), common ); // refType->clone();65 result->get_qualifiers() |= other->get_qualifiers();66 }67 } else if ( widenFirst ) {68 if ( widenSecond || refType->get_qualifiers() <= other->get_qualifiers() ) {69 result = common;70 result->get_qualifiers() |= refType->get_qualifiers();71 }72 }73 } else {74 // std::cerr << "exact unify failed: " << refType << " " << other << std::endl;75 }76 // std::cerr << "common type of reference [" << refType << "] and non-reference [" << other << "] is [" << result << "]" << std::endl;77 return result;78 }79 80 54 Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) { 81 55 CommonType visitor( type2, widenFirst, widenSecond, indexer, env, openVars ); 82 83 int depth1 = type1->referenceDepth();84 int depth2 = type2->referenceDepth();85 if ( depth1 > 0 || depth2 > 0 ) {86 int diff = depth1-depth2;87 // TODO: should it be possible for commonType to generate complicated conversions? I would argue no, only conversions that involve types of the same reference level or a difference of 1 should be allowed.88 if ( diff > 1 || diff < -1 ) return nullptr;89 90 // special case where one type has a reference depth of 1 larger than the other91 if ( diff > 0 ) {92 return handleReference( safe_dynamic_cast<ReferenceType *>( type1 ), type2, widenFirst, widenSecond, indexer, env, openVars );93 } else if ( diff < 0 ) {94 return handleReference( safe_dynamic_cast<ReferenceType *>( type2 ), type1, widenSecond, widenFirst, indexer, env, openVars );95 }96 // otherwise, both are reference types of the same depth and this is handled by the CommonType visitor.97 }98 99 56 type1->accept( visitor ); 100 57 Type *result = visitor.get_result(); … … 185 142 } 186 143 187 template< typename Pointer > 188 void CommonType::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) { 144 void CommonType::getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ) { 189 145 if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) { 190 146 OpenVarSet::const_iterator entry = openVars.find( var->get_name() ); … … 232 188 233 189 void CommonType::visit( __attribute((unused)) ArrayType *arrayType ) {} 234 235 void CommonType::visit( ReferenceType *refType ) {236 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {237 if ( widenFirst && dynamic_cast< VoidType* >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) {238 getCommonWithVoidPointer( otherRef, refType );239 } else if ( widenSecond && dynamic_cast< VoidType* >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) {240 getCommonWithVoidPointer( refType, otherRef );241 } else if ( ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst )242 && ( refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond ) ) {243 Type::Qualifiers tq1 = refType->get_base()->get_qualifiers(), tq2 = otherRef->get_base()->get_qualifiers();244 refType->get_base()->get_qualifiers() = Type::Qualifiers();245 otherRef->get_base()->get_qualifiers() = Type::Qualifiers();246 AssertionSet have, need;247 OpenVarSet newOpen( openVars );248 if ( unifyExact( refType->get_base(), otherRef->get_base(), env, have, need, newOpen, indexer ) ) {249 if ( tq1 < tq2 ) {250 result = refType->clone();251 } else {252 result = otherRef->clone();253 } // if254 result->get_qualifiers() = tq1 | tq2;255 } else {256 /// std::cout << "place for ptr-to-type" << std::endl;257 } // if258 refType->get_base()->get_qualifiers() = tq1;259 otherRef->get_base()->get_qualifiers() = tq2;260 } // if261 } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {262 result = refType->clone();263 result->get_qualifiers() |= type2->get_qualifiers();264 } // if265 }266 267 190 void CommonType::visit( __attribute((unused)) FunctionType *functionType ) {} 268 191 void CommonType::visit( __attribute((unused)) StructInstType *aggregateUseType ) {} … … 272 195 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 273 196 // reuse BasicType, EnumInstType code by swapping type2 with enumInstType 274 ValueGuard< Type * > temp( type2 );197 Type * temp = type2; 275 198 type2 = enumInstType; 276 temp.old->accept( *this ); 199 temp->accept( *this ); 200 type2 = temp; 277 201 } // if 278 202 } -
src/ResolvExpr/ConversionCost.cc
r8217e8f rbd46af4 21 21 22 22 namespace ResolvExpr { 23 const Cost Cost::zero = Cost( 0, 0, 0, 0 ); 24 const Cost Cost::infinity = Cost( -1, -1, -1, -1 ); 25 const Cost Cost::unsafe = Cost( 1, 0, 0, 0 ); 26 const Cost Cost::poly = Cost( 0, 1, 0, 0 ); 27 const Cost Cost::safe = Cost( 0, 0, 1, 0 ); 28 const Cost Cost::reference = Cost( 0, 0, 0, 1 ); 29 23 const Cost Cost::zero = Cost( 0, 0, 0 ); 24 const Cost Cost::infinity = Cost( -1, -1, -1 ); 30 25 31 26 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { … … 46 41 assert( type ); 47 42 if ( type->get_base() ) { 48 return conversionCost( src, type->get_base(), indexer, env ) + Cost ::safe;43 return conversionCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 ); 49 44 } // if 50 45 } // if … … 59 54 if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) { 60 55 /// std::cout << "compatible!" << std::endl; 61 return Cost ::zero;56 return Cost( 0, 0, 0 ); 62 57 } else if ( dynamic_cast< VoidType* >( dest ) ) { 63 return Cost::safe; 64 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 65 // std::cerr << "conversionCost: dest is reference" << std::endl; 66 return convertToReferenceCost( src, refType, indexer, env ); 58 return Cost( 0, 0, 1 ); 67 59 } else { 68 60 ConversionCost converter( dest, indexer, env ); … … 71 63 return Cost::infinity; 72 64 } else { 73 return converter.get_cost() + Cost::zero; 74 } // if 75 } // if 76 } 77 78 Cost convertToReferenceCost( Type * src, Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env ) { 79 // std::cerr << "convert to reference cost..." << std::endl; 80 if ( diff > 0 ) { 81 // TODO: document this 82 Cost cost = convertToReferenceCost( safe_dynamic_cast< ReferenceType * >( src )->get_base(), dest, diff-1, indexer, env ); 83 cost.incReference(); 84 return cost; 85 } else if ( diff < -1 ) { 86 // TODO: document this 87 Cost cost = convertToReferenceCost( src, safe_dynamic_cast< ReferenceType * >( dest )->get_base(), diff+1, indexer, env ); 88 cost.incReference(); 89 return cost; 90 } else if ( diff == 0 ) { 91 ReferenceType * srcAsRef = dynamic_cast< ReferenceType * >( src ); 92 ReferenceType * destAsRef = dynamic_cast< ReferenceType * >( dest ); 93 if ( srcAsRef && destAsRef ) { // pointer-like conversions between references 94 // std::cerr << "converting between references" << std::endl; 95 if ( srcAsRef->get_base()->get_qualifiers() <= destAsRef->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( srcAsRef->get_base(), destAsRef->get_base(), indexer, env ) ) { 96 return Cost::safe; 97 } else { // xxx - this discards reference qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 98 int assignResult = ptrsAssignable( srcAsRef->get_base(), destAsRef->get_base(), env ); 99 if ( assignResult < 0 ) { 100 return Cost::safe; 101 } else if ( assignResult > 0 ) { 102 return Cost::unsafe; 103 } // if 104 } // if 105 } else { 106 // std::cerr << "reference to rvalue conversion" << std::endl; 107 ConversionCost converter( dest, indexer, env ); 108 src->accept( converter ); 109 return converter.get_cost(); 110 } // if 111 } else { 112 ReferenceType * destAsRef = dynamic_cast< ReferenceType * >( dest ); 113 assert( diff == -1 && destAsRef ); 114 if ( typesCompatibleIgnoreQualifiers( src, destAsRef->get_base(), indexer, env ) ) { 115 // std::cerr << "converting compatible base type" << std::endl; 116 if ( src->get_lvalue() ) { 117 // std::cerr << "lvalue to reference conversion" << std::endl; 118 // lvalue-to-reference conversion: cv lvalue T => cv T & 119 if ( src->get_qualifiers() == destAsRef->get_base()->get_qualifiers() ) { 120 return Cost::reference; // cost needs to be non-zero to add cast 121 } if ( src->get_qualifiers() < destAsRef->get_base()->get_qualifiers() ) { 122 return Cost::safe; // cost needs to be higher than previous cast to differentiate adding qualifiers vs. keeping same 123 } else { 124 return Cost::unsafe; 125 } // if 126 } else if ( destAsRef->get_base()->get_const() ) { 127 // std::cerr << "rvalue to const ref conversion" << std::endl; 128 // rvalue-to-const-reference conversion: T => const T & 129 return Cost::safe; 130 } else { 131 // std::cerr << "rvalue to non-const reference conversion" << std::endl; 132 // rvalue-to-reference conversion: T => T & 133 return Cost::unsafe; 134 } // if 135 } // if 136 // std::cerr << "attempting to convert from incompatible base type -- fail" << std::endl; 137 } 138 return Cost::infinity; 139 } 140 141 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ) { 142 int sdepth = src->referenceDepth(), ddepth = dest->referenceDepth(); 143 return convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env ); 65 return converter.get_cost() + Cost( 0, 0, 0 ); 66 } // if 67 } // if 144 68 } 145 69 … … 233 157 int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ]; 234 158 if ( tableResult == -1 ) { 235 cost = Cost::unsafe; 236 } else { 237 cost = Cost::zero; 238 cost.incSafe( tableResult ); 159 cost = Cost( 1, 0, 0 ); 160 } else { 161 cost = Cost( 0, 0, tableResult ); 239 162 } // if 240 163 } else if ( dynamic_cast< EnumInstType *>( dest ) ) { 241 164 // xxx - not positive this is correct, but appears to allow casting int => enum 242 cost = Cost ::unsafe;165 cost = Cost( 1, 0, 0 ); 243 166 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) { 244 cost = Cost ::unsafe;167 cost = Cost( 1, 0, 0 ); 245 168 } // if 246 169 } … … 248 171 void ConversionCost::visit(PointerType *pointerType) { 249 172 if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) { 250 // std::cerr << pointerType << " ===> " << destAsPtr; 251 Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers(); 252 Type::Qualifiers tq2 = destAsPtr->get_base()->get_qualifiers(); 253 if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 254 if ( tq1 == tq2 ) { 255 // types are the same 256 cost = Cost::zero; 257 } else { 258 // types are the same, except otherPointer has more qualifiers 259 // std::cerr << " :: compatible and good qualifiers" << std::endl; 260 cost = Cost::safe; 261 } 262 } else { // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 173 if ( pointerType->get_base()->get_qualifiers() <= destAsPtr->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 174 cost = Cost( 0, 0, 1 ); 175 } else { 263 176 int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env ); 264 // std::cerr << " :: " << assignResult << std::endl; 265 if ( assignResult < 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) { 266 cost = Cost::safe; 177 if ( assignResult < 0 ) { 178 cost = Cost( 0, 0, 1 ); 267 179 } else if ( assignResult > 0 ) { 268 cost = Cost ::unsafe;180 cost = Cost( 1, 0, 0 ); 269 181 } // if 270 // assignResult == 0 means Cost::Infinity271 182 } // if 272 183 } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) { 273 cost = Cost ::unsafe;184 cost = Cost( 1, 0, 0 ); 274 185 } // if 275 186 } 276 187 277 188 void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {} 278 279 void ConversionCost::visit(ReferenceType *refType) {280 // Note: dest can never be a reference, since it would have been caught in an earlier check281 assert( ! dynamic_cast< ReferenceType * >( dest ) );282 // convert reference to rvalue: cv T1 & => T2283 // recursively compute conversion cost from T1 to T2.284 // cv can be safely dropped because of 'implicit dereference' behavior.285 refType->get_base()->accept( *this );286 if ( refType->get_base()->get_qualifiers() == dest->get_qualifiers() ) {287 cost.incReference(); // prefer exact qualifiers288 } else if ( refType->get_base()->get_qualifiers() < dest->get_qualifiers() ) {289 cost.incSafe(); // then gaining qualifiers290 } else {291 cost.incUnsafe(); // lose qualifiers as last resort292 }293 // std::cerr << refType << " ==> " << dest << " " << cost << std::endl;294 }295 296 189 void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {} 297 190 … … 315 208 static Type::Qualifiers q; 316 209 static BasicType integer( q, BasicType::SignedInt ); 317 integer.accept( *this ); // safe if dest >= int318 if ( cost < Cost ::unsafe) {210 integer.accept( *this ); 211 if ( cost < Cost( 1, 0, 0 ) ) { 319 212 cost.incSafe(); 320 213 } // if … … 338 231 assert( type ); 339 232 if ( type->get_base() ) { 340 cost = conversionCost( type->get_base(), dest, indexer, env ) + Cost ::safe;233 cost = conversionCost( type->get_base(), dest, indexer, env ) + Cost( 0, 0, 1 ); 341 234 } // if 342 235 } // if … … 344 237 345 238 void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) { 346 Cost c = Cost::zero;239 Cost c; 347 240 if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) { 348 241 std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin(); … … 376 269 int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ]; 377 270 if ( tableResult == -1 ) { 378 cost = Cost::unsafe; 379 } else { 380 cost = Cost::zero; 381 cost.incSafe( tableResult + 1 ); 271 cost = Cost( 1, 0, 0 ); 272 } else { 273 cost = Cost( 0, 0, tableResult + 1 ); 382 274 } 383 275 } else if ( dynamic_cast< PointerType* >( dest ) ) { 384 cost = Cost ::safe;276 cost = Cost( 0, 0, 1 ); 385 277 } 386 278 } … … 393 285 int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ]; 394 286 if ( tableResult == -1 ) { 395 cost = Cost::unsafe; 396 } else { 397 cost = Cost::zero; 398 cost.incSafe( tableResult + 1 ); 287 cost = Cost( 1, 0, 0 ); 288 } else { 289 cost = Cost( 0, 0, tableResult + 1 ); 399 290 } 400 291 } -
src/ResolvExpr/ConversionCost.h
r8217e8f rbd46af4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ConversionCost.h -- 7 // ConversionCost.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 25 25 public: 26 26 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 27 27 28 28 Cost get_cost() const { return cost; } 29 29 … … 32 32 virtual void visit(PointerType *pointerType); 33 33 virtual void visit(ArrayType *arrayType); 34 virtual void visit(ReferenceType *refType);35 34 virtual void visit(FunctionType *functionType); 36 35 virtual void visit(StructInstType *aggregateUseType); … … 49 48 const TypeEnvironment &env; 50 49 }; 51 52 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env );53 50 } // namespace ResolvExpr 54 51 -
src/ResolvExpr/Cost.h
r8217e8f rbd46af4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // Cost.h -- 7 // Cost.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 20 20 namespace ResolvExpr { 21 21 class Cost { 22 private:23 Cost( int unsafeCost, int polyCost, int safeCost, int referenceCost );24 25 22 public: 26 Cost & incUnsafe( int inc = 1 ); 27 Cost & incPoly( int inc = 1 ); 28 Cost & incSafe( int inc = 1 ); 29 Cost & incReference( int inc = 1 ); 30 23 Cost(); 24 Cost( int unsafe, int poly, int safe ); 25 26 void incUnsafe( int inc = 1 ); 27 void incPoly( int inc = 1 ); 28 void incSafe( int inc = 1 ); 29 31 30 Cost operator+( const Cost &other ) const; 32 31 Cost operator-( const Cost &other ) const; … … 36 35 bool operator!=( const Cost &other ) const; 37 36 friend std::ostream &operator<<( std::ostream &os, const Cost &cost ); 38 37 39 38 static const Cost zero; 40 39 static const Cost infinity; 41 42 static const Cost unsafe;43 static const Cost poly;44 static const Cost safe;45 static const Cost reference;46 40 private: 47 41 int compare( const Cost &other ) const; 48 42 49 int unsafeCost; 50 int polyCost; 51 int safeCost; 52 int referenceCost; 43 int unsafe; 44 int poly; 45 int safe; 53 46 }; 54 47 55 inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int referenceCost ) : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), referenceCost( referenceCost) {}48 inline Cost::Cost() : unsafe( 0 ), poly( 0 ), safe( 0 ) {} 56 49 57 inline Cost & Cost::incUnsafe( int inc ) {58 if ( *this == infinity ) return *this; 59 unsafeCost += inc;60 return *this;50 inline Cost::Cost( int unsafe, int poly, int safe ) : unsafe( unsafe ), poly( poly ), safe( safe ) {} 51 52 inline void Cost::incUnsafe( int inc ) { 53 unsafe += inc; 61 54 } 62 55 63 inline Cost & Cost::incPoly( int inc ) { 64 if ( *this == infinity ) return *this; 65 polyCost += inc; 66 return *this; 56 inline void Cost::incPoly( int inc ) { 57 poly += inc; 67 58 } 68 59 69 inline Cost & Cost::incSafe( int inc ) { 70 if ( *this == infinity ) return *this; 71 safeCost += inc; 72 return *this; 73 } 74 75 inline Cost & Cost::incReference( int inc ) { 76 if ( *this == infinity ) return *this; 77 referenceCost += inc; 78 return *this; 60 inline void Cost::incSafe( int inc ) { 61 safe += inc; 79 62 } 80 63 81 64 inline Cost Cost::operator+( const Cost &other ) const { 82 if ( *this == infinity || other == infinity ) return infinity; 83 return Cost( unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, referenceCost + other.referenceCost ); 65 return Cost( unsafe + other.unsafe, poly + other.poly, safe + other.safe ); 84 66 } 85 67 86 68 inline Cost Cost::operator-( const Cost &other ) const { 87 if ( *this == infinity || other == infinity ) return infinity; 88 return Cost( unsafeCost - other.unsafeCost, polyCost - other.polyCost, safeCost - other.safeCost, referenceCost - other.referenceCost ); 69 return Cost( unsafe - other.unsafe, poly - other.poly, safe - other.safe ); 89 70 } 90 71 91 72 inline Cost &Cost::operator+=( const Cost &other ) { 92 if ( *this == infinity ) return *this; 93 if ( other == infinity ) { 94 *this = infinity; 95 return *this; 96 } 97 unsafeCost += other.unsafeCost; 98 polyCost += other.polyCost; 99 safeCost += other.safeCost; 100 referenceCost += other.referenceCost; 73 unsafe += other.unsafe; 74 poly += other.poly; 75 safe += other.safe; 101 76 return *this; 102 77 } 103 78 104 79 inline bool Cost::operator<( const Cost &other ) const { 105 if ( *this == infinity ) return false; 106 if ( other == infinity ) return true; 107 108 if ( unsafeCost > other.unsafeCost ) { 80 if ( *this == infinity ) return false; 81 if ( other == infinity ) return true; 82 if ( unsafe > other.unsafe ) { 109 83 return false; 110 } else if ( unsafeCost < other.unsafeCost) {84 } else if ( unsafe < other.unsafe ) { 111 85 return true; 112 } else if ( polyCost > other.polyCost) {86 } else if ( poly > other.poly ) { 113 87 return false; 114 } else if ( polyCost < other.polyCost) {88 } else if ( poly < other.poly ) { 115 89 return true; 116 } else if ( safeCost > other.safeCost) {90 } else if ( safe > other.safe ) { 117 91 return false; 118 } else if ( safeCost < other.safeCost) {92 } else if ( safe < other.safe ) { 119 93 return true; 120 } else if ( referenceCost > other.referenceCost ){94 } else { 121 95 return false; 122 } else if ( referenceCost < other.referenceCost ) { 123 return true; 124 } else { 125 return false; 126 } // if 96 } // if 127 97 } 128 98 129 99 inline bool Cost::operator==( const Cost &other ) const { 130 return unsafeCost == other.unsafeCost 131 && polyCost == other.polyCost 132 && safeCost == other.safeCost 133 && referenceCost == other.referenceCost; 100 return unsafe == other.unsafe 101 && poly == other.poly 102 && safe == other.safe; 134 103 } 135 104 … … 139 108 140 109 inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) { 141 os << "( " << cost.unsafe Cost << ", " << cost.polyCost << ", " << cost.safeCost << ", " << cost.referenceCost<< " )";110 os << "( " << cost.unsafe << ", " << cost.poly << ", " << cost.safe << " )"; 142 111 return os; 143 112 } -
src/ResolvExpr/Unify.cc
r8217e8f rbd46af4 42 42 virtual void visit(PointerType *pointerType); 43 43 virtual void visit(ArrayType *arrayType); 44 virtual void visit(ReferenceType *refType);45 44 virtual void visit(FunctionType *functionType); 46 45 virtual void visit(StructInstType *aggregateUseType); … … 143 142 144 143 bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) { 145 // remove references from other, so that type variables can only bind to value types146 other = other->stripReferences();147 144 OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() ); 148 145 assert( tyvar != openVars.end() ); … … 379 376 } // if 380 377 } else { 381 common = type1->clone();382 common->get_qualifiers() = tq1 | tq2;383 378 result = true; 384 379 } // if … … 430 425 markAssertions( haveAssertions, needAssertions, pointerType ); 431 426 markAssertions( haveAssertions, needAssertions, otherPointer ); 432 } // if433 }434 435 void Unify::visit(ReferenceType *refType) {436 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {437 result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );438 markAssertions( haveAssertions, needAssertions, refType );439 markAssertions( haveAssertions, needAssertions, otherRef );440 427 } // if 441 428 } -
src/ResolvExpr/typeops.h
r8217e8f rbd46af4 66 66 Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 67 67 68 template< typename SrcIterator, typename DestIterator > 69 Cost castCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 70 Cost ret; 71 if ( destBegin == destEnd ) { 72 if ( srcBegin == srcEnd ) { 73 return Cost::zero; 74 } else { 75 return Cost( 0, 0, 1 ); 76 } // if 77 } // if 78 while ( srcBegin != srcEnd && destBegin != destEnd ) { 79 Cost thisCost = castCost( *srcBegin++, *destBegin++, indexer, env ); 80 if ( thisCost == Cost::infinity ) { 81 return Cost::infinity; 82 } // if 83 ret += thisCost; 84 } // while 85 if ( srcBegin == srcEnd && destBegin == destEnd ) { 86 return ret; 87 } else { 88 return Cost::infinity; 89 } // if 90 } 91 68 92 // in ConversionCost.cc 69 93 Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 94 95 template< typename SrcIterator, typename DestIterator > 96 Cost conversionCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env ) { 97 Cost ret; 98 while ( srcBegin != srcEnd && destBegin != destEnd ) { 99 Cost thisCost = conversionCost( *srcBegin++, *destBegin++, indexer, env ); 100 if ( thisCost == Cost::infinity ) { 101 return Cost::infinity; 102 } // if 103 ret += thisCost; 104 } // while 105 if ( srcBegin == srcEnd && destBegin == destEnd ) { 106 return ret; 107 } else { 108 return Cost::infinity; 109 } // if 110 } 70 111 71 112 // in PtrsAssignable.cc -
src/SymTab/Autogen.cc
r8217e8f rbd46af4 13 13 // Update Count : 62 14 14 // 15 16 15 #include "Autogen.h" 17 16 … … 24 23 25 24 #include "AddVisit.h" // for addVisit 26 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign27 25 #include "Common/ScopedMap.h" // for ScopedMap<>::const_iterator, Scope... 28 26 #include "Common/utility.h" // for cloneAll, operator+ … … 30 28 #include "GenPoly/ScopedSet.h" // for ScopedSet, ScopedSet<>::iterator 31 29 #include "SymTab/Mangler.h" // for Mangler 32 #include "SynTree/Attribute.h" // For Attribute33 30 #include "SynTree/Mutator.h" // for maybeMutate 34 31 #include "SynTree/Statement.h" // for CompoundStmt, ReturnStmt, ExprStmt … … 134 131 FunctionType * genDefaultType( Type * paramType ) { 135 132 FunctionType *ftype = new FunctionType( Type::Qualifiers(), false ); 136 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr );133 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr ); 137 134 ftype->get_parameters().push_back( dstParam ); 138 135 … … 154 151 ftype->get_returnVals().push_back( returnVal ); 155 152 return ftype; 153 } 154 155 /// true if the aggregate's layout is dynamic 156 template< typename AggrDecl > 157 bool hasDynamicLayout( AggrDecl * aggregateDecl ) { 158 for ( TypeDecl * param : aggregateDecl->get_parameters() ) { 159 if ( param->isComplete() ) return true; 160 } 161 return false; 156 162 } 157 163 … … 176 182 FunctionType * ftype = funcDecl->get_functionType(); 177 183 assert( ! ftype->get_parameters().empty() ); 178 Type * t = InitTweak::getPointerBase( ftype->get_parameters().front()->get_type() ); 179 assert( t ); 184 Type * t = safe_dynamic_cast< PointerType * >( ftype->get_parameters().front()->get_type() )->get_base(); 180 185 map.insert( Mangler::mangleType( t ), true ); 181 186 } … … 223 228 FunctionType * ftype = data.genType( refType ); 224 229 225 if(concurrent_type && CodeGen::isDestructor( data.fname )) {230 if(concurrent_type && InitTweak::isDestructor( data.fname )) { 226 231 ftype->get_parameters().front()->get_type()->set_mutex( true ); 227 232 } … … 275 280 FunctionType *copyCtorType = genCopyType( refType->clone() ); 276 281 277 // add unused attribute to parameters of default constructor and destructor278 ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );279 dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );280 281 282 // xxx - should we also generate void ?{}(E *, int) and E ?{}(E *, E)? 282 283 // right now these cases work, but that might change. … … 301 302 302 303 /// generates a single struct member operation (constructor call, destructor call, assignment call) 303 void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool forward = true ) { 304 void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool isDynamicLayout, bool forward = true ) { 305 ObjectDecl * returnVal = NULL; 306 if ( ! func->get_functionType()->get_returnVals().empty() ) { 307 returnVal = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_returnVals().front() ); 308 } 309 304 310 InitTweak::InitExpander srcParam( src ); 305 311 306 // assign to destination 307 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), safe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) ); 312 // assign to destination (and return value if generic) 313 UntypedExpr *derefExpr = UntypedExpr::createDeref( new VariableExpr( dstParam ) ); 314 Expression *dstselect = new MemberExpr( field, derefExpr ); 308 315 genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward ); 316 317 if ( isDynamicLayout && returnVal ) { 318 // xxx - there used to be a dereference on returnVal, but this seems to have been wrong? 319 Expression *retselect = new MemberExpr( field, new VariableExpr( returnVal ) ); 320 genImplicitCall( srcParam, retselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward ); 321 } // if 309 322 } 310 323 311 324 /// generates the body of a struct function by iterating the struct members (via parameters) - generates default ctor, copy ctor, assignment, and dtor bodies, but NOT field ctor bodies 312 325 template<typename Iterator> 313 void makeStructFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool forward = true ) {326 void makeStructFunctionBody( Iterator member, Iterator end, FunctionDecl * func, bool isDynamicLayout, bool forward = true ) { 314 327 for ( ; member != end; ++member ) { 315 328 if ( DeclarationWithType *field = dynamic_cast< DeclarationWithType * >( *member ) ) { // otherwise some form of type declaration, e.g. Aggregate … … 347 360 348 361 Expression *srcselect = srcParam ? new MemberExpr( field, new VariableExpr( srcParam ) ) : NULL; 349 makeStructMemberOp( dstParam, srcselect, field, func, forward );362 makeStructMemberOp( dstParam, srcselect, field, func, isDynamicLayout, forward ); 350 363 } // if 351 364 } // for … … 355 368 /// void ?{}(A *, int) and void?{}(A *, int, int) for a struct A which has two int fields. 356 369 template<typename Iterator> 357 void makeStructFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func ) {370 void makeStructFieldCtorBody( Iterator member, Iterator end, FunctionDecl * func, bool isDynamicLayout ) { 358 371 FunctionType * ftype = func->get_functionType(); 359 372 std::list<DeclarationWithType*> & params = ftype->get_parameters(); … … 381 394 // matching parameter, initialize field with copy ctor 382 395 Expression *srcselect = new VariableExpr(*parameter); 383 makeStructMemberOp( dstParam, srcselect, field, func );396 makeStructMemberOp( dstParam, srcselect, field, func, isDynamicLayout ); 384 397 ++parameter; 385 398 } else { 386 399 // no matching parameter, initialize field with default ctor 387 makeStructMemberOp( dstParam, NULL, field, func );400 makeStructMemberOp( dstParam, NULL, field, func, isDynamicLayout ); 388 401 } 389 402 } … … 401 414 // Make function polymorphic in same parameters as generic struct, if applicable 402 415 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 416 bool isDynamicLayout = hasDynamicLayout( aggregateDecl ); // NOTE this flag is an incredibly ugly kludge; we should fix the assignment signature instead (ditto for union) 403 417 404 418 // generate each of the functions based on the supplied FuncData objects … … 410 424 411 425 // field ctors are only generated if default constructor and copy constructor are both generated 412 unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } );426 unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return InitTweak::isConstructor( dcl->get_name() ); } ); 413 427 414 428 if ( functionNesting == 0 ) { … … 425 439 // generate appropriate calls to member ctor, assignment 426 440 // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor 427 if ( ! CodeGen::isDestructor( dcl->get_name() ) ) {428 makeStructFunctionBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), dcl );441 if ( ! InitTweak::isDestructor( dcl->get_name() ) ) { 442 makeStructFunctionBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), dcl, isDynamicLayout ); 429 443 } else { 430 makeStructFunctionBody( aggregateDecl->get_members().rbegin(), aggregateDecl->get_members().rend(), dcl, false );431 } 432 if ( CodeGen::isAssignment( dcl->get_name() ) ) {444 makeStructFunctionBody( aggregateDecl->get_members().rbegin(), aggregateDecl->get_members().rend(), dcl, isDynamicLayout, false ); 445 } 446 if ( InitTweak::isAssignment( dcl->get_name() ) ) { 433 447 // assignment needs to return a value 434 448 FunctionType * assignType = dcl->get_functionType(); … … 459 473 // our inheritance model. I think the correct way to handle this is to 460 474 // cast the structure to the type of the member and let the resolver 461 // figure out whether it's valid/choose the correct unnamed member 475 // figure out whether it's valid and have a pass afterwards that fixes 476 // the assignment to use pointer arithmetic with the offset of the 477 // member, much like how generic type members are handled. 462 478 continue; 463 479 } 464 480 memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), Type::StorageClasses(), LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) ); 465 481 FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting ); 466 makeStructFieldCtorBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), ctor );482 makeStructFieldCtorBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), ctor, isDynamicLayout ); 467 483 declsToAdd.push_back( ctor ); 468 484 } … … 475 491 void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) { 476 492 UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) ); 477 copy->get_args().push_back( new AddressExpr( new VariableExpr( dstParam )) );493 copy->get_args().push_back( new VariableExpr( dstParam ) ); 478 494 copy->get_args().push_back( new AddressExpr( new VariableExpr( srcParam ) ) ); 479 495 copy->get_args().push_back( new SizeofExpr( srcParam->get_type()->clone() ) ); … … 487 503 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 488 504 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() ); 505 ObjectDecl * returnVal = nullptr; 506 if ( ! ftype->get_returnVals().empty() ) { 507 returnVal = safe_dynamic_cast< ObjectDecl * >( ftype->get_returnVals().front() ); 508 } 489 509 490 510 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); 491 if ( CodeGen::isAssignment( funcDecl->get_name() ) ) { 492 // also generate return statement in assignment 511 if ( returnVal ) { 493 512 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 494 513 } … … 517 536 cloneAll( typeParams, copyCtorType->get_forall() ); 518 537 cloneAll( typeParams, assignType->get_forall() ); 519 520 // add unused attribute to parameters of default constructor and destructor521 ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );522 dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );523 538 524 539 // Routines at global scope marked "static" to prevent multiple definitions is separate translation units -
src/SymTab/Autogen.h
r8217e8f rbd46af4 43 43 extern Type * SizeType; 44 44 45 /// intrinsic dereference operator for unqualified types - set when *? function is seen in FindSpecialDeclarations.46 /// Useful for creating dereference ApplicationExprs without a full resolver pass.47 extern FunctionDecl * dereferenceOperator;48 49 // temporary50 FunctionType * genAssignType( Type * paramType );51 52 45 /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls. 53 46 template< typename OutputIterator > … … 58 51 template< typename OutputIterator > 59 52 Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) { 60 // want to be able to generate assignment, ctor, and dtor generically,61 // so fname is either ?=?, ?{}, or ^?{}62 UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );53 // want to be able to generate assignment, ctor, and dtor generically, 54 // so fname is either ?=?, ?{}, or ^?{} 55 UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) ); 63 56 64 if ( addCast ) { 65 // cast to T& with qualifiers removed, so that qualified objects can be constructed 66 // and destructed with the same functions as non-qualified objects. 67 // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument 68 // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever 69 // remove lvalue as a qualifier, this can change to 70 // type->get_qualifiers() = Type::Qualifiers(); 71 assert( type ); 72 Type * castType = type->clone(); 73 castType->get_qualifiers() -= Type::Qualifiers( Type::Lvalue | Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 74 // castType->set_lvalue( true ); // xxx - might not need this 75 dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) ); 76 } 77 fExpr->get_args().push_back( dstParam ); 57 // do something special for unnamed members 58 dstParam = new AddressExpr( dstParam ); 59 if ( addCast ) { 60 // cast to T* with qualifiers removed, so that qualified objects can be constructed 61 // and destructed with the same functions as non-qualified objects. 62 // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument 63 // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever 64 // remove lvalue as a qualifier, this can change to 65 // type->get_qualifiers() = Type::Qualifiers(); 66 assert( type ); 67 Type * castType = type->clone(); 68 castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 69 castType->set_lvalue( true ); // xxx - might not need this 70 dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) ); 71 } 72 fExpr->get_args().push_back( dstParam ); 78 73 79 Statement * listInit = srcParam.buildListInit( fExpr );74 Statement * listInit = srcParam.buildListInit( fExpr ); 80 75 81 std::list< Expression * > args = *++srcParam;82 fExpr->get_args().splice( fExpr->get_args().end(), args );76 std::list< Expression * > args = *++srcParam; 77 fExpr->get_args().splice( fExpr->get_args().end(), args ); 83 78 84 *out++ = new ExprStmt( noLabels, fExpr );79 *out++ = new ExprStmt( noLabels, fExpr ); 85 80 86 srcParam.clearArrayIndices();81 srcParam.clearArrayIndices(); 87 82 88 return listInit;83 return listInit; 89 84 } 90 85 … … 122 117 123 118 UntypedExpr *inc = new UntypedExpr( update ); 124 inc->get_args().push_back( new VariableExpr( index) );119 inc->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) ); 125 120 126 121 UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) ); -
src/SymTab/Indexer.cc
r8217e8f rbd46af4 23 23 #include <utility> // for pair, make_pair, move 24 24 25 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign26 25 #include "Common/SemanticError.h" // for SemanticError 27 26 #include "Common/utility.h" // for cloneAll … … 112 111 void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const { 113 112 // only need to perform this step for constructors, destructors, and assignment functions 114 if ( ! CodeGen::isCtorDtorAssign( id ) ) return;113 if ( ! InitTweak::isCtorDtorAssign( id ) ) return; 115 114 116 115 // helpful data structure … … 140 139 decls.push_back( DeclBall{ function, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } ); 141 140 existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc; 142 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) );141 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && InitTweak::isConstructor( function->get_name() ) ); 143 142 existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor); 144 143 existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc); … … 158 157 assert( ! params.empty() ); 159 158 // use base type of pointer, so that qualifiers on the pointer type aren't considered. 160 Type * base = InitTweak::getPointerBase( params.front()->get_type() ); 161 assert( base ); 159 Type * base = safe_dynamic_cast< PointerType * >( params.front()->get_type() )->get_base(); 162 160 funcMap[ Mangler::mangle( base ) ] += function; 163 161 } else { -
src/SymTab/Mangler.cc
r8217e8f rbd46af4 131 131 mangleName << "A0"; 132 132 maybeAccept( arrayType->get_base(), *this ); 133 }134 135 void Mangler::visit( ReferenceType *refType ) {136 printQualifiers( refType );137 mangleName << "R";138 maybeAccept( refType->get_base(), *this );139 133 } 140 134 … … 308 302 // Removed due to restrict not affecting function compatibility in GCC 309 303 // if ( type->get_isRestrict() ) { 310 // mangleName << " E";304 // mangleName << "R"; 311 305 // } // if 312 306 if ( type->get_lvalue() ) { -
src/SymTab/Mangler.h
r8217e8f rbd46af4 42 42 virtual void visit( PointerType *pointerType ); 43 43 virtual void visit( ArrayType *arrayType ); 44 virtual void visit( ReferenceType *refType );45 44 virtual void visit( FunctionType *functionType ); 46 45 virtual void visit( StructInstType *aggregateUseType ); -
src/SymTab/Validate.cc
r8217e8f rbd46af4 54 54 #include "Autogen.h" // for SizeType, autogenerateRoutines 55 55 #include "CodeGen/CodeGenerator.h" // for genName 56 #include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign57 56 #include "Common/PassVisitor.h" // for PassVisitor, WithDeclsToAdd 58 57 #include "Common/ScopedMap.h" // for ScopedMap<>::const_iterator … … 240 239 }; 241 240 242 243 FunctionDecl * dereferenceOperator = nullptr;244 struct FindSpecialDeclarations final {245 void previsit( FunctionDecl * funcDecl );246 };247 248 241 void validate( std::list< Declaration * > &translationUnit, bool doDebug ) { 249 242 PassVisitor<EnumAndPointerDecay> epc; … … 252 245 PassVisitor<CompoundLiteral> compoundliteral; 253 246 PassVisitor<ValidateGenericParameters> genericParams; 254 PassVisitor<FindSpecialDeclarations> finder;255 247 256 248 EliminateTypedef::eliminateTypedef( translationUnit ); … … 269 261 acceptAll( translationUnit, fpd ); 270 262 ArrayLength::computeLength( translationUnit ); 271 acceptAll( translationUnit, finder );272 263 } 273 264 … … 830 821 std::list< DeclarationWithType * > ¶ms = funcType->get_parameters(); 831 822 832 if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc.823 if ( InitTweak::isCtorDtorAssign( funcDecl->get_name() ) ) { 833 824 if ( params.size() == 0 ) { 834 825 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl ); 835 826 } 836 ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() );837 if ( ! refType) {838 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference", funcDecl );827 PointerType * ptrType = dynamic_cast< PointerType * >( params.front()->get_type() ); 828 if ( ! ptrType || ptrType->is_array() ) { 829 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer ", funcDecl ); 839 830 } 840 if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {831 if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { 841 832 throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl ); 842 833 } … … 954 945 } 955 946 } 956 957 void FindSpecialDeclarations::previsit( FunctionDecl * funcDecl ) {958 if ( ! dereferenceOperator ) {959 if ( funcDecl->get_name() == "*?" && funcDecl->get_linkage() == LinkageSpec::Intrinsic ) {960 FunctionType * ftype = funcDecl->get_functionType();961 if ( ftype->get_parameters().size() == 1 && ftype->get_parameters().front()->get_type()->get_qualifiers() == Type::Qualifiers() ) {962 dereferenceOperator = funcDecl;963 }964 }965 }966 }967 947 } // namespace SymTab 968 948 -
src/SynTree/AddressExpr.cc
r8217e8f rbd46af4 18 18 #include "Common/utility.h" 19 19 20 // Address expressions are typed based on the following inference rules:21 // E : lvalue T &..& (n references)22 // &E : T *&..& (n references)23 //24 // E : T &..& (m references)25 // &E : T *&..& (m-1 references)26 //27 // That is, lvalues becomes28 29 namespace {30 Type * addrType( Type * type ) {31 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) {32 return new ReferenceType( refType->get_qualifiers(), addrType( refType->get_base() ) );33 } else {34 return new PointerType( Type::Qualifiers(), type->clone() );35 }36 }37 }38 39 20 AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) { 40 21 if ( arg->has_result() ) { 41 if ( arg->get_result()->get_lvalue() ) { 42 // lvalue, retains all layers of reference and gains a pointer inside the references 43 set_result( addrType( arg->get_result() ) ); 44 } else { 45 // taking address of non-lvalue -- must be a reference, loses one layer of reference 46 ReferenceType * refType = safe_dynamic_cast< ReferenceType * >( arg->get_result() ); 47 set_result( addrType( refType->get_base() ) ); 48 } 49 // result of & is never an lvalue 50 get_result()->set_lvalue( false ); 22 set_result( new PointerType( Type::Qualifiers(), arg->get_result()->clone() ) ); 51 23 } 52 24 } -
src/SynTree/ApplicationExpr.cc
r8217e8f rbd46af4 44 44 } 45 45 46 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list< Expression *> & args ) : function( funcExpr ), args( args) {46 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list< Expression * > & argList ) : function( funcExpr ), args( argList ) { 47 47 PointerType *pointer = safe_dynamic_cast< PointerType* >( funcExpr->get_result() ); 48 48 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); -
src/SynTree/Expression.cc
r8217e8f rbd46af4 34 34 #include "InitTweak/InitTweak.h" 35 35 36 #include "GenPoly/Lvalue.h"37 36 38 37 Expression::Expression( Expression *_aname ) : result( 0 ), env( 0 ), argName( _aname ) {} … … 93 92 } 94 93 95 VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) {96 VariableExpr * funcExpr = new VariableExpr( func );97 funcExpr->set_result( new PointerType( Type::Qualifiers(), funcExpr->get_result() ) );98 return funcExpr;99 }100 101 94 void VariableExpr::print( std::ostream &os, int indent ) const { 102 95 os << "Variable Expression: "; … … 159 152 160 153 void AlignofExpr::print( std::ostream &os, int indent) const { 161 os << "Alignof Expression on: ";154 os << std::string( indent, ' ' ) << "Alignof Expression on: "; 162 155 163 156 if (isType) … … 268 261 269 262 void AttrExpr::print( std::ostream &os, int indent) const { 270 os << "Attr ";263 os << std::string( indent, ' ' ) << "Attr "; 271 264 attr->print( os, indent + 2 ); 272 265 if ( isType || expr ) { … … 367 360 namespace { 368 361 TypeSubstitution makeSub( Type * t ) { 369 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) { 370 return makeSub( refType->get_base() ); 371 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 362 if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 372 363 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->get_parameters().begin() ); 373 364 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) { … … 434 425 if ( Type * type = expr->get_result() ) { 435 426 Type * base = InitTweak::getPointerBase( type ); 436 assertf( base, "expected pointer type in dereference (type was %s)", toString( type ).c_str() ); 437 ret->set_result( base->clone() ); 438 if ( GenPoly::referencesPermissable() ) { 439 // if references are still allowed in the AST, dereference returns a reference 440 ret->set_result( new ReferenceType( Type::Qualifiers(), ret->get_result() ) ); 441 } else { 442 // references have been removed, in which case dereference returns an lvalue of the base type. 443 ret->get_result()->set_lvalue( true ); 427 if ( ! base ) { 428 std::cerr << type << std::endl; 444 429 } 430 assertf( base, "expected pointer type in dereference\n" ); 431 ret->set_result( maybeClone( base ) ); 445 432 } 446 433 return ret; … … 506 493 507 494 void LogicalExpr::print( std::ostream &os, int indent )const { 508 os << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";495 os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: "; 509 496 arg1->print(os); 510 497 os << " and "; -
src/SynTree/Expression.h
r8217e8f rbd46af4 280 280 void set_var( DeclarationWithType * newValue ) { var = newValue; } 281 281 282 static VariableExpr * functionPointer( FunctionDecl * decl );283 284 282 virtual VariableExpr * clone() const { return new VariableExpr( * this ); } 285 283 virtual void accept( Visitor & v ) { v.visit( this ); } -
src/SynTree/Mutator.cc
r8217e8f rbd46af4 480 480 } 481 481 482 Type *Mutator::mutate( ReferenceType *refType ) {483 mutateAll( refType->get_forall(), *this );484 refType->set_base( maybeMutate( refType->get_base(), *this ) );485 return refType;486 }487 488 482 Type *Mutator::mutate( FunctionType *functionType ) { 489 483 mutateAll( functionType->get_forall(), *this ); -
src/SynTree/Mutator.h
r8217e8f rbd46af4 92 92 virtual Type* mutate( PointerType *pointerType ); 93 93 virtual Type* mutate( ArrayType *arrayType ); 94 virtual Type* mutate( ReferenceType *refType );95 94 virtual Type* mutate( FunctionType *functionType ); 96 95 virtual Type* mutate( StructInstType *aggregateUseType ); -
src/SynTree/SynTree.h
r8217e8f rbd46af4 101 101 class PointerType; 102 102 class ArrayType; 103 class ReferenceType;104 103 class FunctionType; 105 104 class ReferenceToType; -
src/SynTree/Type.cc
r8217e8f rbd46af4 65 65 const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" }; 66 66 67 Type * Type::stripDeclarator() {67 Type *Type::stripDeclarator() { 68 68 Type * type = this; 69 69 while ( Type * at = InitTweak::getPointerBase( type ) ) { … … 72 72 return type; 73 73 } 74 75 Type * Type::stripReferences() {76 Type * type = this;77 while ( ReferenceType * ref = dynamic_cast<ReferenceType *>( type ) ) {78 type = ref->get_base();79 }80 return type;81 }82 83 int Type::referenceDepth() const { return 0; }84 74 85 75 void Type::print( std::ostream &os, int indent ) const { -
src/SynTree/Type.h
r8217e8f rbd46af4 162 162 163 163 /// return type without outer pointers and arrays 164 Type * stripDeclarator(); 165 166 /// return type without outer references 167 Type * stripReferences(); 168 169 /// return the number of references occuring consecutively on the outermost layer of this type (i.e. do not count references nested within other types) 170 virtual int referenceDepth() const; 164 Type *stripDeclarator(); 171 165 172 166 virtual bool isComplete() const { return true; } … … 262 256 bool is_array() const { return isStatic || isVarLen || dimension; } 263 257 264 virtual bool isComplete() const { return ! isVarLen; }265 266 258 virtual PointerType *clone() const { return new PointerType( *this ); } 267 259 virtual void accept( Visitor & v ) { v.visit( this ); } … … 298 290 }; 299 291 300 class ReferenceType : public Type {301 public:302 Type *base;303 304 ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() );305 ReferenceType( const ReferenceType & );306 virtual ~ReferenceType();307 308 Type *get_base() { return base; }309 void set_base( Type *newValue ) { base = newValue; }310 311 virtual int referenceDepth() const;312 313 virtual ReferenceType *clone() const { return new ReferenceType( *this ); }314 virtual void accept( Visitor & v ) { v.visit( this ); }315 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }316 virtual void print( std::ostream & os, int indent = 0 ) const;317 };318 319 292 class FunctionType : public Type { 320 293 public: -
src/SynTree/TypeExpr.cc
r8217e8f rbd46af4 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // TypeExpr.cc -- 7 // TypeExpr.cc -- 8 8 // 9 9 // Author : Richard C. Bilson -
src/SynTree/Visitor.cc
r8217e8f rbd46af4 368 368 void Visitor::visit( PointerType *pointerType ) { 369 369 acceptAll( pointerType->get_forall(), *this ); 370 // xxx - should PointerType visit/mutate dimension?371 370 maybeAccept( pointerType->get_base(), *this ); 372 371 } … … 376 375 maybeAccept( arrayType->get_dimension(), *this ); 377 376 maybeAccept( arrayType->get_base(), *this ); 378 }379 380 void Visitor::visit( ReferenceType *refType ) {381 acceptAll( refType->get_forall(), *this );382 maybeAccept( refType->get_base(), *this );383 377 } 384 378 -
src/SynTree/Visitor.h
r8217e8f rbd46af4 95 95 virtual void visit( PointerType *pointerType ); 96 96 virtual void visit( ArrayType *arrayType ); 97 virtual void visit( ReferenceType *refType );98 97 virtual void visit( FunctionType *functionType ); 99 98 virtual void visit( StructInstType *aggregateUseType ); -
src/SynTree/module.mk
r8217e8f rbd46af4 20 20 SynTree/PointerType.cc \ 21 21 SynTree/ArrayType.cc \ 22 SynTree/ReferenceType.cc \23 22 SynTree/FunctionType.cc \ 24 23 SynTree/ReferenceToType.cc \ -
src/Tuples/Explode.h
r8217e8f rbd46af4 26 26 27 27 namespace Tuples { 28 /// helper function used by explode to properly distribute 29 /// '&' across a tuple expression 30 Expression * distributeAddr( Expression * expr ); 31 28 32 /// helper function used by explode 29 33 template< typename OutputIterator > 30 34 void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, const SymTab::Indexer & indexer, OutputIterator out, bool isTupleAssign ) { 31 Type * res = expr->get_result()->stripReferences(); 35 if ( isTupleAssign ) { 36 // tuple assignment needs AddressExprs to be recursively exploded to easily get at all of the components 37 if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) { 38 ResolvExpr::AltList alts; 39 explodeUnique( addrExpr->get_arg(), alt, indexer, back_inserter( alts ), isTupleAssign ); 40 for ( ResolvExpr::Alternative & alt : alts ) { 41 // distribute '&' over all components 42 alt.expr = distributeAddr( alt.expr ); 43 *out++ = alt; 44 } 45 // in tuple assignment, still need to handle the other cases, but only if not already handled here (don't want to output too many alternatives) 46 return; 47 } 48 } 49 Type * res = expr->get_result(); 32 50 if ( TupleType * tupleType = dynamic_cast< TupleType * > ( res ) ) { 33 51 if ( TupleExpr * tupleExpr = dynamic_cast< TupleExpr * >( expr ) ) { … … 37 55 } 38 56 } else { 39 // tuple type, but not tuple expr - recursively index into its components. 40 // if expr type is reference, convert to value type 57 // tuple type, but not tuple expr - recursively index into its components 41 58 Expression * arg = expr->clone(); 42 43 if ( dynamic_cast<ReferenceType *>( arg->get_result() ) ) {44 // TODO: does this go here (inside uniqueexpr) or outside uniqueexpr? I'm guessing probably should go after...45 arg = new CastExpr( arg, tupleType->clone() );46 }47 59 if ( Tuples::maybeImpure( arg ) && ! dynamic_cast< UniqueExpr * >( arg ) ) { 48 60 // expressions which may contain side effects require a single unique instance of the expression. -
src/Tuples/TupleAssignment.cc
r8217e8f rbd46af4 22 22 #include "Explode.h" 23 23 #include "Common/SemanticError.h" 24 #include "CodeGen/OperatorTable.h"25 24 #include "InitTweak/InitTweak.h" 26 25 #include "InitTweak/GenInit.h" … … 78 77 if ( ! expr ) return false; 79 78 assert( expr->has_result() ); 80 return dynamic_cast< TupleType * >( expr->get_result() ->stripReferences());79 return dynamic_cast< TupleType * >( expr->get_result() ); 81 80 } 82 81 … … 90 89 } 91 90 92 bool refToTuple( Expression *expr ) { 93 assert( expr->get_result() ); 91 bool pointsToTuple( Expression *expr ) { 94 92 // also check for function returning tuple of reference types 95 93 if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) { 96 return refToTuple( castExpr->get_arg() );97 } else {98 return isTuple( expr);94 return pointsToTuple( castExpr->get_arg() ); 95 } else if ( AddressExpr *addr = dynamic_cast< AddressExpr * >( expr) ) { 96 return isTuple( addr->get_arg() ); 99 97 } 100 98 return false; … … 111 109 void TupleAssignSpotter::spot( UntypedExpr * expr, const std::list<ResolvExpr::AltList> &possibilities ) { 112 110 if ( NameExpr *op = dynamic_cast< NameExpr * >(expr->get_function()) ) { 113 if ( CodeGen::isCtorDtorAssign( op->get_name() ) ) {111 if ( InitTweak::isCtorDtorAssign( op->get_name() ) ) { 114 112 fname = op->get_name(); 115 113 for ( std::list<ResolvExpr::AltList>::const_iterator ali = possibilities.begin(); ali != possibilities.end(); ++ali ) { 116 114 if ( ali->size() == 0 ) continue; // AlternativeFinder will natrually handle this case, if it's legal 117 if ( ali->size() <= 1 && CodeGen::isAssignment( op->get_name() ) ) {115 if ( ali->size() <= 1 && InitTweak::isAssignment( op->get_name() ) ) { 118 116 // what does it mean if an assignment takes 1 argument? maybe someone defined such a function, in which case AlternativeFinder will naturally handle it 119 117 continue; … … 124 122 const ResolvExpr::Alternative & alt1 = ali->front(); 125 123 auto begin = std::next(ali->begin(), 1), end = ali->end(); 126 if ( refToTuple(alt1.expr) ) {124 if ( pointsToTuple(alt1.expr) ) { 127 125 if ( isMultAssign( begin, end ) ) { 128 126 matcher.reset( new MultipleAssignMatcher( *this, *ali ) ); … … 198 196 for ( ResolvExpr::Alternative & alt : lhs ) { 199 197 Expression *& expr = alt.expr; 200 Type * type = expr->get_result()->clone(); 198 Type * castType = expr->get_result()->clone(); 199 Type * type = InitTweak::getPointerBase( castType ); 200 assert( type ); 201 201 type->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 202 expr = new CastExpr( expr, new ReferenceType( Type::Qualifiers(), type ) ); 203 } 204 } 205 206 for ( ResolvExpr::Alternative & alt : lhs ) { 207 // every LHS value must be a reference - some come in with a cast expression, if it doesn't just cast to reference here. 208 // TODO: can this somehow be merge with the cast code directly above? 209 if ( ! dynamic_cast< ReferenceType * >( alt.expr->get_result() ) ) { 210 alt.expr = new CastExpr( alt.expr, new ReferenceType( Type::Qualifiers(), alt.expr->get_result()->clone() ) ); 202 type->set_lvalue( true ); // xxx - might not need this 203 expr = new CastExpr( expr, castType ); 211 204 } 212 205 } … … 228 221 assert( left ); 229 222 std::list< Expression * > args; 230 args.push_back( new VariableExpr( left) );223 args.push_back( new AddressExpr( UntypedExpr::createDeref( new VariableExpr( left ) ) ) ); 231 224 // args.push_back( new AddressExpr( new VariableExpr( left ) ) ); 232 225 if ( right ) args.push_back( new VariableExpr( right ) ); … … 248 241 assert( expr->has_result() && ! expr->get_result()->isVoid() ); 249 242 ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) ); 250 // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient. 251 if ( ! dynamic_cast< ReferenceType * >( expr->get_result() ) ) { 252 ConstructorInit * ctorInit = InitTweak::genCtorInit( ret ); 253 ret->set_init( ctorInit ); 254 ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object 255 EnvRemover rm; // remove environments from subexpressions of StmtExprs 256 ctorInit->accept( rm ); 257 } 243 ConstructorInit * ctorInit = InitTweak::genCtorInit( ret ); 244 ret->set_init( ctorInit ); 245 ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object 246 EnvRemover rm; // remove environments from subexpressions of StmtExprs 247 ctorInit->accept( rm ); 258 248 return ret; 259 249 } -
src/libcfa/concurrency/alarm.c
r8217e8f rbd46af4 40 40 __cfa_time_t zero_time = { 0 }; 41 41 42 void ?{}( __cfa_time_t & this ) { this.val = 0; }43 void ?{}( __cfa_time_t & this, zero_t zero ) { this.val = 0; }44 45 void ?{}( itimerval &this, __cfa_time_t * alarm ) {46 this .it_value.tv_sec = alarm->val / one_second; // seconds47 this .it_value.tv_usec = max( (alarm->val % one_second) / one_microsecond, 1000 ); // microseconds48 this .it_interval.tv_sec = 0;49 this .it_interval.tv_usec = 0;50 } 51 52 53 void ?{}( __cfa_time_t &this, timespec * curr ) {42 void ?{}( __cfa_time_t * this ) { this->val = 0; } 43 void ?{}( __cfa_time_t * this, zero_t zero ) { this->val = 0; } 44 45 void ?{}( itimerval * this, __cfa_time_t * alarm ) { 46 this->it_value.tv_sec = alarm->val / one_second; // seconds 47 this->it_value.tv_usec = max( (alarm->val % one_second) / one_microsecond, 1000 ); // microseconds 48 this->it_interval.tv_sec = 0; 49 this->it_interval.tv_usec = 0; 50 } 51 52 53 void ?{}( __cfa_time_t * this, timespec * curr ) { 54 54 uint64_t secs = curr->tv_sec; 55 55 uint64_t nsecs = curr->tv_nsec; 56 this .val = (secs * one_second) + nsecs;57 } 58 59 __cfa_time_t ?=?( __cfa_time_t &this, zero_t rhs ) {60 this .val = 0;61 return this;56 this->val = (secs * one_second) + nsecs; 57 } 58 59 __cfa_time_t ?=?( __cfa_time_t * this, zero_t rhs ) { 60 this->val = 0; 61 return *this; 62 62 } 63 63 … … 86 86 //============================================================================================= 87 87 88 void ?{}( alarm_node_t &this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {89 this .thrd = thrd;90 this .alarm = alarm;91 this .period = period;92 this .next = 0;93 this .set = false;94 this .kernel_alarm = false;95 } 96 97 void ?{}( alarm_node_t &this, processor * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {98 this .proc = proc;99 this .alarm = alarm;100 this .period = period;101 this .next = 0;102 this .set = false;103 this .kernel_alarm = true;104 } 105 106 void ^?{}( alarm_node_t &this ) {107 if( this .set ) {108 unregister_self( &this );88 void ?{}( alarm_node_t * this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) { 89 this->thrd = thrd; 90 this->alarm = alarm; 91 this->period = period; 92 this->next = 0; 93 this->set = false; 94 this->kernel_alarm = false; 95 } 96 97 void ?{}( alarm_node_t * this, processor * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) { 98 this->proc = proc; 99 this->alarm = alarm; 100 this->period = period; 101 this->next = 0; 102 this->set = false; 103 this->kernel_alarm = true; 104 } 105 106 void ^?{}( alarm_node_t * this ) { 107 if( this->set ) { 108 unregister_self( this ); 109 109 } 110 110 } -
src/libcfa/concurrency/alarm.h
r8217e8f rbd46af4 36 36 37 37 // ctors 38 void ?{}( __cfa_time_t &this );39 void ?{}( __cfa_time_t &this, zero_t zero );40 void ?{}( __cfa_time_t &this, timespec * curr );41 void ?{}( itimerval &this, __cfa_time_t * alarm );38 void ?{}( __cfa_time_t * this ); 39 void ?{}( __cfa_time_t * this, zero_t zero ); 40 void ?{}( __cfa_time_t * this, timespec * curr ); 41 void ?{}( itimerval * this, __cfa_time_t * alarm ); 42 42 43 __cfa_time_t ?=?( __cfa_time_t &this, zero_t rhs );43 __cfa_time_t ?=?( __cfa_time_t * this, zero_t rhs ); 44 44 45 45 // logical ops … … 105 105 typedef alarm_node_t ** __alarm_it_t; 106 106 107 void ?{}( alarm_node_t &this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time );108 void ?{}( alarm_node_t &this, processor * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time );109 void ^?{}( alarm_node_t &this );107 void ?{}( alarm_node_t * this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ); 108 void ?{}( alarm_node_t * this, processor * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ); 109 void ^?{}( alarm_node_t * this ); 110 110 111 111 struct alarm_list_t { … … 114 114 }; 115 115 116 static inline void ?{}( alarm_list_t &this ) {117 this .head = 0;118 this .tail = &this.head;116 static inline void ?{}( alarm_list_t * this ) { 117 this->head = 0; 118 this->tail = &this->head; 119 119 } 120 120 -
src/libcfa/concurrency/coroutine
r8217e8f rbd46af4 25 25 // Anything that is resumed is a coroutine. 26 26 trait is_coroutine(dtype T) { 27 void main(T &this);28 coroutine_desc * get_coroutine(T &this);27 void main(T * this); 28 coroutine_desc * get_coroutine(T * this); 29 29 }; 30 30 31 #define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X & this) { return &this.__cor; } void main(X&this)31 #define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X* this) { return &this->__cor; } void main(X* this) 32 32 33 33 //----------------------------------------------------------------------------- 34 34 // Ctors and dtors 35 void ?{}(coStack_t &this);36 void ?{}(coroutine_desc &this);37 void ?{}(coroutine_desc &this, const char * name);38 void ^?{}(coStack_t &this);39 void ^?{}(coroutine_desc &this);35 void ?{}(coStack_t * this); 36 void ?{}(coroutine_desc * this); 37 void ?{}(coroutine_desc * this, const char * name); 38 void ^?{}(coStack_t * this); 39 void ^?{}(coroutine_desc * this); 40 40 41 41 //----------------------------------------------------------------------------- … … 44 44 45 45 forall(dtype T | is_coroutine(T)) 46 static inline void resume(T &cor);46 static inline void resume(T * cor); 47 47 48 48 forall(dtype T | is_coroutine(T)) 49 void prime(T &cor);49 void prime(T * cor); 50 50 51 51 //----------------------------------------------------------------------------- … … 86 86 // Resume implementation inlined for performance 87 87 forall(dtype T | is_coroutine(T)) 88 static inline void resume(T &cor) {88 static inline void resume(T * cor) { 89 89 coroutine_desc * src = this_coroutine; // optimization 90 90 coroutine_desc * dst = get_coroutine(cor); … … 92 92 if( unlikely(!dst->stack.base) ) { 93 93 create_stack(&dst->stack, dst->stack.size); 94 CtxStart( &cor, CtxInvokeCoroutine);94 CtxStart(cor, CtxInvokeCoroutine); 95 95 } 96 96 -
src/libcfa/concurrency/coroutine.c
r8217e8f rbd46af4 40 40 //----------------------------------------------------------------------------- 41 41 // Coroutine ctors and dtors 42 void ?{}(coStack_t &this) {43 this .size = 65000; // size of stack44 this .storage = NULL; // pointer to stack45 this .limit = NULL; // stack grows towards stack limit46 this .base = NULL; // base of stack47 this .context = NULL; // address of cfa_context_t48 this .top = NULL; // address of top of storage49 this .userStack = false;42 void ?{}(coStack_t* this) { 43 this->size = 65000; // size of stack 44 this->storage = NULL; // pointer to stack 45 this->limit = NULL; // stack grows towards stack limit 46 this->base = NULL; // base of stack 47 this->context = NULL; // address of cfa_context_t 48 this->top = NULL; // address of top of storage 49 this->userStack = false; 50 50 } 51 51 52 void ?{}(coStack_t &this, size_t size) {52 void ?{}(coStack_t* this, size_t size) { 53 53 this{}; 54 this .size = size;54 this->size = size; 55 55 56 create_stack( &this, this.size);56 create_stack(this, this->size); 57 57 } 58 58 59 void ?{}(coroutine_desc &this) {59 void ?{}(coroutine_desc* this) { 60 60 this{ "Anonymous Coroutine" }; 61 61 } 62 62 63 void ?{}(coroutine_desc &this, const char * name) {64 this .name = name;65 this .errno_ = 0;66 this .state = Start;67 this .starter = NULL;68 this .last = NULL;63 void ?{}(coroutine_desc* this, const char * name) { 64 this->name = name; 65 this->errno_ = 0; 66 this->state = Start; 67 this->starter = NULL; 68 this->last = NULL; 69 69 } 70 70 71 void ?{}(coroutine_desc &this, size_t size) {71 void ?{}(coroutine_desc* this, size_t size) { 72 72 this{}; 73 ( this.stack){size};73 (&this->stack){size}; 74 74 } 75 75 76 void ^?{}(coStack_t &this) {77 if ( ! this .userStack ) {76 void ^?{}(coStack_t* this) { 77 if ( ! this->userStack ) { 78 78 LIB_DEBUG_DO( 79 if ( mprotect( this .storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) {80 abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );79 if ( mprotect( this->storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) { 80 abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", this, errno, strerror( errno ) ); 81 81 } 82 82 ); 83 free( this .storage );83 free( this->storage ); 84 84 } 85 85 } 86 86 87 void ^?{}(coroutine_desc &this) {}87 void ^?{}(coroutine_desc* this) {} 88 88 89 89 // Part of the Public API 90 90 // Not inline since only ever called once per coroutine 91 91 forall(dtype T | is_coroutine(T)) 92 void prime(T &cor) {92 void prime(T* cor) { 93 93 coroutine_desc* this = get_coroutine(cor); 94 94 assert(this->state == Start); -
src/libcfa/concurrency/invoke.h
r8217e8f rbd46af4 47 47 #ifdef __CFORALL__ 48 48 extern "Cforall" { 49 void ?{}( struct __thread_queue_t &);49 void ?{}( struct __thread_queue_t * ); 50 50 void append( struct __thread_queue_t *, struct thread_desc * ); 51 51 struct thread_desc * pop_head( struct __thread_queue_t * ); 52 52 53 void ?{}( struct __condition_stack_t &);53 void ?{}( struct __condition_stack_t * ); 54 54 void push( struct __condition_stack_t *, struct __condition_criterion_t * ); 55 55 struct __condition_criterion_t * pop( struct __condition_stack_t * ); 56 56 57 void ?{}(spinlock &this);58 void ^?{}(spinlock &this);57 void ?{}(spinlock * this); 58 void ^?{}(spinlock * this); 59 59 } 60 60 #endif -
src/libcfa/concurrency/kernel
r8217e8f rbd46af4 37 37 }; 38 38 39 void ?{}(semaphore &this, int count = 1);40 void ^?{}(semaphore &this);39 void ?{}(semaphore * this, int count = 1); 40 void ^?{}(semaphore * this); 41 41 void P(semaphore * this); 42 42 void V(semaphore * this); … … 51 51 }; 52 52 53 void ?{}(cluster &this);54 void ^?{}(cluster &this);53 void ?{}(cluster * this); 54 void ^?{}(cluster * this); 55 55 56 56 //----------------------------------------------------------------------------- … … 68 68 unsigned short thrd_count; 69 69 }; 70 static inline void ?{}(FinishAction &this) {71 this .action_code = No_Action;72 this .thrd = NULL;73 this .lock = NULL;70 static inline void ?{}(FinishAction * this) { 71 this->action_code = No_Action; 72 this->thrd = NULL; 73 this->lock = NULL; 74 74 } 75 static inline void ^?{}(FinishAction &this) {}75 static inline void ^?{}(FinishAction * this) {} 76 76 77 77 // Processor … … 99 99 }; 100 100 101 void ?{}(processor &this);102 void ?{}(processor &this, cluster * cltr);103 void ^?{}(processor &this);101 void ?{}(processor * this); 102 void ?{}(processor * this, cluster * cltr); 103 void ^?{}(processor * this); 104 104 105 105 // Local Variables: // -
src/libcfa/concurrency/kernel.c
r8217e8f rbd46af4 73 73 }; 74 74 75 void ?{}( current_stack_info_t &this ) {76 CtxGet( this .ctx );77 this .base = this.ctx.FP;78 this .storage = this.ctx.SP;75 void ?{}( current_stack_info_t * this ) { 76 CtxGet( this->ctx ); 77 this->base = this->ctx.FP; 78 this->storage = this->ctx.SP; 79 79 80 80 rlimit r; 81 81 getrlimit( RLIMIT_STACK, &r); 82 this .size = r.rlim_cur;83 84 this .limit = (void *)(((intptr_t)this.base) - this.size);85 this .context = &storage_mainThreadCtx;86 this .top = this.base;87 } 88 89 void ?{}( coStack_t &this, current_stack_info_t * info) {90 this .size = info->size;91 this .storage = info->storage;92 this .limit = info->limit;93 this .base = info->base;94 this .context = info->context;95 this .top = info->top;96 this .userStack = true;97 } 98 99 void ?{}( coroutine_desc &this, current_stack_info_t * info) {100 ( this.stack){ info };101 this .name = "Main Thread";102 this .errno_ = 0;103 this .state = Start;104 } 105 106 void ?{}( thread_desc &this, current_stack_info_t * info) {107 ( this.cor){ info };82 this->size = r.rlim_cur; 83 84 this->limit = (void *)(((intptr_t)this->base) - this->size); 85 this->context = &storage_mainThreadCtx; 86 this->top = this->base; 87 } 88 89 void ?{}( coStack_t * this, current_stack_info_t * info) { 90 this->size = info->size; 91 this->storage = info->storage; 92 this->limit = info->limit; 93 this->base = info->base; 94 this->context = info->context; 95 this->top = info->top; 96 this->userStack = true; 97 } 98 99 void ?{}( coroutine_desc * this, current_stack_info_t * info) { 100 (&this->stack){ info }; 101 this->name = "Main Thread"; 102 this->errno_ = 0; 103 this->state = Start; 104 } 105 106 void ?{}( thread_desc * this, current_stack_info_t * info) { 107 (&this->cor){ info }; 108 108 } 109 109 110 110 //----------------------------------------------------------------------------- 111 111 // Processor coroutine 112 void ?{}(processorCtx_t &this, processor * proc) {113 ( this.__cor){ "Processor" };114 this .proc = proc;115 proc->runner = &this;116 } 117 118 void ?{}(processorCtx_t &this, processor * proc, current_stack_info_t * info) {119 ( this.__cor){ info };120 this .proc = proc;121 proc->runner = &this;122 } 123 124 void ?{}(processor &this) {112 void ?{}(processorCtx_t * this, processor * proc) { 113 (&this->__cor){ "Processor" }; 114 this->proc = proc; 115 proc->runner = this; 116 } 117 118 void ?{}(processorCtx_t * this, processor * proc, current_stack_info_t * info) { 119 (&this->__cor){ info }; 120 this->proc = proc; 121 proc->runner = this; 122 } 123 124 void ?{}(processor * this) { 125 125 this{ mainCluster }; 126 126 } 127 127 128 void ?{}(processor &this, cluster * cltr) {129 this .cltr = cltr;130 ( this.terminated){ 0 };131 this .do_terminate = false;132 this .preemption_alarm = NULL;133 this .pending_preemption = false;134 135 start( &this );136 } 137 138 void ?{}(processor & this, cluster * cltr, processorCtx_t &runner) {139 this .cltr = cltr;140 ( this.terminated){ 0 };141 this .do_terminate = false;142 this .preemption_alarm = NULL;143 this .pending_preemption = false;144 this .kernel_thread = pthread_self();145 146 this .runner = &runner;147 LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", &runner);148 runner{ &this };149 } 150 151 void ^?{}(processor &this) {152 if( ! this .do_terminate ) {153 LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", &this);154 this .do_terminate = true;155 P( &this .terminated );156 pthread_join( this .kernel_thread, NULL );157 } 158 } 159 160 void ?{}(cluster &this) {161 ( this.ready_queue ){};162 ( this.ready_queue_lock ){};163 164 this .preemption = default_preemption();165 } 166 167 void ^?{}(cluster &this) {128 void ?{}(processor * this, cluster * cltr) { 129 this->cltr = cltr; 130 (&this->terminated){ 0 }; 131 this->do_terminate = false; 132 this->preemption_alarm = NULL; 133 this->pending_preemption = false; 134 135 start( this ); 136 } 137 138 void ?{}(processor * this, cluster * cltr, processorCtx_t * runner) { 139 this->cltr = cltr; 140 (&this->terminated){ 0 }; 141 this->do_terminate = false; 142 this->preemption_alarm = NULL; 143 this->pending_preemption = false; 144 this->kernel_thread = pthread_self(); 145 146 this->runner = runner; 147 LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", runner); 148 runner{ this }; 149 } 150 151 void ^?{}(processor * this) { 152 if( ! this->do_terminate ) { 153 LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", this); 154 this->do_terminate = true; 155 P( &this->terminated ); 156 pthread_join( this->kernel_thread, NULL ); 157 } 158 } 159 160 void ?{}(cluster * this) { 161 ( &this->ready_queue ){}; 162 ( &this->ready_queue_lock ){}; 163 164 this->preemption = default_preemption(); 165 } 166 167 void ^?{}(cluster * this) { 168 168 169 169 } … … 173 173 //============================================================================================= 174 174 //Main of the processor contexts 175 void main(processorCtx_t &runner) {176 processor * this = runner .proc;175 void main(processorCtx_t * runner) { 176 processor * this = runner->proc; 177 177 178 178 LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this); … … 219 219 // from the processor coroutine to the target thread 220 220 void runThread(processor * this, thread_desc * dst) { 221 coroutine_desc * proc_cor = get_coroutine( *this->runner);221 coroutine_desc * proc_cor = get_coroutine(this->runner); 222 222 coroutine_desc * thrd_cor = get_coroutine(dst); 223 223 … … 301 301 // appropriate stack. 302 302 proc_cor_storage.__cor.state = Active; 303 main( proc_cor_storage );303 main( &proc_cor_storage ); 304 304 proc_cor_storage.__cor.state = Halted; 305 305 … … 441 441 mainThread = (thread_desc *)&storage_mainThread; 442 442 current_stack_info_t info; 443 (*mainThread){ &info };443 mainThread{ &info }; 444 444 445 445 LIB_DEBUG_PRINT_SAFE("Kernel : Main thread ready\n"); … … 447 447 // Initialize the main cluster 448 448 mainCluster = (cluster *)&storage_mainCluster; 449 (*mainCluster){};449 mainCluster{}; 450 450 451 451 LIB_DEBUG_PRINT_SAFE("Kernel : main cluster ready\n"); … … 454 454 // (the coroutine that contains the processing control flow) 455 455 mainProcessor = (processor *)&storage_mainProcessor; 456 (*mainProcessor){ mainCluster, *(processorCtx_t *)&storage_mainProcessorCtx };456 mainProcessor{ mainCluster, (processorCtx_t *)&storage_mainProcessorCtx }; 457 457 458 458 //initialize the global state variables … … 471 471 // context. Hence, the main thread does not begin through CtxInvokeThread, like all other threads. The trick here is that 472 472 // mainThread is on the ready queue when this call is made. 473 resume( *mainProcessor->runner );473 resume( mainProcessor->runner ); 474 474 475 475 … … 499 499 // Destroy the main processor and its context in reverse order of construction 500 500 // These were manually constructed so we need manually destroy them 501 ^( *mainProcessor->runner){};501 ^(mainProcessor->runner){}; 502 502 ^(mainProcessor){}; 503 503 … … 567 567 //----------------------------------------------------------------------------- 568 568 // Locks 569 void ?{}( spinlock &this ) {570 this .lock = 0;571 } 572 void ^?{}( spinlock &this ) {569 void ?{}( spinlock * this ) { 570 this->lock = 0; 571 } 572 void ^?{}( spinlock * this ) { 573 573 574 574 } … … 604 604 } 605 605 606 void ?{}( semaphore &this, int count = 1 ) {607 ( this.lock){};608 this .count = count;609 ( this.waiting){};610 } 611 void ^?{}(semaphore &this) {}606 void ?{}( semaphore * this, int count = 1 ) { 607 (&this->lock){}; 608 this->count = count; 609 (&this->waiting){}; 610 } 611 void ^?{}(semaphore * this) {} 612 612 613 613 void P(semaphore * this) { … … 643 643 //----------------------------------------------------------------------------- 644 644 // Queues 645 void ?{}( __thread_queue_t &this ) {646 this .head = NULL;647 this .tail = &this.head;645 void ?{}( __thread_queue_t * this ) { 646 this->head = NULL; 647 this->tail = &this->head; 648 648 } 649 649 … … 666 666 } 667 667 668 void ?{}( __condition_stack_t &this ) {669 this .top = NULL;668 void ?{}( __condition_stack_t * this ) { 669 this->top = NULL; 670 670 } 671 671 -
src/libcfa/concurrency/monitor
r8217e8f rbd46af4 22 22 #include "stdlib" 23 23 24 static inline void ?{}(monitor_desc &this) {25 this .owner = NULL;26 this .recursion = 0;24 static inline void ?{}(monitor_desc * this) { 25 this->owner = NULL; 26 this->recursion = 0; 27 27 } 28 28 … … 38 38 } 39 39 40 void ?{}( monitor_guard_t &this, monitor_desc ** m, int count );41 void ^?{}( monitor_guard_t &this );40 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ); 41 void ^?{}( monitor_guard_t * this ); 42 42 43 43 //----------------------------------------------------------------------------- … … 64 64 }; 65 65 66 void ?{}( __condition_blocked_queue_t &);66 void ?{}( __condition_blocked_queue_t * ); 67 67 void append( __condition_blocked_queue_t *, __condition_node_t * ); 68 68 __condition_node_t * pop_head( __condition_blocked_queue_t * ); … … 74 74 }; 75 75 76 static inline void ?{}( condition &this ) {77 this .monitors = NULL;78 this .monitor_count = 0;76 static inline void ?{}( condition * this ) { 77 this->monitors = NULL; 78 this->monitor_count = 0; 79 79 } 80 80 81 static inline void ^?{}( condition &this ) {82 free( this .monitors );81 static inline void ^?{}( condition * this ) { 82 free( this->monitors ); 83 83 } 84 84 -
src/libcfa/concurrency/monitor.c
r8217e8f rbd46af4 139 139 } 140 140 141 void ?{}( monitor_guard_t &this, monitor_desc ** m, int count ) {142 this .m = m;143 this .count = count;144 qsort(this .m, count);145 enter( this .m, this.count );146 147 this .prev_mntrs = this_thread->current_monitors;148 this .prev_count = this_thread->current_monitor_count;141 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) { 142 this->m = m; 143 this->count = count; 144 qsort(this->m, count); 145 enter( this->m, this->count ); 146 147 this->prev_mntrs = this_thread->current_monitors; 148 this->prev_count = this_thread->current_monitor_count; 149 149 150 150 this_thread->current_monitors = m; … … 152 152 } 153 153 154 void ^?{}( monitor_guard_t &this ) {155 leave( this .m, this.count );156 157 this_thread->current_monitors = this .prev_mntrs;158 this_thread->current_monitor_count = this .prev_count;159 } 160 161 void ?{}(__condition_node_t &this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {162 this .waiting_thread = waiting_thread;163 this .count = count;164 this .next = NULL;165 this .user_info = user_info;166 } 167 168 void ?{}(__condition_criterion_t &this ) {169 this .ready = false;170 this .target = NULL;171 this .owner = NULL;172 this .next = NULL;173 } 174 175 void ?{}(__condition_criterion_t &this, monitor_desc * target, __condition_node_t * owner ) {176 this .ready = false;177 this .target = target;178 this .owner = owner;179 this .next = NULL;154 void ^?{}( monitor_guard_t * this ) { 155 leave( this->m, this->count ); 156 157 this_thread->current_monitors = this->prev_mntrs; 158 this_thread->current_monitor_count = this->prev_count; 159 } 160 161 void ?{}(__condition_node_t * this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) { 162 this->waiting_thread = waiting_thread; 163 this->count = count; 164 this->next = NULL; 165 this->user_info = user_info; 166 } 167 168 void ?{}(__condition_criterion_t * this ) { 169 this->ready = false; 170 this->target = NULL; 171 this->owner = NULL; 172 this->next = NULL; 173 } 174 175 void ?{}(__condition_criterion_t * this, monitor_desc * target, __condition_node_t * owner ) { 176 this->ready = false; 177 this->target = target; 178 this->owner = owner; 179 this->next = NULL; 180 180 } 181 181 … … 202 202 __condition_criterion_t criteria[count]; 203 203 for(int i = 0; i < count; i++) { 204 ( criteria[i]){ this->monitors[i], &waiter };204 (&criteria[i]){ this->monitors[i], &waiter }; 205 205 // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] ); 206 206 } … … 314 314 __condition_criterion_t criteria[count]; 315 315 for(int i = 0; i < count; i++) { 316 ( criteria[i]){ this->monitors[i], &waiter };316 (&criteria[i]){ this->monitors[i], &waiter }; 317 317 // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] ); 318 318 push( &criteria[i].target->signal_stack, &criteria[i] ); … … 505 505 } 506 506 507 void ?{}( __condition_blocked_queue_t &this ) {508 this .head = NULL;509 this .tail = &this.head;507 void ?{}( __condition_blocked_queue_t * this ) { 508 this->head = NULL; 509 this->tail = &this->head; 510 510 } 511 511 -
src/libcfa/concurrency/preemption.c
r8217e8f rbd46af4 71 71 static pthread_t alarm_thread; // pthread handle to alarm thread 72 72 73 void ?{}(event_kernel_t &this) {74 ( this.alarms){};75 ( this.lock){};73 void ?{}(event_kernel_t * this) { 74 (&this->alarms){}; 75 (&this->lock){}; 76 76 } 77 77 … … 240 240 // Initialize the event kernel 241 241 event_kernel = (event_kernel_t *)&storage_event_kernel; 242 (*event_kernel){};242 event_kernel{}; 243 243 244 244 // Setup proper signal handlers … … 276 276 // Raii ctor/dtor for the preemption_scope 277 277 // Used by thread to control when they want to receive preemption signals 278 void ?{}( preemption_scope &this, processor * proc ) {279 ( this.alarm){ proc, zero_time, zero_time };280 this .proc = proc;281 this .proc->preemption_alarm = &this.alarm;282 283 update_preemption( this .proc, from_us(this.proc->cltr->preemption) );284 } 285 286 void ^?{}( preemption_scope &this ) {278 void ?{}( preemption_scope * this, processor * proc ) { 279 (&this->alarm){ proc, zero_time, zero_time }; 280 this->proc = proc; 281 this->proc->preemption_alarm = &this->alarm; 282 283 update_preemption( this->proc, from_us(this->proc->cltr->preemption) ); 284 } 285 286 void ^?{}( preemption_scope * this ) { 287 287 disable_interrupts(); 288 288 289 update_preemption( this .proc, zero_time );289 update_preemption( this->proc, zero_time ); 290 290 } 291 291 -
src/libcfa/concurrency/preemption.h
r8217e8f rbd46af4 30 30 }; 31 31 32 void ?{}( preemption_scope &this, processor * proc );33 void ^?{}( preemption_scope &this );32 void ?{}( preemption_scope * this, processor * proc ); 33 void ^?{}( preemption_scope * this ); 34 34 35 35 // Local Variables: // -
src/libcfa/concurrency/thread
r8217e8f rbd46af4 27 27 // Anything that is resumed is a coroutine. 28 28 trait is_thread(dtype T) { 29 void ^?{}(T &mutex this);30 void main(T &this);31 thread_desc* get_thread(T &this);29 void ^?{}(T* mutex this); 30 void main(T* this); 31 thread_desc* get_thread(T* this); 32 32 }; 33 33 34 #define DECL_THREAD(X) thread_desc* get_thread(X & this) { return &this.__thrd; } void main(X&this)34 #define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->__thrd; } void main(X* this) 35 35 36 36 forall( dtype T | is_thread(T) ) 37 static inline coroutine_desc* get_coroutine(T &this) {37 static inline coroutine_desc* get_coroutine(T* this) { 38 38 return &get_thread(this)->cor; 39 39 } 40 40 41 41 forall( dtype T | is_thread(T) ) 42 static inline monitor_desc* get_monitor(T &this) {42 static inline monitor_desc* get_monitor(T * this) { 43 43 return &get_thread(this)->mon; 44 44 } … … 55 55 56 56 forall( dtype T | is_thread(T) ) 57 void __thrd_start( T &this );57 void __thrd_start( T* this ); 58 58 59 59 //----------------------------------------------------------------------------- 60 60 // Ctors and dtors 61 void ?{}(thread_desc &this);62 void ^?{}(thread_desc &this);61 void ?{}(thread_desc* this); 62 void ^?{}(thread_desc* this); 63 63 64 64 //----------------------------------------------------------------------------- … … 70 70 }; 71 71 72 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T &); } )73 void ?{}( scoped(T) &this );72 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } ) 73 void ?{}( scoped(T)* this ); 74 74 75 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T &, P); } )76 void ?{}( scoped(T) &this, P params );75 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } ) 76 void ?{}( scoped(T)* this, P params ); 77 77 78 78 forall( dtype T | sized(T) | is_thread(T) ) 79 void ^?{}( scoped(T) &this );79 void ^?{}( scoped(T)* this ); 80 80 81 81 void yield(); -
src/libcfa/concurrency/thread.c
r8217e8f rbd46af4 32 32 // Thread ctors and dtors 33 33 34 void ?{}(thread_desc &this) {35 ( this.cor){};36 this .cor.name = "Anonymous Coroutine";37 this .mon.owner = &this;38 this .mon.recursion = 1;39 this .next = NULL;34 void ?{}(thread_desc* this) { 35 (&this->cor){}; 36 this->cor.name = "Anonymous Coroutine"; 37 this->mon.owner = this; 38 this->mon.recursion = 1; 39 this->next = NULL; 40 40 41 this .current_monitors = &this.mon;42 this .current_monitor_count = 1;41 this->current_monitors = &this->mon; 42 this->current_monitor_count = 1; 43 43 } 44 44 45 void ^?{}(thread_desc &this) {46 ^( this.cor){};45 void ^?{}(thread_desc* this) { 46 ^(&this->cor){}; 47 47 } 48 48 49 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T &); } )50 void ?{}( scoped(T) &this ) {51 ( this.handle){};52 __thrd_start( this.handle);49 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } ) 50 void ?{}( scoped(T)* this ) { 51 (&this->handle){}; 52 __thrd_start(&this->handle); 53 53 } 54 54 55 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T &, P); } )56 void ?{}( scoped(T) &this, P params ) {57 ( this.handle){ params };58 __thrd_start( this.handle);55 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } ) 56 void ?{}( scoped(T)* this, P params ) { 57 (&this->handle){ params }; 58 __thrd_start(&this->handle); 59 59 } 60 60 61 61 forall( dtype T | sized(T) | is_thread(T) ) 62 void ^?{}( scoped(T) &this ) {63 ^( this.handle){};62 void ^?{}( scoped(T)* this ) { 63 ^(&this->handle){}; 64 64 } 65 65 … … 67 67 // Starting and stopping threads 68 68 forall( dtype T | is_thread(T) ) 69 void __thrd_start( T &this ) {69 void __thrd_start( T* this ) { 70 70 coroutine_desc* thrd_c = get_coroutine(this); 71 71 thread_desc* thrd_h = get_thread (this); … … 77 77 create_stack(&thrd_c->stack, thrd_c->stack.size); 78 78 this_coroutine = thrd_c; 79 CtxStart( &this, CtxInvokeThread);79 CtxStart(this, CtxInvokeThread); 80 80 assert( thrd_c->last->stack.context ); 81 81 CtxSwitch( thrd_c->last->stack.context, thrd_c->stack.context ); -
src/libcfa/containers/maybe
r8217e8f rbd46af4 27 27 28 28 forall(otype T) 29 void ?{}(maybe(T) &this);29 void ?{}(maybe(T) * this); 30 30 31 31 forall(otype T) 32 void ?{}(maybe(T) &this, T value);32 void ?{}(maybe(T) * this, T value); 33 33 34 34 forall(otype T) 35 void ?{}(maybe(T) &this, maybe(T) other);35 void ?{}(maybe(T) * this, maybe(T) other); 36 36 37 37 forall(otype T) 38 void ^?{}(maybe(T) &this);38 void ^?{}(maybe(T) * this); 39 39 40 40 forall(otype T) 41 maybe(T) ?=?(maybe(T) &this, maybe(T) other);41 maybe(T) ?=?(maybe(T) * this, maybe(T) other); 42 42 43 43 forall(otype T) -
src/libcfa/containers/maybe.c
r8217e8f rbd46af4 19 19 20 20 forall(otype T) 21 void ?{}(maybe(T) &this) {22 this .has_value = false;21 void ?{}(maybe(T) * this) { 22 this->has_value = false; 23 23 } 24 24 25 25 forall(otype T) 26 void ?{}(maybe(T) &this, T value) {27 this .has_value = true;28 ( this.value){value};26 void ?{}(maybe(T) * this, T value) { 27 this->has_value = true; 28 (&this->value){value}; 29 29 } 30 30 31 31 forall(otype T) 32 void ?{}(maybe(T) &this, maybe(T) other) {33 this .has_value = other.has_value;32 void ?{}(maybe(T) * this, maybe(T) other) { 33 this->has_value = other.has_value; 34 34 if (other.has_value) { 35 ( this.value){other.value};35 (&this->value){other.value}; 36 36 } 37 37 } 38 38 39 39 forall(otype T) 40 maybe(T) ?=?(maybe(T) &this, maybe(T) that) {41 if (this .has_value & that.has_value) {42 this .value = that.value;43 } else if (this .has_value) {44 ^( this.value){};45 this .has_value = false;40 maybe(T) ?=?(maybe(T) * this, maybe(T) that) { 41 if (this->has_value & that.has_value) { 42 this->value = that.value; 43 } else if (this->has_value) { 44 ^(&this->value){}; 45 this->has_value = false; 46 46 } else if (that.has_value) { 47 this .has_value = true;48 ( this.value){that.value};47 this->has_value = true; 48 (&this->value){that.value}; 49 49 } 50 return this;51 50 } 52 51 53 52 forall(otype T) 54 void ^?{}(maybe(T) &this) {55 if (this .has_value) {56 ^( this.value){};53 void ^?{}(maybe(T) * this) { 54 if (this->has_value) { 55 ^(&this->value){}; 57 56 } 58 57 } … … 90 89 } else { 91 90 this->has_value = true; 92 ( this->value){value};91 (&this->value){value}; 93 92 } 94 93 } … … 98 97 if (this->has_value) { 99 98 this->has_value = false; 100 ^( this->value){};99 ^(&this->value){}; 101 100 } 102 101 } -
src/libcfa/containers/result
r8217e8f rbd46af4 33 33 34 34 forall(otype T, otype E) 35 void ?{}(result(T, E) &this);35 void ?{}(result(T, E) * this); 36 36 37 37 forall(otype T, otype E) 38 void ?{}(result(T, E) &this, one_t, T value);38 void ?{}(result(T, E) * this, one_t, T value); 39 39 40 40 forall(otype T, otype E) 41 void ?{}(result(T, E) &this, zero_t, E error);41 void ?{}(result(T, E) * this, zero_t, E error); 42 42 43 43 forall(otype T, otype E) 44 void ?{}(result(T, E) &this, result(T, E) other);44 void ?{}(result(T, E) * this, result(T, E) other); 45 45 46 46 forall(otype T, otype E) 47 void ^?{}(result(T, E) &this);47 void ^?{}(result(T, E) * this); 48 48 49 49 forall(otype T, otype E) 50 result(T, E) ?=?(result(T, E) &this, result(T, E) other);50 result(T, E) ?=?(result(T, E) * this, result(T, E) other); 51 51 52 52 forall(otype T, otype E) -
src/libcfa/containers/result.c
r8217e8f rbd46af4 19 19 20 20 forall(otype T, otype E) 21 void ?{}(result(T, E) &this) {22 this .has_value = false;23 ( this.error){};21 void ?{}(result(T, E) * this) { 22 this->has_value = false; 23 (&this->error){}; 24 24 } 25 25 26 26 forall(otype T, otype E) 27 void ?{}(result(T, E) &this, one_t, T value) {28 this .has_value = true;29 ( this.value){value};27 void ?{}(result(T, E) * this, one_t, T value) { 28 this->has_value = true; 29 (&this->value){value}; 30 30 } 31 31 32 32 forall(otype T, otype E) 33 void ?{}(result(T, E) &this, zero_t, E error) {34 this .has_value = false;35 ( this.error){error};33 void ?{}(result(T, E) * this, zero_t, E error) { 34 this->has_value = false; 35 (&this->error){error}; 36 36 } 37 37 38 38 forall(otype T, otype E) 39 void ?{}(result(T, E) &this, result(T, E) other) {40 this .has_value = other.has_value;39 void ?{}(result(T, E) * this, result(T, E) other) { 40 this->has_value = other.has_value; 41 41 if (other.has_value) { 42 ( this.value){other.value};42 (&this->value){other.value}; 43 43 } else { 44 ( this.error){other.error};44 (&this->error){other.error}; 45 45 } 46 46 } 47 47 48 48 forall(otype T, otype E) 49 result(T, E) ?=?(result(T, E) &this, result(T, E) that) {50 if (this .has_value & that.has_value) {51 this .value = that.value;52 } else if (this .has_value) {53 ^( this.value){};54 this .has_value = false;55 ( this.error){that.error};49 result(T, E) ?=?(result(T, E) * this, result(T, E) that) { 50 if (this->has_value & that.has_value) { 51 this->value = that.value; 52 } else if (this->has_value) { 53 ^(&this->value){}; 54 this->has_value = false; 55 (&this->error){that.error}; 56 56 } else if (that.has_value) { 57 ^( this.error){};58 this .has_value = true;59 ( this.value){that.value};57 ^(&this->error){}; 58 this->has_value = true; 59 (&this->value){that.value}; 60 60 } else { 61 this .error = that.error;61 this->error = that.error; 62 62 } 63 63 } 64 64 65 65 forall(otype T, otype E) 66 void ^?{}(result(T, E) &this) {67 if (this .has_value) {68 ^( this.value){};66 void ^?{}(result(T, E) * this) { 67 if (this->has_value) { 68 ^(&this->value){}; 69 69 } else { 70 ^( this.error){};70 ^(&this->error){}; 71 71 } 72 72 } … … 109 109 this->value = value; 110 110 } else { 111 ^( this->error){};111 ^(&this->error){}; 112 112 this->has_value = true; 113 ( this->value){value};113 (&this->value){value}; 114 114 } 115 115 } … … 118 118 void set_error(result(T, E) * this, E error) { 119 119 if (this->has_value) { 120 ^( this->value){};120 ^(&this->value){}; 121 121 this->has_value = false; 122 ( this->error){error};122 (&this->error){error}; 123 123 } else { 124 124 this->error = error; -
src/libcfa/containers/vector
r8217e8f rbd46af4 30 30 31 31 forall(otype T) 32 void ?{}(heap_allocator(T) &this);32 void ?{}(heap_allocator(T)* this); 33 33 34 34 forall(otype T) 35 void ?{}(heap_allocator(T) &this, heap_allocator(T) rhs);35 void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs); 36 36 37 37 forall(otype T) 38 heap_allocator(T) ?=?(heap_allocator(T) &this, heap_allocator(T) rhs);38 heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs); 39 39 40 40 forall(otype T) 41 void ^?{}(heap_allocator(T) &this);41 void ^?{}(heap_allocator(T)* this); 42 42 43 43 forall(otype T) … … 64 64 //Initialization 65 65 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 66 void ?{}(vector(T, allocator_t) &this);66 void ?{}(vector(T, allocator_t)* this); 67 67 68 68 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 69 void ?{}(vector(T, allocator_t) &this, vector(T, allocator_t) rhs);69 void ?{}(vector(T, allocator_t)* this, vector(T, allocator_t) rhs); 70 70 71 71 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 72 vector(T, allocator_t) ?=?(vector(T, allocator_t) &this, vector(T, allocator_t) rhs);72 vector(T, allocator_t) ?=?(vector(T, allocator_t)* this, vector(T, allocator_t) rhs); 73 73 74 74 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 75 void ^?{}(vector(T, allocator_t) &this);75 void ^?{}(vector(T, allocator_t)* this); 76 76 77 77 forall(otype T, otype allocator_t = heap_allocator(T) | allocator_c(T, allocator_t)) -
src/libcfa/containers/vector.c
r8217e8f rbd46af4 24 24 //Initialization 25 25 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 26 void ?{}(vector(T, allocator_t) &this)26 void ?{}(vector(T, allocator_t)* this) 27 27 { 28 ( this.storage){};29 this .size = 0;28 (&this->storage){}; 29 this->size = 0; 30 30 } 31 31 32 32 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 33 void ?{}(vector(T, allocator_t) &this, vector(T, allocator_t) rhs)33 void ?{}(vector(T, allocator_t)* this, vector(T, allocator_t) rhs) 34 34 { 35 ( this.storage){ rhs.storage };36 copy_internal( &this, &rhs);35 (&this->storage){ rhs.storage }; 36 copy_internal(this, &rhs); 37 37 } 38 38 … … 46 46 47 47 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 48 void ^?{}(vector(T, allocator_t) &this)48 void ^?{}(vector(T, allocator_t)* this) 49 49 { 50 clear( &this);51 ^( this.storage){};50 clear(this); 51 ^(&this->storage){}; 52 52 } 53 53 … … 66 66 { 67 67 this->size--; 68 ^( data(&this->storage)[this->size]){};68 ^(&data(&this->storage)[this->size]){}; 69 69 } 70 70 … … 74 74 for(size_t i = 0; i < this->size; i++) 75 75 { 76 ^( data(&this->storage)[this->size]){};76 ^(&data(&this->storage)[this->size]){}; 77 77 } 78 78 this->size = 0; … … 87 87 this->size = other->size; 88 88 for(size_t i = 0; i < this->size; i++) { 89 ( data(&this->storage)[this->size]){ data(&other->storage)[other->size] };89 (&data(&this->storage)[this->size]){ data(&other->storage)[other->size] }; 90 90 } 91 91 } … … 94 94 //Allocator 95 95 forall(otype T) 96 void ?{}(heap_allocator(T) &this)96 void ?{}(heap_allocator(T)* this) 97 97 { 98 this .storage = 0;99 this .capacity = 0;98 this->storage = 0; 99 this->capacity = 0; 100 100 } 101 101 102 102 forall(otype T) 103 void ?{}(heap_allocator(T) &this, heap_allocator(T) rhs)103 void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs) 104 104 { 105 this .capacity = rhs.capacity;106 this .storage = (T*)realloc((void*)this.storage, this.capacity * sizeof(T));105 this->capacity = rhs.capacity; 106 this->storage = (T*)realloc((void*)this->storage, this->capacity * sizeof(T)); 107 107 } 108 108 109 109 forall(otype T) 110 heap_allocator(T) ?=?(heap_allocator(T) &this, heap_allocator(T) rhs)110 heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs) 111 111 { 112 this .capacity = rhs.capacity;113 this .storage = (T*)realloc((void*)this.storage, this.capacity * sizeof(T));114 return this;112 this->capacity = rhs.capacity; 113 this->storage = (T*)realloc((void*)this->storage, this->capacity * sizeof(T)); 114 return *this; 115 115 } 116 116 117 117 forall(otype T) 118 void ^?{}(heap_allocator(T) &this)118 void ^?{}(heap_allocator(T)* this) 119 119 { 120 free(this .storage);120 free(this->storage); 121 121 } 122 122 -
src/libcfa/fstream
r8217e8f rbd46af4 56 56 int fmt( ofstream *, const char fmt[], ... ); 57 57 58 void ?{}( ofstream &);58 void ?{}( ofstream * ); 59 59 60 60 extern ofstream * sout, * serr; -
src/libcfa/fstream.c
r8217e8f rbd46af4 27 27 #define IO_MSG "I/O error: " 28 28 29 void ?{}( ofstream &this, void * file, _Bool sepDefault, _Bool sepOnOff, const char * separator, const char * tupleSeparator ) {30 this .file = file;31 this .sepDefault = sepDefault;32 this .sepOnOff = sepOnOff;33 sepSet( &this, separator );34 sepSetCur( &this, sepGet( &this ) );35 sepSetTuple( &this, tupleSeparator );29 void ?{}( ofstream * this, void * file, _Bool sepDefault, _Bool sepOnOff, const char * separator, const char * tupleSeparator ) { 30 this->file = file; 31 this->sepDefault = sepDefault; 32 this->sepOnOff = sepOnOff; 33 sepSet( this, separator ); 34 sepSetCur( this, sepGet( this ) ); 35 sepSetTuple( this, tupleSeparator ); 36 36 } 37 37 … … 92 92 exit( EXIT_FAILURE ); 93 93 } // if 94 ?{}( *os, file, true, false, " ", ", " );94 ?{}( os, file, true, false, " ", ", " ); 95 95 } // open 96 96 -
src/libcfa/gmp
r8217e8f rbd46af4 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // gmp -- 8 // 6 // 7 // gmp -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Tue Apr 19 08:43:43 2016 … … 12 12 // Last Modified On : Fri Jul 7 09:33:20 2017 13 13 // Update Count : 15 14 // 14 // 15 15 16 16 // https://gmplib.org/gmp-man-6.1.1.pdf … … 24 24 25 25 // constructor 26 static inline void ?{}( Int & this ) { mpz_init( this.mpz ); }27 static inline void ?{}( Int & this, Int init ) { mpz_init_set( this.mpz, init.mpz ); }28 static inline void ?{}( Int & this, zero_t ) { mpz_init_set_si( this.mpz, 0 ); }29 static inline void ?{}( Int & this, one_t ) { mpz_init_set_si( this.mpz, 1 ); }30 static inline void ?{}( Int & this, signed long int init ) { mpz_init_set_si( this.mpz, init ); }31 static inline void ?{}( Int & this, unsigned long int init ) { mpz_init_set_ui( this.mpz, init ); }32 static inline void ?{}( Int & this, const char * val ) { if ( mpz_init_set_str( this.mpz, val, 0 ) ) abort(); }33 static inline void ^?{}( Int & this ) { mpz_clear( this.mpz ); }26 static inline void ?{}( Int * this ) { mpz_init( this->mpz ); } 27 static inline void ?{}( Int * this, Int init ) { mpz_init_set( this->mpz, init.mpz ); } 28 static inline void ?{}( Int * this, zero_t ) { mpz_init_set_si( this->mpz, 0 ); } 29 static inline void ?{}( Int * this, one_t ) { mpz_init_set_si( this->mpz, 1 ); } 30 static inline void ?{}( Int * this, signed long int init ) { mpz_init_set_si( this->mpz, init ); } 31 static inline void ?{}( Int * this, unsigned long int init ) { mpz_init_set_ui( this->mpz, init ); } 32 static inline void ?{}( Int * this, const char * val ) { if ( mpz_init_set_str( this->mpz, val, 0 ) ) abort(); } 33 static inline void ^?{}( Int * this ) { mpz_clear( this->mpz ); } 34 34 35 35 // assignment 36 static inline Int ?=?( Int & lhs, Int rhs ) { mpz_set( lhs.mpz, rhs.mpz ); returnlhs; }37 static inline Int ?=?( Int & lhs, long int rhs ) { mpz_set_si( lhs.mpz, rhs ); returnlhs; }38 static inline Int ?=?( Int & lhs, unsigned long int rhs ) { mpz_set_ui( lhs.mpz, rhs ); returnlhs; }39 static inline Int ?=?( Int & lhs, const char * rhs ) { if ( mpz_set_str( lhs.mpz, rhs, 0 ) ) { printf( "invalid string conversion\n" ); abort(); } returnlhs; }40 41 static inline char ?=?( char & lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }42 static inline short int ?=?( short int & lhs, Int rhs ) { short int val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }43 static inline int ?=?( int & lhs, Int rhs ) { int val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }44 static inline long int ?=?( long int & lhs, Int rhs ) { long int val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }45 static inline unsigned char ?=?( unsigned char & lhs, Int rhs ) { unsigned char val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }46 static inline unsigned short int ?=?( unsigned short int & lhs, Int rhs ) { unsigned short int val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }47 static inline unsigned int ?=?( unsigned int & lhs, Int rhs ) { unsigned int val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }48 static inline unsigned long int ?=?( unsigned long int & lhs, Int rhs ) { unsigned long int val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }36 static inline Int ?=?( Int * lhs, Int rhs ) { mpz_set( lhs->mpz, rhs.mpz ); return *lhs; } 37 static inline Int ?=?( Int * lhs, long int rhs ) { mpz_set_si( lhs->mpz, rhs ); return *lhs; } 38 static inline Int ?=?( Int * lhs, unsigned long int rhs ) { mpz_set_ui( lhs->mpz, rhs ); return *lhs; } 39 static inline Int ?=?( Int * lhs, const char * rhs ) { if ( mpz_set_str( lhs->mpz, rhs, 0 ) ) { printf( "invalid string conversion\n" ); abort(); } return *lhs; } 40 41 static inline char ?=?( char * lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); *lhs = val; return val; } 42 static inline short int ?=?( short int * lhs, Int rhs ) { short int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; } 43 static inline int ?=?( int * lhs, Int rhs ) { int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; } 44 static inline long int ?=?( long int * lhs, Int rhs ) { long int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; } 45 static inline unsigned char ?=?( unsigned char * lhs, Int rhs ) { unsigned char val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; } 46 static inline unsigned short int ?=?( unsigned short int * lhs, Int rhs ) { unsigned short int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; } 47 static inline unsigned int ?=?( unsigned int * lhs, Int rhs ) { unsigned int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; } 48 static inline unsigned long int ?=?( unsigned long int * lhs, Int rhs ) { unsigned long int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; } 49 49 50 50 // conversions … … 99 99 static inline Int ?&?( Int oper1, unsigned long int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_and( conjunction.mpz, oper1.mpz, temp.mpz ); return conjunction; } 100 100 static inline Int ?&?( unsigned long int oper1, Int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_and( conjunction.mpz, temp.mpz, oper2.mpz ); return conjunction; } 101 static inline Int ?&=?( Int & lhs, Int rhs ) { return lhs =lhs & rhs; }101 static inline Int ?&=?( Int * lhs, Int rhs ) { return *lhs = *lhs & rhs; } 102 102 103 103 static inline Int ?|?( Int oper1, Int oper2 ) { Int disjunction; mpz_ior( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; } … … 106 106 static inline Int ?|?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; } 107 107 static inline Int ?|?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; } 108 static inline Int ?|=?( Int & lhs, Int rhs ) { return lhs =lhs | rhs; }108 static inline Int ?|=?( Int * lhs, Int rhs ) { return *lhs = *lhs | rhs; } 109 109 110 110 static inline Int ?^?( Int oper1, Int oper2 ) { Int disjunction; mpz_xor( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; } … … 113 113 static inline Int ?^?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; } 114 114 static inline Int ?^?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; } 115 static inline Int ?^=?( Int & lhs, Int rhs ) { return lhs =lhs ^ rhs; }115 static inline Int ?^=?( Int * lhs, Int rhs ) { return *lhs = *lhs ^ rhs; } 116 116 117 117 static inline Int ?+?( Int addend1, Int addend2 ) { Int sum; mpz_add( sum.mpz, addend1.mpz, addend2.mpz ); return sum; } … … 120 120 static inline Int ?+?( Int addend1, unsigned long int addend2 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; } 121 121 static inline Int ?+?( unsigned long int addend2, Int addend1 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; } 122 static inline Int ?+=?( Int & lhs, Int rhs ) { return lhs =lhs + rhs; }123 static inline Int ?+=?( Int & lhs, long int rhs ) { return lhs =lhs + rhs; }124 static inline Int ?+=?( Int & lhs, unsigned long int rhs ) { return lhs =lhs + rhs; }125 static inline Int ++?( Int & lhs ) { returnlhs += 1; }126 static inline Int ?++( Int & lhs ) { Int ret = lhs;lhs += 1; return ret; }122 static inline Int ?+=?( Int * lhs, Int rhs ) { return *lhs = *lhs + rhs; } 123 static inline Int ?+=?( Int * lhs, long int rhs ) { return *lhs = *lhs + rhs; } 124 static inline Int ?+=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs + rhs; } 125 static inline Int ++?( Int * lhs ) { return *lhs += 1; } 126 static inline Int ?++( Int * lhs ) { Int ret = *lhs; *lhs += 1; return ret; } 127 127 128 128 static inline Int ?-?( Int minuend, Int subtrahend ) { Int diff; mpz_sub( diff.mpz, minuend.mpz, subtrahend.mpz ); return diff; } … … 131 131 static inline Int ?-?( Int minuend, unsigned long int subtrahend ) { Int diff; mpz_sub_ui( diff.mpz, minuend.mpz, subtrahend ); return diff; } 132 132 static inline Int ?-?( unsigned long int minuend, Int subtrahend ) { Int diff; mpz_ui_sub( diff.mpz, minuend, subtrahend.mpz ); return diff; } 133 static inline Int ?-=?( Int & lhs, Int rhs ) { return lhs =lhs - rhs; }134 static inline Int ?-=?( Int & lhs, long int rhs ) { return lhs =lhs - rhs; }135 static inline Int ?-=?( Int & lhs, unsigned long int rhs ) { return lhs =lhs - rhs; }136 static inline Int --?( Int & lhs ) { returnlhs -= 1; }137 static inline Int ?--( Int & lhs ) { Int ret = lhs;lhs -= 1; return ret; }133 static inline Int ?-=?( Int * lhs, Int rhs ) { return *lhs = *lhs - rhs; } 134 static inline Int ?-=?( Int * lhs, long int rhs ) { return *lhs = *lhs - rhs; } 135 static inline Int ?-=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs - rhs; } 136 static inline Int --?( Int * lhs ) { return *lhs -= 1; } 137 static inline Int ?--( Int * lhs ) { Int ret = *lhs; *lhs -= 1; return ret; } 138 138 139 139 static inline Int ?*?( Int multiplicator, Int multiplicand ) { Int product; mpz_mul( product.mpz, multiplicator.mpz, multiplicand.mpz ); return product; } … … 142 142 static inline Int ?*?( Int multiplicator, unsigned long int multiplicand ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; } 143 143 static inline Int ?*?( unsigned long int multiplicand, Int multiplicator ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; } 144 static inline Int ?*=?( Int & lhs, Int rhs ) { return lhs =lhs * rhs; }145 static inline Int ?*=?( Int & lhs, long int rhs ) { return lhs =lhs * rhs; }146 static inline Int ?*=?( Int & lhs, unsigned long int rhs ) { return lhs =lhs * rhs; }144 static inline Int ?*=?( Int * lhs, Int rhs ) { return *lhs = *lhs * rhs; } 145 static inline Int ?*=?( Int * lhs, long int rhs ) { return *lhs = *lhs * rhs; } 146 static inline Int ?*=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs * rhs; } 147 147 148 148 // some code for operators "/" and "%" taken from g++ gmpxx.h … … 187 187 return quotient; 188 188 } // ?/? 189 static inline Int ?/=?( Int & lhs, Int rhs ) { return lhs =lhs / rhs; }190 static inline Int ?/=?( Int & lhs, long int rhs ) { return lhs =lhs / rhs; }191 static inline Int ?/=?( Int & lhs, unsigned long int rhs ) { return lhs =lhs / rhs; }189 static inline Int ?/=?( Int * lhs, Int rhs ) { return *lhs = *lhs / rhs; } 190 static inline Int ?/=?( Int * lhs, long int rhs ) { return *lhs = *lhs / rhs; } 191 static inline Int ?/=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs / rhs; } 192 192 193 193 static inline [ Int, Int ] div( Int dividend, Int divisor ) { Int quotient, remainder; mpz_fdiv_qr( quotient.mpz, remainder.mpz, dividend.mpz, divisor.mpz ); return [ quotient, remainder ]; } … … 228 228 return remainder; 229 229 } // ?%? 230 static inline Int ?%=?( Int & lhs, Int rhs ) { return lhs =lhs % rhs; }231 static inline Int ?%=?( Int & lhs, long int rhs ) { return lhs =lhs % rhs; }232 static inline Int ?%=?( Int & lhs, unsigned long int rhs ) { return lhs =lhs % rhs; }230 static inline Int ?%=?( Int * lhs, Int rhs ) { return *lhs = *lhs % rhs; } 231 static inline Int ?%=?( Int * lhs, long int rhs ) { return *lhs = *lhs % rhs; } 232 static inline Int ?%=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs % rhs; } 233 233 234 234 static inline Int ?<<?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_mul_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; } 235 static inline Int ?<<=?( Int & lhs, mp_bitcnt_t shift ) { return lhs =lhs << shift; }235 static inline Int ?<<=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs << shift; } 236 236 static inline Int ?>>?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_fdiv_q_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; } 237 static inline Int ?>>=?( Int & lhs, mp_bitcnt_t shift ) { return lhs =lhs >> shift; }237 static inline Int ?>>=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs >> shift; } 238 238 239 239 // number functions -
src/libcfa/interpose.c
r8217e8f rbd46af4 49 49 50 50 union { generic_fptr_t fptr; void* ptr; } originalFunc; 51 51 52 52 #if defined( _GNU_SOURCE ) 53 53 if ( version ) { … … 59 59 originalFunc.ptr = dlsym( library, symbol ); 60 60 #endif // _GNU_SOURCE 61 61 62 62 error = dlerror(); 63 if ( error ) abortf( "interpose_symbol : internal error, %s\n", error ); 63 if ( error ) abortf( "interpose_symbol : internal error, %s\n", error ); 64 64 65 65 return originalFunc.fptr; … … 74 74 forall(dtype T) 75 75 static inline void assign_ptr( T** symbol_ptr, const char * symbol_name, const char * version) { 76 union { 76 union { 77 77 generic_fptr_t gp; 78 T* tp; 78 T* tp; 79 79 } u; 80 80 -
src/libcfa/iterator
r8217e8f rbd46af4 19 19 trait iterator( otype iterator_type, otype elt_type ) { 20 20 // point to the next element 21 // iterator_type ?++( iterator_type &);22 iterator_type ++?( iterator_type &);23 iterator_type --?( iterator_type &);21 // iterator_type ?++( iterator_type * ); 22 iterator_type ++?( iterator_type * ); 23 iterator_type --?( iterator_type * ); 24 24 25 25 // can be tested for equality with other iterators … … 28 28 29 29 // dereference to get the pointed-at element 30 elt_type &*?( iterator_type );30 lvalue elt_type *?( iterator_type ); 31 31 }; 32 32 -
src/libcfa/rational
r8217e8f rbd46af4 31 31 int ?>?( T, T ); 32 32 int ?>=?( T, T ); 33 void ?{}( T &, zero_t );34 void ?{}( T &, one_t );33 void ?{}( T *, zero_t ); 34 void ?{}( T *, one_t ); 35 35 T +?( T ); 36 36 T -?( T ); … … 40 40 T ?/?( T, T ); 41 41 T ?%?( T, T ); 42 T ?/=?( T &, T );42 T ?/=?( T *, T ); 43 43 T abs( T ); 44 44 }; … … 54 54 55 55 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 56 void ?{}( Rational(RationalImpl) &r );56 void ?{}( Rational(RationalImpl) * r ); 57 57 58 58 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 59 void ?{}( Rational(RationalImpl) &r, RationalImpl n );59 void ?{}( Rational(RationalImpl) * r, RationalImpl n ); 60 60 61 61 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 62 void ?{}( Rational(RationalImpl) &r, RationalImpl n, RationalImpl d );62 void ?{}( Rational(RationalImpl) * r, RationalImpl n, RationalImpl d ); 63 63 64 64 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 65 void ?{}( Rational(RationalImpl) &r, zero_t );65 void ?{}( Rational(RationalImpl) * r, zero_t ); 66 66 67 67 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 68 void ?{}( Rational(RationalImpl) &r, one_t );68 void ?{}( Rational(RationalImpl) * r, one_t ); 69 69 70 70 // numerator/denominator getter … … 77 77 78 78 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 79 [ RationalImpl, RationalImpl ] ?=?( &[ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src );79 [ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ); 80 80 81 81 // numerator/denominator setter -
src/libcfa/rational.c
r8217e8f rbd46af4 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // rational.c -- 8 // 6 // 7 // rational.c -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Apr 6 17:54:28 2016 … … 12 12 // Last Modified On : Tue May 16 18:35:36 2017 13 13 // Update Count : 150 14 // 14 // 15 15 16 16 #include "rational" … … 47 47 48 48 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 49 void ?{}( Rational(RationalImpl) &r ) {49 void ?{}( Rational(RationalImpl) * r ) { 50 50 r{ (RationalImpl){0}, (RationalImpl){1} }; 51 51 } // rational 52 52 53 53 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 54 void ?{}( Rational(RationalImpl) &r, RationalImpl n ) {54 void ?{}( Rational(RationalImpl) * r, RationalImpl n ) { 55 55 r{ n, (RationalImpl){1} }; 56 56 } // rational 57 57 58 58 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 59 void ?{}( Rational(RationalImpl) &r, RationalImpl n, RationalImpl d ) {59 void ?{}( Rational(RationalImpl) * r, RationalImpl n, RationalImpl d ) { 60 60 RationalImpl t = simplify( &n, &d ); // simplify 61 r .numerator = n / t;62 r .denominator = d / t;61 r->numerator = n / t; 62 r->denominator = d / t; 63 63 } // rational 64 64 … … 77 77 78 78 forall( otype RationalImpl | arithmetic( RationalImpl ) ) 79 [ RationalImpl, RationalImpl ] ?=?( &[ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) {80 return dest = src.[ numerator, denominator ];79 [ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) { 80 return *dest = src.[ numerator, denominator ]; 81 81 } 82 82 -
src/libcfa/stdlib
r8217e8f rbd46af4 132 132 133 133 // allocation/deallocation and constructor/destructor, non-array types 134 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * new( Params p );135 forall( dtype T | sized(T) | { void ^?{}( T &); } ) void delete( T * ptr );136 forall( dtype T, ttype Params | sized(T) | { void ^?{}( T &); void delete( Params ); } ) void delete( T * ptr, Params rest );134 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) T * new( Params p ); 135 forall( dtype T | { void ^?{}( T * ); } ) void delete( T * ptr ); 136 forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } ) void delete( T * ptr, Params rest ); 137 137 138 138 // allocation/deallocation and constructor/destructor, array types 139 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * anew( size_t dim, Params p );140 forall( dtype T | sized(T) | { void ^?{}( T &); } ) void adelete( size_t dim, T arr[] );141 forall( dtype T | sized(T) | { void ^?{}( T &); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest );139 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) T * anew( size_t dim, Params p ); 140 forall( dtype T | sized(T) | { void ^?{}( T * ); } ) void adelete( size_t dim, T arr[] ); 141 forall( dtype T | sized(T) | { void ^?{}( T * ); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest ); 142 142 143 143 //--------------------------------------- … … 201 201 double abs( double _Complex ); 202 202 long double abs( long double _Complex ); 203 forall( otype T | { void ?{}( T &, zero_t ); int ?<?( T, T ); T -?( T ); } )203 forall( otype T | { void ?{}( T *, zero_t ); int ?<?( T, T ); T -?( T ); } ) 204 204 T abs( T ); 205 205 -
src/libcfa/stdlib.c
r8217e8f rbd46af4 32 32 if ( nlen > olen ) { // larger ? 33 33 memset( nptr + olen, (int)fill, nlen - olen ); // initialize added storage 34 } // 34 } // 35 35 return (T *)nptr; 36 36 } // alloc 37 37 38 38 // allocation/deallocation and constructor/destructor, non-array types 39 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } )39 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) 40 40 T * new( Params p ) { 41 return &(*malloc()){ p }; // run constructor41 return (malloc()){ p }; // run constructor 42 42 } // new 43 43 44 forall( dtype T | sized(T) | { void ^?{}( T &); } )44 forall( dtype T | { void ^?{}( T * ); } ) 45 45 void delete( T * ptr ) { 46 46 if ( ptr ) { // ignore null 47 ^ (*ptr){}; // run destructor47 ^ptr{}; // run destructor 48 48 free( ptr ); 49 49 } // if 50 50 } // delete 51 51 52 forall( dtype T, ttype Params | sized(T) | { void ^?{}( T &); void delete( Params ); } )52 forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } ) 53 53 void delete( T * ptr, Params rest ) { 54 54 if ( ptr ) { // ignore null 55 ^ (*ptr){}; // run destructor55 ^ptr{}; // run destructor 56 56 free( ptr ); 57 57 } // if … … 61 61 62 62 // allocation/deallocation and constructor/destructor, array types 63 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } )63 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) 64 64 T * anew( size_t dim, Params p ) { 65 65 T *arr = alloc( dim ); 66 66 for ( unsigned int i = 0; i < dim; i += 1 ) { 67 ( arr[i]){ p }; // run constructor67 (&arr[i]){ p }; // run constructor 68 68 } // for 69 69 return arr; 70 70 } // anew 71 71 72 forall( dtype T | sized(T) | { void ^?{}( T &); } )72 forall( dtype T | sized(T) | { void ^?{}( T * ); } ) 73 73 void adelete( size_t dim, T arr[] ) { 74 74 if ( arr ) { // ignore null 75 75 for ( int i = dim - 1; i >= 0; i -= 1 ) { // reverse allocation order, must be unsigned 76 ^( arr[i]){}; // run destructor76 ^(&arr[i]){}; // run destructor 77 77 } // for 78 78 free( arr ); … … 80 80 } // adelete 81 81 82 forall( dtype T | sized(T) | { void ^?{}( T &); }, ttype Params | { void adelete( Params ); } )82 forall( dtype T | sized(T) | { void ^?{}( T * ); }, ttype Params | { void adelete( Params ); } ) 83 83 void adelete( size_t dim, T arr[], Params rest ) { 84 84 if ( arr ) { // ignore null 85 85 for ( int i = dim - 1; i >= 0; i -= 1 ) { // reverse allocation order, must be unsigned 86 ^( arr[i]){}; // run destructor86 ^(&arr[i]){}; // run destructor 87 87 } // for 88 88 free( arr ); -
src/prelude/builtins.c
r8217e8f rbd46af4 80 80 } // ?\? 81 81 82 static inline forall( otype T | { void ?{}( T &this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } )82 static inline forall( otype T | { void ?{}( T * this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } ) 83 83 double ?\?( T x, signed long int y ) { 84 84 if ( y >= 0 ) return (double)(x \ (unsigned long int)y); -
src/prelude/prelude.cf
r8217e8f rbd46af4 30 30 // ------------------------------------------------------------ 31 31 32 _Bool ?++( _Bool & ), ?++( volatile _Bool &);33 _Bool ?--( _Bool & ), ?--( volatile _Bool &);34 unsigned char ?++( unsigned char & ), ?++( volatile unsigned char &);35 signed int ?++( signed int & ), ?++( volatile signed int &);36 signed int ?--( signed int & ), ?--( volatile signed int &);37 unsigned int ?++( unsigned int & ), ?++( volatile unsigned int &);38 unsigned int ?--( unsigned int & ), ?--( volatile unsigned int &);39 signed long int ?++( signed long int & ), ?++( volatile signed long int &);40 signed long int ?--( signed long int & ), ?--( volatile signed long int &);41 unsigned long int ?++( unsigned long int & ), ?++( volatile unsigned long int &);42 unsigned long int ?--( unsigned long int & ), ?--( volatile unsigned long int &);43 signed long long int ?++( signed long long int & ), ?++( volatile signed long long int &);44 signed long long int ?--( signed long long int & ), ?--( volatile signed long long int &);45 unsigned long long int ?++( unsigned long long int & ), ?++( volatile unsigned long long int &);46 unsigned long long int ?--( unsigned long long int & ), ?--( volatile unsigned long long int &);47 float ?++( float & ), ?++( volatile float &);48 float ?--( float & ), ?--( volatile float &);49 double ?++( double & ), ?++( volatile double &);50 double ?--( double & ), ?--( volatile double &);51 long double ?++( long double & ), ?++( volatile long double &);52 long double ?--( long double & ), ?--( volatile long double &);53 float _Complex ?++( float _Complex & ), ?++( volatile float _Complex &);54 float _Complex ?--( float _Complex & ), ?--( volatile float _Complex &);55 double _Complex ?++( double _Complex & ), ?++( volatile double _Complex &);56 double _Complex ?--( double _Complex & ), ?--( volatile double _Complex &);57 long double _Complex ?++( long double _Complex & ), ?++( volatile long double _Complex &);58 long double _Complex ?--( long double _Complex & ), ?--( volatile long double _Complex &);59 60 forall( dtype T | sized(T) ) T * ?++( T * &);61 forall( dtype T | sized(T) ) const T * ?++( const T * &);62 forall( dtype T | sized(T) ) volatile T * ?++( volatile T * &);63 forall( dtype T | sized(T) ) const volatile T * ?++( const volatile T * &);64 forall( dtype T | sized(T) ) T * ?--( T * &);65 forall( dtype T | sized(T) ) const T * ?--( const T * &);66 forall( dtype T | sized(T) ) volatile T * ?--( volatile T * &);67 forall( dtype T | sized(T) ) const volatile T * ?--( const volatile T * &);68 69 forall( dtype T | sized(T) ) T &?[?]( T *, ptrdiff_t );70 forall( dtype T | sized(T) ) const T &?[?]( const T *, ptrdiff_t );71 forall( dtype T | sized(T) ) volatile T &?[?]( volatile T *, ptrdiff_t );72 forall( dtype T | sized(T) ) const volatile T &?[?]( const volatile T *, ptrdiff_t );73 forall( dtype T | sized(T) ) T &?[?]( ptrdiff_t, T * );74 forall( dtype T | sized(T) ) const T &?[?]( ptrdiff_t, const T * );75 forall( dtype T | sized(T) ) volatile T &?[?]( ptrdiff_t, volatile T * );76 forall( dtype T | sized(T) ) const volatile T &?[?]( ptrdiff_t, const volatile T * );32 _Bool ?++( _Bool * ), ?++( volatile _Bool * ); 33 _Bool ?--( _Bool * ), ?--( volatile _Bool * ); 34 unsigned char ?++( unsigned char * ), ?++( volatile unsigned char * ); 35 signed int ?++( signed int * ), ?++( volatile signed int * ); 36 signed int ?--( signed int * ), ?--( volatile signed int * ); 37 unsigned int ?++( unsigned int * ), ?++( volatile unsigned int * ); 38 unsigned int ?--( unsigned int * ), ?--( volatile unsigned int * ); 39 signed long int ?++( signed long int * ), ?++( volatile signed long int * ); 40 signed long int ?--( signed long int * ), ?--( volatile signed long int * ); 41 unsigned long int ?++( unsigned long int * ), ?++( volatile unsigned long int * ); 42 unsigned long int ?--( unsigned long int * ), ?--( volatile unsigned long int * ); 43 signed long long int ?++( signed long long int * ), ?++( volatile signed long long int * ); 44 signed long long int ?--( signed long long int * ), ?--( volatile signed long long int * ); 45 unsigned long long int ?++( unsigned long long int * ), ?++( volatile unsigned long long int * ); 46 unsigned long long int ?--( unsigned long long int * ), ?--( volatile unsigned long long int * ); 47 float ?++( float * ), ?++( volatile float * ); 48 float ?--( float * ), ?--( volatile float * ); 49 double ?++( double * ), ?++( volatile double * ); 50 double ?--( double * ), ?--( volatile double * ); 51 long double ?++( long double * ), ?++( volatile long double * ); 52 long double ?--( long double * ), ?--( volatile long double * ); 53 float _Complex ?++( float _Complex * ), ?++( volatile float _Complex * ); 54 float _Complex ?--( float _Complex * ), ?--( volatile float _Complex * ); 55 double _Complex ?++( double _Complex * ), ?++( volatile double _Complex * ); 56 double _Complex ?--( double _Complex * ), ?--( volatile double _Complex * ); 57 long double _Complex ?++( long double _Complex * ), ?++( volatile long double _Complex * ); 58 long double _Complex ?--( long double _Complex * ), ?--( volatile long double _Complex * ); 59 60 forall( dtype T | sized(T) ) T * ?++( T ** ); 61 forall( dtype T | sized(T) ) const T * ?++( const T ** ); 62 forall( dtype T | sized(T) ) volatile T * ?++( volatile T ** ); 63 forall( dtype T | sized(T) ) const volatile T * ?++( const volatile T ** ); 64 forall( dtype T | sized(T) ) T * ?--( T ** ); 65 forall( dtype T | sized(T) ) const T * ?--( const T ** ); 66 forall( dtype T | sized(T) ) volatile T * ?--( volatile T ** ); 67 forall( dtype T | sized(T) ) const volatile T * ?--( const volatile T ** ); 68 69 forall( dtype T | sized(T) ) lvalue T ?[?]( T *, ptrdiff_t ); 70 forall( dtype T | sized(T) ) const lvalue T ?[?]( const T *, ptrdiff_t ); 71 forall( dtype T | sized(T) ) volatile lvalue T ?[?]( volatile T *, ptrdiff_t ); 72 forall( dtype T | sized(T) ) const volatile lvalue T ?[?]( const volatile T *, ptrdiff_t ); 73 forall( dtype T | sized(T) ) lvalue T ?[?]( ptrdiff_t, T * ); 74 forall( dtype T | sized(T) ) const lvalue T ?[?]( ptrdiff_t, const T * ); 75 forall( dtype T | sized(T) ) volatile lvalue T ?[?]( ptrdiff_t, volatile T * ); 76 forall( dtype T | sized(T) ) const volatile lvalue T ?[?]( ptrdiff_t, const volatile T * ); 77 77 78 78 // ------------------------------------------------------------ … … 82 82 // ------------------------------------------------------------ 83 83 84 _Bool ++?( _Bool & ), --?( _Bool &);85 signed int ++?( signed int & ), --?( signed int &);86 unsigned int ++?( unsigned int & ), --?( unsigned int &);87 signed long int ++?( signed long int & ), --?( signed long int &);88 unsigned long int ++?( unsigned long int & ), --?( unsigned long int &);89 signed long long int ++?( signed long long int & ), --?( signed long long int &);90 unsigned long long int ++?( unsigned long long int & ), --?( unsigned long long int &);91 float ++?( float & ), --?( float &);92 double ++?( double & ), --?( double &);93 long double ++?( long double & ), --?( long double &);94 float _Complex ++?( float _Complex & ), --?( float _Complex &);95 double _Complex ++?( double _Complex & ), --?( double _Complex &);96 long double _Complex ++?( long double _Complex & ), --?( long double _Complex &);97 98 forall( dtype T | sized(T) ) T * ++?( T * &);99 forall( dtype T | sized(T) ) const T * ++?( const T * &);100 forall( dtype T | sized(T) ) volatile T * ++?( volatile T * &);101 forall( dtype T | sized(T) ) const volatile T * ++?( const volatile T * &);102 forall( dtype T | sized(T) ) T * --?( T * &);103 forall( dtype T | sized(T) ) const T * --?( const T * &);104 forall( dtype T | sized(T) ) volatile T * --?( volatile T * &);105 forall( dtype T | sized(T) ) const volatile T * --?( const volatile T * &);106 107 forall( dtype T | sized(T) ) T &*?( T * );108 forall( dtype T | sized(T) ) const T &*?( const T * );109 forall( dtype T | sized(T) ) volatile T &*?( volatile T * );110 forall( dtype T | sized(T) ) const volatile T &*?( const volatile T * );111 forall( ftype FT ) FT &*?( FT * );84 _Bool ++?( _Bool * ), --?( _Bool * ); 85 signed int ++?( signed int * ), --?( signed int * ); 86 unsigned int ++?( unsigned int * ), --?( unsigned int * ); 87 signed long int ++?( signed long int * ), --?( signed long int * ); 88 unsigned long int ++?( unsigned long int * ), --?( unsigned long int * ); 89 signed long long int ++?( signed long long int * ), --?( signed long long int * ); 90 unsigned long long int ++?( unsigned long long int * ), --?( unsigned long long int * ); 91 float ++?( float * ), --?( float * ); 92 double ++?( double * ), --?( double * ); 93 long double ++?( long double * ), --?( long double * ); 94 float _Complex ++?( float _Complex * ), --?( float _Complex * ); 95 double _Complex ++?( double _Complex * ), --?( double _Complex * ); 96 long double _Complex ++?( long double _Complex * ), --?( long double _Complex * ); 97 98 forall( dtype T | sized(T) ) T * ++?( T ** ); 99 forall( dtype T | sized(T) ) const T * ++?( const T ** ); 100 forall( dtype T | sized(T) ) volatile T * ++?( volatile T ** ); 101 forall( dtype T | sized(T) ) const volatile T * ++?( const volatile T ** ); 102 forall( dtype T | sized(T) ) T * --?( T ** ); 103 forall( dtype T | sized(T) ) const T * --?( const T ** ); 104 forall( dtype T | sized(T) ) volatile T * --?( volatile T ** ); 105 forall( dtype T | sized(T) ) const volatile T * --?( const volatile T ** ); 106 107 forall( dtype T | sized(T) ) lvalue T *?( T * ); 108 forall( dtype T | sized(T) ) const lvalue T *?( const T * ); 109 forall( dtype T | sized(T) ) volatile lvalue T *?( volatile T * ); 110 forall( dtype T | sized(T) ) const volatile lvalue T *?( const volatile T * ); 111 forall( ftype FT ) lvalue FT *?( FT * ); 112 112 113 113 _Bool +?( _Bool ), -?( _Bool ), ~?( _Bool ); … … 366 366 // ------------------------------------------------------------ 367 367 368 forall( ftype FT ) FT * ?=?( FT * &, FT * );369 forall( ftype FT ) FT * ?=?( FT * volatile &, FT * );370 371 forall( dtype DT ) DT * ?=?( DT * &, DT * );372 forall( dtype DT ) DT * ?=?( DT * volatile &, DT * );373 forall( dtype DT ) const DT * ?=?( const DT * &, DT * );374 forall( dtype DT ) const DT * ?=?( const DT * volatile &, DT * );375 forall( dtype DT ) const DT * ?=?( const DT * &, const DT * );376 forall( dtype DT ) const DT * ?=?( const DT * volatile &, const DT * );377 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, DT * );378 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, DT * );379 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, volatile DT * );380 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, volatile DT * );381 382 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, DT * );383 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, DT * );384 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const DT * );385 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const DT * );386 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, volatile DT * );387 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, volatile DT * );388 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const volatile DT * );389 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const volatile DT * );390 391 forall( dtype DT ) DT * ?=?( DT * &, void * );392 forall( dtype DT ) DT * ?=?( DT * volatile &, void * );393 forall( dtype DT ) const DT * ?=?( const DT * &, void * );394 forall( dtype DT ) const DT * ?=?( const DT * volatile &, void * );395 forall( dtype DT ) const DT * ?=?( const DT * &, const void * );396 forall( dtype DT ) const DT * ?=?( const DT * volatile &, const void * );397 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, void * );398 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, void * );399 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, volatile void * );400 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, volatile void * );401 402 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, void * );403 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, void * );404 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const void * );405 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const void * );406 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, volatile void * );407 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, volatile void * );408 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const volatile void * );409 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const volatile void * );410 411 forall( dtype DT ) void * ?=?( void * &, DT * );412 forall( dtype DT ) void * ?=?( void * volatile &, DT * );413 forall( dtype DT ) const void * ?=?( const void * &, DT * );414 forall( dtype DT ) const void * ?=?( const void * volatile &, DT * );415 forall( dtype DT ) const void * ?=?( const void * &, const DT * );416 forall( dtype DT ) const void * ?=?( const void * volatile &, const DT * );417 forall( dtype DT ) volatile void * ?=?( volatile void * &, DT * );418 forall( dtype DT ) volatile void * ?=?( volatile void * volatile &, DT * );419 forall( dtype DT ) volatile void * ?=?( volatile void * &, volatile DT * );420 forall( dtype DT ) volatile void * ?=?( volatile void * volatile &, volatile DT * );421 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, DT * );422 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, DT * );423 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, const DT * );424 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, const DT * );425 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, volatile DT * );426 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, volatile DT * );427 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, const volatile DT * );428 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, const volatile DT * );429 430 void * ?=?( void * &, void * );431 void * ?=?( void * volatile &, void * );432 const void * ?=?( const void * &, void * );433 const void * ?=?( const void * volatile &, void * );434 const void * ?=?( const void * &, const void * );435 const void * ?=?( const void * volatile &, const void * );436 volatile void * ?=?( volatile void * &, void * );437 volatile void * ?=?( volatile void * volatile &, void * );438 volatile void * ?=?( volatile void * &, volatile void * );439 volatile void * ?=?( volatile void * volatile &, volatile void * );440 const volatile void * ?=?( const volatile void * &, void * );441 const volatile void * ?=?( const volatile void * volatile &, void * );442 const volatile void * ?=?( const volatile void * &, const void * );443 const volatile void * ?=?( const volatile void * volatile &, const void * );444 const volatile void * ?=?( const volatile void * &, volatile void * );445 const volatile void * ?=?( const volatile void * volatile &, volatile void * );446 const volatile void * ?=?( const volatile void * &, const volatile void * );447 const volatile void * ?=?( const volatile void * volatile &, const volatile void * );448 449 // forall( dtype DT ) DT * ?=?( DT * &, zero_t );450 // forall( dtype DT ) DT * ?=?( DT * volatile &, zero_t );451 forall( dtype DT ) const DT * ?=?( const DT * &, zero_t );452 forall( dtype DT ) const DT * ?=?( const DT * volatile &, zero_t );453 // forall( dtype DT ) volatile DT * ?=?( volatile DT * &, zero_t );454 // forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, zero_t);455 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, zero_t );456 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, zero_t );457 458 forall( ftype FT ) FT * ?=?( FT * &, forall( ftype FT2 ) FT2 *);459 forall( ftype FT ) FT * ?=?( FT * volatile &, forall( ftype FT2 ) FT2 *);460 461 forall( dtype T | sized(T) ) T * ?+=?( T * &, ptrdiff_t );462 forall( dtype T | sized(T) ) T * ?+=?( T * volatile &, ptrdiff_t );463 forall( dtype T | sized(T) ) const T * ?+=?( const T * &, ptrdiff_t );464 forall( dtype T | sized(T) ) const T * ?+=?( const T * volatile &, ptrdiff_t );465 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * &, ptrdiff_t );466 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * volatile &, ptrdiff_t );467 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * &, ptrdiff_t );468 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile &, ptrdiff_t );469 forall( dtype T | sized(T) ) T * ?-=?( T * &, ptrdiff_t );470 forall( dtype T | sized(T) ) T * ?-=?( T * volatile &, ptrdiff_t );471 forall( dtype T | sized(T) ) const T * ?-=?( const T * &, ptrdiff_t );472 forall( dtype T | sized(T) ) const T * ?-=?( const T * volatile &, ptrdiff_t );473 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * &, ptrdiff_t );474 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * volatile &, ptrdiff_t );475 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * &, ptrdiff_t );476 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile &, ptrdiff_t );477 478 _Bool ?=?( _Bool &, _Bool ), ?=?( volatile _Bool &, _Bool );479 char ?=?( char &, char ), ?=?( volatile char &, char );480 char signed ?=?( char signed &, char signed ), ?=?( volatile char signed &, char signed );481 char unsigned ?=?( char unsigned &, char unsigned ), ?=?( volatile char unsigned &, char unsigned );482 int short ?=?( int short &, int short ), ?=?( volatile int short &, int short );483 int short unsigned ?=?( int short unsigned &, int short unsigned ), ?=?( volatile int short unsigned &, int short unsigned );484 signed int ?=?( signed int &, signed int ), ?=?( volatile signed int &, signed int );485 unsigned int ?=?( unsigned &, unsigned ), ?=?( volatile unsigned &, unsigned );486 signed long int ?=?( signed long int &, signed long int ), ?=?( volatile signed long int &, signed long int );487 unsigned long int ?=?( unsigned long int &, unsigned long int ), ?=?( volatile unsigned long int &, unsigned long int );488 signed long long int ?=?( signed long long int &, signed long long int ), ?=?( volatile signed long long int &, signed long long int );489 unsigned long long int ?=?( unsigned long long int &, unsigned long long int ), ?=?( volatile unsigned long long int &, unsigned long long int );490 zero_t ?=?( zero_t &, zero_t );491 one_t ?=?( one_t &, one_t );492 493 494 _Bool ?*=?( _Bool &, _Bool ), ?*=?( volatile _Bool &, _Bool );495 char ?*=?( char &, char ), ?*=?( volatile char &, char );496 char signed ?*=?( char signed &, char signed ), ?*=?( volatile char signed &, char signed );497 char unsigned ?*=?( char unsigned &, char unsigned ), ?*=?( volatile char unsigned &, char unsigned );498 int short ?*=?( int short &, int short ), ?*=?( volatile int short &, int short );499 int short unsigned ?*=?( int short unsigned &, int short unsigned ), ?*=?( volatile int short unsigned &, int short unsigned );500 signed int ?*=?( signed int &, signed int ), ?*=?( volatile signed int &, signed int );501 unsigned int ?*=?( unsigned &, unsigned ), ?*=?( volatile unsigned &, unsigned );502 signed long int ?*=?( signed long int &, signed long int ), ?*=?( volatile signed long int &, signed long int );503 unsigned long int ?*=?( unsigned long int &, unsigned long int ), ?*=?( volatile unsigned long int &, unsigned long int );504 signed long long int ?*=?( signed long long int &, signed long long int ), ?*=?( volatile signed long long int &, signed long long int );505 unsigned long long int ?*=?( unsigned long long int &, unsigned long long int ), ?*=?( volatile unsigned long long int &, unsigned long long int );506 507 _Bool ?/=?( _Bool &, _Bool ), ?/=?( volatile _Bool &, _Bool );508 char ?/=?( char &, char ), ?/=?( volatile char &, char );509 char signed ?/=?( char signed &, char signed ), ?/=?( volatile char signed &, char signed );510 char unsigned ?/=?( char unsigned &, char unsigned ), ?/=?( volatile char unsigned &, char unsigned );511 int short ?/=?( int short &, int short ), ?/=?( volatile int short &, int short );512 int short unsigned ?/=?( int short unsigned &, int short unsigned ), ?/=?( volatile int short unsigned &, int short unsigned );513 signed int ?/=?( signed int &, signed int ), ?/=?( volatile signed int &, signed int );514 unsigned int ?/=?( unsigned &, unsigned ), ?/=?( volatile unsigned &, unsigned );515 signed long int ?/=?( signed long int &, signed long int ), ?/=?( volatile signed long int &, signed long int );516 unsigned long int ?/=?( unsigned long int &, unsigned long int ), ?/=?( volatile unsigned long int &, unsigned long int );517 signed long long int ?/=?( signed long long int &, signed long long int ), ?/=?( volatile signed long long int &, signed long long int );518 unsigned long long int ?/=?( unsigned long long int &, unsigned long long int ), ?/=?( volatile unsigned long long int &, unsigned long long int );519 520 _Bool ?%=?( _Bool &, _Bool ), ?%=?( volatile _Bool &, _Bool );521 char ?%=?( char &, char ), ?%=?( volatile char &, char );522 char signed ?%=?( char signed &, char signed ), ?%=?( volatile char signed &, char signed );523 char unsigned ?%=?( char unsigned &, char unsigned ), ?%=?( volatile char unsigned &, char unsigned );524 int short ?%=?( int short &, int short ), ?%=?( volatile int short &, int short );525 int short unsigned ?%=?( int short unsigned &, int short unsigned ), ?%=?( volatile int short unsigned &, int short unsigned );526 signed int ?%=?( signed int &, signed int ), ?%=?( volatile signed int &, signed int );527 unsigned int ?%=?( unsigned &, unsigned ), ?%=?( volatile unsigned &, unsigned );528 signed long int ?%=?( signed long int &, signed long int ), ?%=?( volatile signed long int &, signed long int );529 unsigned long int ?%=?( unsigned long int &, unsigned long int ), ?%=?( volatile unsigned long int &, unsigned long int );530 signed long long int ?%=?( signed long long int &, signed long long int ), ?%=?( volatile signed long long int &, signed long long int );531 unsigned long long int ?%=?( unsigned long long int &, unsigned long long int ), ?%=?( volatile unsigned long long int &, unsigned long long int );532 533 _Bool ?+=?( _Bool &, _Bool ), ?+=?( volatile _Bool &, _Bool );534 char ?+=?( char &, char ), ?+=?( volatile char &, char );535 char signed ?+=?( char signed &, char signed ), ?+=?( volatile char signed &, char signed );536 char unsigned ?+=?( char unsigned &, char unsigned ), ?+=?( volatile char unsigned &, char unsigned );537 int short ?+=?( int short &, int short ), ?+=?( volatile int short &, int short );538 int short unsigned ?+=?( int short unsigned &, int short unsigned ), ?+=?( volatile int short unsigned &, int short unsigned );539 signed int ?+=?( signed int &, signed int ), ?+=?( volatile signed int &, signed int );540 unsigned int ?+=?( unsigned &, unsigned ), ?+=?( volatile unsigned &, unsigned );541 signed long int ?+=?( signed long int &, signed long int ), ?+=?( volatile signed long int &, signed long int );542 unsigned long int ?+=?( unsigned long int &, unsigned long int ), ?+=?( volatile unsigned long int &, unsigned long int );543 signed long long int ?+=?( signed long long int &, signed long long int ), ?+=?( volatile signed long long int &, signed long long int );544 unsigned long long int ?+=?( unsigned long long int &, unsigned long long int ), ?+=?( volatile unsigned long long int &, unsigned long long int );545 546 _Bool ?-=?( _Bool &, _Bool ), ?-=?( volatile _Bool &, _Bool );547 char ?-=?( char &, char ), ?-=?( volatile char &, char );548 char signed ?-=?( char signed &, char signed ), ?-=?( volatile char signed &, char signed );549 char unsigned ?-=?( char unsigned &, char unsigned ), ?-=?( volatile char unsigned &, char unsigned );550 int short ?-=?( int short &, int short ), ?-=?( volatile int short &, int short );551 int short unsigned ?-=?( int short unsigned &, int short unsigned ), ?-=?( volatile int short unsigned &, int short unsigned );552 signed int ?-=?( signed int &, signed int ), ?-=?( volatile signed int &, signed int );553 unsigned int ?-=?( unsigned &, unsigned ), ?-=?( volatile unsigned &, unsigned );554 signed long int ?-=?( signed long int &, signed long int ), ?-=?( volatile signed long int &, signed long int );555 unsigned long int ?-=?( unsigned long int &, unsigned long int ), ?-=?( volatile unsigned long int &, unsigned long int );556 signed long long int ?-=?( signed long long int &, signed long long int ), ?-=?( volatile signed long long int &, signed long long int );557 unsigned long long int ?-=?( unsigned long long int &, unsigned long long int ), ?-=?( volatile unsigned long long int &, unsigned long long int );558 559 _Bool ?<<=?( _Bool &, _Bool ), ?<<=?( volatile _Bool &, _Bool );560 char ?<<=?( char &, char ), ?<<=?( volatile char &, char );561 char signed ?<<=?( char signed &, char signed ), ?<<=?( volatile char signed &, char signed );562 char unsigned ?<<=?( char unsigned &, char unsigned ), ?<<=?( volatile char unsigned &, char unsigned );563 int short ?<<=?( int short &, int short ), ?<<=?( volatile int short &, int short );564 int short unsigned ?<<=?( int short unsigned &, int short unsigned ), ?<<=?( volatile int short unsigned &, int short unsigned );565 signed int ?<<=?( signed int &, signed int ), ?<<=?( volatile signed int &, signed int );566 unsigned int ?<<=?( unsigned &, unsigned ), ?<<=?( volatile unsigned &, unsigned );567 signed long int ?<<=?( signed long int &, signed long int ), ?<<=?( volatile signed long int &, signed long int );568 unsigned long int ?<<=?( unsigned long int &, unsigned long int ), ?<<=?( volatile unsigned long int &, unsigned long int );569 signed long long int ?<<=?( signed long long int &, signed long long int ), ?<<=?( volatile signed long long int &, signed long long int );570 unsigned long long int ?<<=?( unsigned long long int &, unsigned long long int ), ?<<=?( volatile unsigned long long int &, unsigned long long int );571 572 _Bool ?>>=?( _Bool &, _Bool ), ?>>=?( volatile _Bool &, _Bool );573 char ?>>=?( char &, char ), ?>>=?( volatile char &, char );574 char signed ?>>=?( char signed &, char signed ), ?>>=?( volatile char signed &, char signed );575 char unsigned ?>>=?( char unsigned &, char unsigned ), ?>>=?( volatile char unsigned &, char unsigned );576 int short ?>>=?( int short &, int short ), ?>>=?( volatile int short &, int short );577 int short unsigned ?>>=?( int short unsigned &, int short unsigned ), ?>>=?( volatile int short unsigned &, int short unsigned );578 signed int ?>>=?( signed int &, signed int ), ?>>=?( volatile signed int &, signed int );579 unsigned int ?>>=?( unsigned &, unsigned ), ?>>=?( volatile unsigned &, unsigned );580 signed long int ?>>=?( signed long int &, signed long int ), ?>>=?( volatile signed long int &, signed long int );581 unsigned long int ?>>=?( unsigned long int &, unsigned long int ), ?>>=?( volatile unsigned long int &, unsigned long int );582 signed long long int ?>>=?( signed long long int &, signed long long int ), ?>>=?( volatile signed long long int &, signed long long int );583 unsigned long long int ?>>=?( unsigned long long int &, unsigned long long int ), ?>>=?( volatile unsigned long long int &, unsigned long long int );584 585 _Bool ?&=?( _Bool &, _Bool ), ?&=?( volatile _Bool &, _Bool );586 char ?&=?( char &, char ), ?&=?( volatile char &, char );587 char signed ?&=?( char signed &, char signed ), ?&=?( volatile char signed &, char signed );588 char unsigned ?&=?( char unsigned &, char unsigned ), ?&=?( volatile char unsigned &, char unsigned );589 int short ?&=?( int short &, int short ), ?&=?( volatile int short &, int short );590 int short unsigned ?&=?( int short unsigned &, int short unsigned ), ?&=?( volatile int short unsigned &, int short unsigned );591 signed int ?&=?( signed int &, signed int ), ?&=?( volatile signed int &, signed int );592 unsigned int ?&=?( unsigned &, unsigned ), ?&=?( volatile unsigned &, unsigned );593 signed long int ?&=?( signed long int &, signed long int ), ?&=?( volatile signed long int &, signed long int );594 unsigned long int ?&=?( unsigned long int &, unsigned long int ), ?&=?( volatile unsigned long int &, unsigned long int );595 signed long long int ?&=?( signed long long int &, signed long long int ), ?&=?( volatile signed long long int &, signed long long int );596 unsigned long long int ?&=?( unsigned long long int &, unsigned long long int ), ?&=?( volatile unsigned long long int &, unsigned long long int );597 598 _Bool ?|=?( _Bool &, _Bool ), ?|=?( volatile _Bool &, _Bool );599 char ?|=?( char &, char ), ?|=?( volatile char &, char );600 char signed ?|=?( char signed &, char signed ), ?|=?( volatile char signed &, char signed );601 char unsigned ?|=?( char unsigned &, char unsigned ), ?|=?( volatile char unsigned &, char unsigned );602 int short ?|=?( int short &, int short ), ?|=?( volatile int short &, int short );603 int short unsigned ?|=?( int short unsigned &, int short unsigned ), ?|=?( volatile int short unsigned &, int short unsigned );604 signed int ?|=?( signed int &, signed int ), ?|=?( volatile signed int &, signed int );605 unsigned int ?|=?( unsigned &, unsigned ), ?|=?( volatile unsigned &, unsigned );606 signed long int ?|=?( signed long int &, signed long int ), ?|=?( volatile signed long int &, signed long int );607 unsigned long int ?|=?( unsigned long int &, unsigned long int ), ?|=?( volatile unsigned long int &, unsigned long int );608 signed long long int ?|=?( signed long long int &, signed long long int ), ?|=?( volatile signed long long int &, signed long long int );609 unsigned long long int ?|=?( unsigned long long int &, unsigned long long int ), ?|=?( volatile unsigned long long int &, unsigned long long int );610 611 _Bool ?^=?( _Bool &, _Bool ), ?^=?( volatile _Bool &, _Bool );612 char ?^=?( char &, char ), ?^=?( volatile char &, char );613 char signed ?^=?( char signed &, char signed ), ?^=?( volatile char signed &, char signed );614 char unsigned ?^=?( char unsigned &, char unsigned ), ?^=?( volatile char unsigned &, char unsigned );615 int short ?^=?( int short &, int short ), ?^=?( volatile int short &, int short );616 int short unsigned ?^=?( int short unsigned &, int short unsigned ), ?^=?( volatile int short unsigned &, int short unsigned );617 signed int ?^=?( signed int &, signed int ), ?^=?( volatile signed int &, signed int );618 unsigned int ?^=?( unsigned &, unsigned ), ?^=?( volatile unsigned &, unsigned );619 signed long int ?^=?( signed long int &, signed long int ), ?^=?( volatile signed long int &, signed long int );620 unsigned long int ?^=?( unsigned long int &, unsigned long int ), ?^=?( volatile unsigned long int &, unsigned long int );621 signed long long int ?^=?( signed long long int &, signed long long int ), ?^=?( volatile signed long long int &, signed long long int );622 unsigned long long int ?^=?( unsigned long long int &, unsigned long long int ), ?^=?( volatile unsigned long long int &, unsigned long long int );623 624 float ?=?( float &, float ), ?=?( volatile float &, float ),625 ?*=?( float &, float ), ?*=?( volatile float &, float ),626 ?/=?( float &, float ), ?/=?( volatile float &, float ),627 ?+=?( float &, float ), ?+=?( volatile float &, float ),628 ?-=?( float &, float ), ?-=?( volatile float &, float );629 630 double ?=?( double &, double ), ?=?( volatile double &, double ),631 ?*=?( double &, double ), ?*=?( volatile double &, double ),632 ?/=?( double &, double ), ?/=?( volatile double &, double ),633 ?+=?( double &, double ), ?+=?( volatile double &, double ),634 ?-=?( double &, double ), ?-=?( volatile double &, double );635 636 long double ?=?( long double &, long double ), ?=?( volatile long double &, long double ),637 ?*=?( long double &, long double ), ?*=?( volatile long double &, long double ),638 ?/=?( long double &, long double ), ?/=?( volatile long double &, long double ),639 ?+=?( long double &, long double ), ?+=?( volatile long double &, long double ),640 ?-=?( long double &, long double ), ?-=?( volatile long double &, long double );641 642 float _Complex ?=?( float _Complex &, float _Complex ), ?=?( volatile float _Complex &, float _Complex ),643 ?*=?( float _Complex &, float _Complex ), ?*=?( volatile float _Complex &, float _Complex ),644 ?/=?( float _Complex &, float _Complex ), ?/=?( volatile float _Complex &, float _Complex ),645 ?+=?( float _Complex &, float _Complex ), ?+=?( volatile float _Complex &, float _Complex ),646 ?-=?( float _Complex &, float _Complex ), ?-=?( volatile float _Complex &, float _Complex );647 648 double _Complex ?=?( double _Complex &, double _Complex ), ?=?( volatile double _Complex &, double _Complex ),649 ?*=?( double _Complex &, double _Complex ), ?*=?( volatile double _Complex &, double _Complex ),650 ?/=?( double _Complex &, double _Complex ), ?/=?( volatile double _Complex &, double _Complex ),651 ?+=?( double _Complex &, double _Complex ), ?+=?( volatile double _Complex &, double _Complex ),652 ?-=?( double _Complex &, double _Complex ), ?-=?( volatile double _Complex &, double _Complex );653 654 long double _Complex ?=?( long double _Complex &, long double _Complex ), ?=?( volatile long double _Complex &, long double _Complex ),655 ?*=?( long double _Complex &, long double _Complex ), ?*=?( volatile long double _Complex &, long double _Complex ),656 ?/=?( long double _Complex &, long double _Complex ), ?/=?( volatile long double _Complex &, long double _Complex ),657 ?+=?( long double _Complex &, long double _Complex ), ?+=?( volatile long double _Complex &, long double _Complex ),658 ?-=?( long double _Complex &, long double _Complex ), ?-=?( volatile long double _Complex &, long double _Complex );368 forall( ftype FT ) FT * ?=?( FT **, FT * ); 369 forall( ftype FT ) FT * ?=?( FT * volatile *, FT * ); 370 371 forall( dtype DT ) DT * ?=?( DT * *, DT * ); 372 forall( dtype DT ) DT * ?=?( DT * volatile *, DT * ); 373 forall( dtype DT ) const DT * ?=?( const DT * *, DT * ); 374 forall( dtype DT ) const DT * ?=?( const DT * volatile *, DT * ); 375 forall( dtype DT ) const DT * ?=?( const DT * *, const DT * ); 376 forall( dtype DT ) const DT * ?=?( const DT * volatile *, const DT * ); 377 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, DT * ); 378 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, DT * ); 379 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, volatile DT * ); 380 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, volatile DT * ); 381 382 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, DT * ); 383 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, DT * ); 384 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const DT * ); 385 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const DT * ); 386 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, volatile DT * ); 387 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, volatile DT * ); 388 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const volatile DT * ); 389 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const volatile DT * ); 390 391 forall( dtype DT ) DT * ?=?( DT * *, void * ); 392 forall( dtype DT ) DT * ?=?( DT * volatile *, void * ); 393 forall( dtype DT ) const DT * ?=?( const DT * *, void * ); 394 forall( dtype DT ) const DT * ?=?( const DT * volatile *, void * ); 395 forall( dtype DT ) const DT * ?=?( const DT * *, const void * ); 396 forall( dtype DT ) const DT * ?=?( const DT * volatile *, const void * ); 397 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, void * ); 398 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, void * ); 399 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, volatile void * ); 400 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, volatile void * ); 401 402 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, void * ); 403 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, void * ); 404 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const void * ); 405 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const void * ); 406 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, volatile void * ); 407 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, volatile void * ); 408 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const volatile void * ); 409 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const volatile void * ); 410 411 forall( dtype DT ) void * ?=?( void * *, DT * ); 412 forall( dtype DT ) void * ?=?( void * volatile *, DT * ); 413 forall( dtype DT ) const void * ?=?( const void * *, DT * ); 414 forall( dtype DT ) const void * ?=?( const void * volatile *, DT * ); 415 forall( dtype DT ) const void * ?=?( const void * *, const DT * ); 416 forall( dtype DT ) const void * ?=?( const void * volatile *, const DT * ); 417 forall( dtype DT ) volatile void * ?=?( volatile void * *, DT * ); 418 forall( dtype DT ) volatile void * ?=?( volatile void * volatile *, DT * ); 419 forall( dtype DT ) volatile void * ?=?( volatile void * *, volatile DT * ); 420 forall( dtype DT ) volatile void * ?=?( volatile void * volatile *, volatile DT * ); 421 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, DT * ); 422 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, DT * ); 423 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, const DT * ); 424 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, const DT * ); 425 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, volatile DT * ); 426 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, volatile DT * ); 427 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, const volatile DT * ); 428 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, const volatile DT * ); 429 430 void * ?=?( void * *, void * ); 431 void * ?=?( void * volatile *, void * ); 432 const void * ?=?( const void * *, void * ); 433 const void * ?=?( const void * volatile *, void * ); 434 const void * ?=?( const void * *, const void * ); 435 const void * ?=?( const void * volatile *, const void * ); 436 volatile void * ?=?( volatile void * *, void * ); 437 volatile void * ?=?( volatile void * volatile *, void * ); 438 volatile void * ?=?( volatile void * *, volatile void * ); 439 volatile void * ?=?( volatile void * volatile *, volatile void * ); 440 const volatile void * ?=?( const volatile void * *, void * ); 441 const volatile void * ?=?( const volatile void * volatile *, void * ); 442 const volatile void * ?=?( const volatile void * *, const void * ); 443 const volatile void * ?=?( const volatile void * volatile *, const void * ); 444 const volatile void * ?=?( const volatile void * *, volatile void * ); 445 const volatile void * ?=?( const volatile void * volatile *, volatile void * ); 446 const volatile void * ?=?( const volatile void * *, const volatile void * ); 447 const volatile void * ?=?( const volatile void * volatile *, const volatile void * ); 448 449 // //forall( dtype DT ) DT * ?=?( DT * *, zero_t ); 450 // //forall( dtype DT ) DT * ?=?( DT * volatile *, zero_t ); 451 // forall( dtype DT ) const DT * ?=?( const DT * *, zero_t ); 452 // forall( dtype DT ) const DT * ?=?( const DT * volatile *, zero_t ); 453 // //forall( dtype DT ) volatile DT * ?=?( volatile DT * *, zero_t ); 454 // //forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, ); 455 // forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, zero_t ); 456 // forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, zero_t ); 457 458 // forall( ftype FT ) FT * ?=?( FT * *, zero_t ); 459 // forall( ftype FT ) FT * ?=?( FT * volatile *, zero_t ); 460 461 forall( dtype T | sized(T) ) T * ?+=?( T * *, ptrdiff_t ); 462 forall( dtype T | sized(T) ) T * ?+=?( T * volatile *, ptrdiff_t ); 463 forall( dtype T | sized(T) ) const T * ?+=?( const T * *, ptrdiff_t ); 464 forall( dtype T | sized(T) ) const T * ?+=?( const T * volatile *, ptrdiff_t ); 465 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * *, ptrdiff_t ); 466 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * volatile *, ptrdiff_t ); 467 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * *, ptrdiff_t ); 468 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile *, ptrdiff_t ); 469 forall( dtype T | sized(T) ) T * ?-=?( T * *, ptrdiff_t ); 470 forall( dtype T | sized(T) ) T * ?-=?( T * volatile *, ptrdiff_t ); 471 forall( dtype T | sized(T) ) const T * ?-=?( const T * *, ptrdiff_t ); 472 forall( dtype T | sized(T) ) const T * ?-=?( const T * volatile *, ptrdiff_t ); 473 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * *, ptrdiff_t ); 474 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * volatile *, ptrdiff_t ); 475 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * *, ptrdiff_t ); 476 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile *, ptrdiff_t ); 477 478 _Bool ?=?( _Bool *, _Bool ), ?=?( volatile _Bool *, _Bool ); 479 char ?=?( char *, char ), ?=?( volatile char *, char ); 480 char signed ?=?( char signed *, char signed ), ?=?( volatile char signed *, char signed ); 481 char unsigned ?=?( char unsigned *, char unsigned ), ?=?( volatile char unsigned *, char unsigned ); 482 int short ?=?( int short *, int short ), ?=?( volatile int short *, int short ); 483 int short unsigned ?=?( int short unsigned *, int short unsigned ), ?=?( volatile int short unsigned *, int short unsigned ); 484 signed int ?=?( signed int *, signed int ), ?=?( volatile signed int *, signed int ); 485 unsigned int ?=?( unsigned *, unsigned ), ?=?( volatile unsigned *, unsigned ); 486 signed long int ?=?( signed long int *, signed long int ), ?=?( volatile signed long int *, signed long int ); 487 unsigned long int ?=?( unsigned long int *, unsigned long int ), ?=?( volatile unsigned long int *, unsigned long int ); 488 signed long long int ?=?( signed long long int *, signed long long int ), ?=?( volatile signed long long int *, signed long long int ); 489 unsigned long long int ?=?( unsigned long long int *, unsigned long long int ), ?=?( volatile unsigned long long int *, unsigned long long int ); 490 zero_t ?=?( zero_t *, zero_t ); 491 one_t ?=?( one_t *, one_t ); 492 493 494 _Bool ?*=?( _Bool *, _Bool ), ?*=?( volatile _Bool *, _Bool ); 495 char ?*=?( char *, char ), ?*=?( volatile char *, char ); 496 char signed ?*=?( char signed *, char signed ), ?*=?( volatile char signed *, char signed ); 497 char unsigned ?*=?( char unsigned *, char unsigned ), ?*=?( volatile char unsigned *, char unsigned ); 498 int short ?*=?( int short *, int short ), ?*=?( volatile int short *, int short ); 499 int short unsigned ?*=?( int short unsigned *, int short unsigned ), ?*=?( volatile int short unsigned *, int short unsigned ); 500 signed int ?*=?( signed int *, signed int ), ?*=?( volatile signed int *, signed int ); 501 unsigned int ?*=?( unsigned *, unsigned ), ?*=?( volatile unsigned *, unsigned ); 502 signed long int ?*=?( signed long int *, signed long int ), ?*=?( volatile signed long int *, signed long int ); 503 unsigned long int ?*=?( unsigned long int *, unsigned long int ), ?*=?( volatile unsigned long int *, unsigned long int ); 504 signed long long int ?*=?( signed long long int *, signed long long int ), ?*=?( volatile signed long long int *, signed long long int ); 505 unsigned long long int ?*=?( unsigned long long int *, unsigned long long int ), ?*=?( volatile unsigned long long int *, unsigned long long int ); 506 507 _Bool ?/=?( _Bool *, _Bool ), ?/=?( volatile _Bool *, _Bool ); 508 char ?/=?( char *, char ), ?/=?( volatile char *, char ); 509 char signed ?/=?( char signed *, char signed ), ?/=?( volatile char signed *, char signed ); 510 char unsigned ?/=?( char unsigned *, char unsigned ), ?/=?( volatile char unsigned *, char unsigned ); 511 int short ?/=?( int short *, int short ), ?/=?( volatile int short *, int short ); 512 int short unsigned ?/=?( int short unsigned *, int short unsigned ), ?/=?( volatile int short unsigned *, int short unsigned ); 513 signed int ?/=?( signed int *, signed int ), ?/=?( volatile signed int *, signed int ); 514 unsigned int ?/=?( unsigned *, unsigned ), ?/=?( volatile unsigned *, unsigned ); 515 signed long int ?/=?( signed long int *, signed long int ), ?/=?( volatile signed long int *, signed long int ); 516 unsigned long int ?/=?( unsigned long int *, unsigned long int ), ?/=?( volatile unsigned long int *, unsigned long int ); 517 signed long long int ?/=?( signed long long int *, signed long long int ), ?/=?( volatile signed long long int *, signed long long int ); 518 unsigned long long int ?/=?( unsigned long long int *, unsigned long long int ), ?/=?( volatile unsigned long long int *, unsigned long long int ); 519 520 _Bool ?%=?( _Bool *, _Bool ), ?%=?( volatile _Bool *, _Bool ); 521 char ?%=?( char *, char ), ?%=?( volatile char *, char ); 522 char signed ?%=?( char signed *, char signed ), ?%=?( volatile char signed *, char signed ); 523 char unsigned ?%=?( char unsigned *, char unsigned ), ?%=?( volatile char unsigned *, char unsigned ); 524 int short ?%=?( int short *, int short ), ?%=?( volatile int short *, int short ); 525 int short unsigned ?%=?( int short unsigned *, int short unsigned ), ?%=?( volatile int short unsigned *, int short unsigned ); 526 signed int ?%=?( signed int *, signed int ), ?%=?( volatile signed int *, signed int ); 527 unsigned int ?%=?( unsigned *, unsigned ), ?%=?( volatile unsigned *, unsigned ); 528 signed long int ?%=?( signed long int *, signed long int ), ?%=?( volatile signed long int *, signed long int ); 529 unsigned long int ?%=?( unsigned long int *, unsigned long int ), ?%=?( volatile unsigned long int *, unsigned long int ); 530 signed long long int ?%=?( signed long long int *, signed long long int ), ?%=?( volatile signed long long int *, signed long long int ); 531 unsigned long long int ?%=?( unsigned long long int *, unsigned long long int ), ?%=?( volatile unsigned long long int *, unsigned long long int ); 532 533 _Bool ?+=?( _Bool *, _Bool ), ?+=?( volatile _Bool *, _Bool ); 534 char ?+=?( char *, char ), ?+=?( volatile char *, char ); 535 char signed ?+=?( char signed *, char signed ), ?+=?( volatile char signed *, char signed ); 536 char unsigned ?+=?( char unsigned *, char unsigned ), ?+=?( volatile char unsigned *, char unsigned ); 537 int short ?+=?( int short *, int short ), ?+=?( volatile int short *, int short ); 538 int short unsigned ?+=?( int short unsigned *, int short unsigned ), ?+=?( volatile int short unsigned *, int short unsigned ); 539 signed int ?+=?( signed int *, signed int ), ?+=?( volatile signed int *, signed int ); 540 unsigned int ?+=?( unsigned *, unsigned ), ?+=?( volatile unsigned *, unsigned ); 541 signed long int ?+=?( signed long int *, signed long int ), ?+=?( volatile signed long int *, signed long int ); 542 unsigned long int ?+=?( unsigned long int *, unsigned long int ), ?+=?( volatile unsigned long int *, unsigned long int ); 543 signed long long int ?+=?( signed long long int *, signed long long int ), ?+=?( volatile signed long long int *, signed long long int ); 544 unsigned long long int ?+=?( unsigned long long int *, unsigned long long int ), ?+=?( volatile unsigned long long int *, unsigned long long int ); 545 546 _Bool ?-=?( _Bool *, _Bool ), ?-=?( volatile _Bool *, _Bool ); 547 char ?-=?( char *, char ), ?-=?( volatile char *, char ); 548 char signed ?-=?( char signed *, char signed ), ?-=?( volatile char signed *, char signed ); 549 char unsigned ?-=?( char unsigned *, char unsigned ), ?-=?( volatile char unsigned *, char unsigned ); 550 int short ?-=?( int short *, int short ), ?-=?( volatile int short *, int short ); 551 int short unsigned ?-=?( int short unsigned *, int short unsigned ), ?-=?( volatile int short unsigned *, int short unsigned ); 552 signed int ?-=?( signed int *, signed int ), ?-=?( volatile signed int *, signed int ); 553 unsigned int ?-=?( unsigned *, unsigned ), ?-=?( volatile unsigned *, unsigned ); 554 signed long int ?-=?( signed long int *, signed long int ), ?-=?( volatile signed long int *, signed long int ); 555 unsigned long int ?-=?( unsigned long int *, unsigned long int ), ?-=?( volatile unsigned long int *, unsigned long int ); 556 signed long long int ?-=?( signed long long int *, signed long long int ), ?-=?( volatile signed long long int *, signed long long int ); 557 unsigned long long int ?-=?( unsigned long long int *, unsigned long long int ), ?-=?( volatile unsigned long long int *, unsigned long long int ); 558 559 _Bool ?<<=?( _Bool *, _Bool ), ?<<=?( volatile _Bool *, _Bool ); 560 char ?<<=?( char *, char ), ?<<=?( volatile char *, char ); 561 char signed ?<<=?( char signed *, char signed ), ?<<=?( volatile char signed *, char signed ); 562 char unsigned ?<<=?( char unsigned *, char unsigned ), ?<<=?( volatile char unsigned *, char unsigned ); 563 int short ?<<=?( int short *, int short ), ?<<=?( volatile int short *, int short ); 564 int short unsigned ?<<=?( int short unsigned *, int short unsigned ), ?<<=?( volatile int short unsigned *, int short unsigned ); 565 signed int ?<<=?( signed int *, signed int ), ?<<=?( volatile signed int *, signed int ); 566 unsigned int ?<<=?( unsigned *, unsigned ), ?<<=?( volatile unsigned *, unsigned ); 567 signed long int ?<<=?( signed long int *, signed long int ), ?<<=?( volatile signed long int *, signed long int ); 568 unsigned long int ?<<=?( unsigned long int *, unsigned long int ), ?<<=?( volatile unsigned long int *, unsigned long int ); 569 signed long long int ?<<=?( signed long long int *, signed long long int ), ?<<=?( volatile signed long long int *, signed long long int ); 570 unsigned long long int ?<<=?( unsigned long long int *, unsigned long long int ), ?<<=?( volatile unsigned long long int *, unsigned long long int ); 571 572 _Bool ?>>=?( _Bool *, _Bool ), ?>>=?( volatile _Bool *, _Bool ); 573 char ?>>=?( char *, char ), ?>>=?( volatile char *, char ); 574 char signed ?>>=?( char signed *, char signed ), ?>>=?( volatile char signed *, char signed ); 575 char unsigned ?>>=?( char unsigned *, char unsigned ), ?>>=?( volatile char unsigned *, char unsigned ); 576 int short ?>>=?( int short *, int short ), ?>>=?( volatile int short *, int short ); 577 int short unsigned ?>>=?( int short unsigned *, int short unsigned ), ?>>=?( volatile int short unsigned *, int short unsigned ); 578 signed int ?>>=?( signed int *, signed int ), ?>>=?( volatile signed int *, signed int ); 579 unsigned int ?>>=?( unsigned *, unsigned ), ?>>=?( volatile unsigned *, unsigned ); 580 signed long int ?>>=?( signed long int *, signed long int ), ?>>=?( volatile signed long int *, signed long int ); 581 unsigned long int ?>>=?( unsigned long int *, unsigned long int ), ?>>=?( volatile unsigned long int *, unsigned long int ); 582 signed long long int ?>>=?( signed long long int *, signed long long int ), ?>>=?( volatile signed long long int *, signed long long int ); 583 unsigned long long int ?>>=?( unsigned long long int *, unsigned long long int ), ?>>=?( volatile unsigned long long int *, unsigned long long int ); 584 585 _Bool ?&=?( _Bool *, _Bool ), ?&=?( volatile _Bool *, _Bool ); 586 char ?&=?( char *, char ), ?&=?( volatile char *, char ); 587 char signed ?&=?( char signed *, char signed ), ?&=?( volatile char signed *, char signed ); 588 char unsigned ?&=?( char unsigned *, char unsigned ), ?&=?( volatile char unsigned *, char unsigned ); 589 int short ?&=?( int short *, int short ), ?&=?( volatile int short *, int short ); 590 int short unsigned ?&=?( int short unsigned *, int short unsigned ), ?&=?( volatile int short unsigned *, int short unsigned ); 591 signed int ?&=?( signed int *, signed int ), ?&=?( volatile signed int *, signed int ); 592 unsigned int ?&=?( unsigned *, unsigned ), ?&=?( volatile unsigned *, unsigned ); 593 signed long int ?&=?( signed long int *, signed long int ), ?&=?( volatile signed long int *, signed long int ); 594 unsigned long int ?&=?( unsigned long int *, unsigned long int ), ?&=?( volatile unsigned long int *, unsigned long int ); 595 signed long long int ?&=?( signed long long int *, signed long long int ), ?&=?( volatile signed long long int *, signed long long int ); 596 unsigned long long int ?&=?( unsigned long long int *, unsigned long long int ), ?&=?( volatile unsigned long long int *, unsigned long long int ); 597 598 _Bool ?|=?( _Bool *, _Bool ), ?|=?( volatile _Bool *, _Bool ); 599 char ?|=?( char *, char ), ?|=?( volatile char *, char ); 600 char signed ?|=?( char signed *, char signed ), ?|=?( volatile char signed *, char signed ); 601 char unsigned ?|=?( char unsigned *, char unsigned ), ?|=?( volatile char unsigned *, char unsigned ); 602 int short ?|=?( int short *, int short ), ?|=?( volatile int short *, int short ); 603 int short unsigned ?|=?( int short unsigned *, int short unsigned ), ?|=?( volatile int short unsigned *, int short unsigned ); 604 signed int ?|=?( signed int *, signed int ), ?|=?( volatile signed int *, signed int ); 605 unsigned int ?|=?( unsigned *, unsigned ), ?|=?( volatile unsigned *, unsigned ); 606 signed long int ?|=?( signed long int *, signed long int ), ?|=?( volatile signed long int *, signed long int ); 607 unsigned long int ?|=?( unsigned long int *, unsigned long int ), ?|=?( volatile unsigned long int *, unsigned long int ); 608 signed long long int ?|=?( signed long long int *, signed long long int ), ?|=?( volatile signed long long int *, signed long long int ); 609 unsigned long long int ?|=?( unsigned long long int *, unsigned long long int ), ?|=?( volatile unsigned long long int *, unsigned long long int ); 610 611 _Bool ?^=?( _Bool *, _Bool ), ?^=?( volatile _Bool *, _Bool ); 612 char ?^=?( char *, char ), ?^=?( volatile char *, char ); 613 char signed ?^=?( char signed *, char signed ), ?^=?( volatile char signed *, char signed ); 614 char unsigned ?^=?( char unsigned *, char unsigned ), ?^=?( volatile char unsigned *, char unsigned ); 615 int short ?^=?( int short *, int short ), ?^=?( volatile int short *, int short ); 616 int short unsigned ?^=?( int short unsigned *, int short unsigned ), ?^=?( volatile int short unsigned *, int short unsigned ); 617 signed int ?^=?( signed int *, signed int ), ?^=?( volatile signed int *, signed int ); 618 unsigned int ?^=?( unsigned *, unsigned ), ?^=?( volatile unsigned *, unsigned ); 619 signed long int ?^=?( signed long int *, signed long int ), ?^=?( volatile signed long int *, signed long int ); 620 unsigned long int ?^=?( unsigned long int *, unsigned long int ), ?^=?( volatile unsigned long int *, unsigned long int ); 621 signed long long int ?^=?( signed long long int *, signed long long int ), ?^=?( volatile signed long long int *, signed long long int ); 622 unsigned long long int ?^=?( unsigned long long int *, unsigned long long int ), ?^=?( volatile unsigned long long int *, unsigned long long int ); 623 624 float ?=?( float *, float ), ?=?( volatile float *, float ), 625 ?*=?( float *, float ), ?*=?( volatile float *, float ), 626 ?/=?( float *, float ), ?/=?( volatile float *, float ), 627 ?+=?( float *, float ), ?+=?( volatile float *, float ), 628 ?-=?( float *, float ), ?-=?( volatile float *, float ); 629 630 double ?=?( double *, double ), ?=?( volatile double *, double ), 631 ?*=?( double *, double ), ?*=?( volatile double *, double ), 632 ?/=?( double *, double ), ?/=?( volatile double *, double ), 633 ?+=?( double *, double ), ?+=?( volatile double *, double ), 634 ?-=?( double *, double ), ?-=?( volatile double *, double ); 635 636 long double ?=?( long double *, long double ), ?=?( volatile long double *, long double ), 637 ?*=?( long double *, long double ), ?*=?( volatile long double *, long double ), 638 ?/=?( long double *, long double ), ?/=?( volatile long double *, long double ), 639 ?+=?( long double *, long double ), ?+=?( volatile long double *, long double ), 640 ?-=?( long double *, long double ), ?-=?( volatile long double *, long double ); 641 642 float _Complex ?=?( float _Complex *, float _Complex ), ?=?( volatile float _Complex *, float _Complex ), 643 ?*=?( float _Complex *, float _Complex ), ?*=?( volatile float _Complex *, float _Complex ), 644 ?/=?( float _Complex *, float _Complex ), ?/=?( volatile float _Complex *, float _Complex ), 645 ?+=?( float _Complex *, float _Complex ), ?+=?( volatile float _Complex *, float _Complex ), 646 ?-=?( float _Complex *, float _Complex ), ?-=?( volatile float _Complex *, float _Complex ); 647 648 double _Complex ?=?( double _Complex *, double _Complex ), ?=?( volatile double _Complex *, double _Complex ), 649 ?*=?( double _Complex *, double _Complex ), ?*=?( volatile double _Complex *, double _Complex ), 650 ?/=?( double _Complex *, double _Complex ), ?/=?( volatile double _Complex *, double _Complex ), 651 ?+=?( double _Complex *, double _Complex ), ?+=?( volatile double _Complex *, double _Complex ), 652 ?-=?( double _Complex *, double _Complex ), ?-=?( volatile double _Complex *, double _Complex ); 653 654 long double _Complex ?=?( long double _Complex *, long double _Complex ), ?=?( volatile long double _Complex *, long double _Complex ), 655 ?*=?( long double _Complex *, long double _Complex ), ?*=?( volatile long double _Complex *, long double _Complex ), 656 ?/=?( long double _Complex *, long double _Complex ), ?/=?( volatile long double _Complex *, long double _Complex ), 657 ?+=?( long double _Complex *, long double _Complex ), ?+=?( volatile long double _Complex *, long double _Complex ), 658 ?-=?( long double _Complex *, long double _Complex ), ?-=?( volatile long double _Complex *, long double _Complex ); 659 659 660 660 … … 669 669 670 670 // default ctor 671 void ?{}( _Bool &);672 void ?{}( char &);673 void ?{}( unsigned char &);674 void ?{}( char signed &);675 void ?{}( int short &);676 void ?{}( int short unsigned &);677 void ?{}( signed int &);678 void ?{}( unsigned int &);679 void ?{}( signed long int &);680 void ?{}( unsigned long int &);681 void ?{}( signed long long int &);682 void ?{}( unsigned long long int &);683 void ?{}( float &);684 void ?{}( double &);685 void ?{}( long double &);686 void ?{}( float _Complex &);687 void ?{}( double _Complex &);688 void ?{}( long double _Complex &);689 void ?{}( zero_t &);690 void ?{}( one_t &);671 void ?{}( _Bool * ); 672 void ?{}( char * ); 673 void ?{}( unsigned char * ); 674 void ?{}( char signed * ); 675 void ?{}( int short * ); 676 void ?{}( int short unsigned * ); 677 void ?{}( signed int * ); 678 void ?{}( unsigned int * ); 679 void ?{}( signed long int * ); 680 void ?{}( unsigned long int * ); 681 void ?{}( signed long long int * ); 682 void ?{}( unsigned long long int * ); 683 void ?{}( float * ); 684 void ?{}( double * ); 685 void ?{}( long double * ); 686 void ?{}( float _Complex * ); 687 void ?{}( double _Complex * ); 688 void ?{}( long double _Complex * ); 689 void ?{}( zero_t * ); 690 void ?{}( one_t * ); 691 691 692 692 // copy ctor 693 void ?{}( _Bool &, _Bool );694 void ?{}( char &, char );695 void ?{}( unsigned char &, unsigned char );696 void ?{}( char signed &, char signed );697 void ?{}( int short &, int short );698 void ?{}( int short unsigned &, int short unsigned );699 void ?{}( signed int &, signed int);700 void ?{}( unsigned int &, unsigned int);701 void ?{}( signed long int &, signed long int);702 void ?{}( unsigned long int &, unsigned long int);703 void ?{}( signed long long int &, signed long long int);704 void ?{}( unsigned long long int &, unsigned long long int);705 void ?{}( float &, float);706 void ?{}( double &, double);707 void ?{}( long double &, long double);708 void ?{}( float _Complex &, float _Complex);709 void ?{}( double _Complex &, double _Complex);710 void ?{}( long double _Complex &, long double _Complex);711 void ?{}( zero_t &, zero_t );712 void ?{}( one_t &, one_t );693 void ?{}( _Bool *, _Bool ); 694 void ?{}( char *, char ); 695 void ?{}( unsigned char *, unsigned char ); 696 void ?{}( char signed *, char signed ); 697 void ?{}( int short *, int short ); 698 void ?{}( int short unsigned *, int short unsigned ); 699 void ?{}( signed int *, signed int); 700 void ?{}( unsigned int *, unsigned int); 701 void ?{}( signed long int *, signed long int); 702 void ?{}( unsigned long int *, unsigned long int); 703 void ?{}( signed long long int *, signed long long int); 704 void ?{}( unsigned long long int *, unsigned long long int); 705 void ?{}( float *, float); 706 void ?{}( double *, double); 707 void ?{}( long double *, long double); 708 void ?{}( float _Complex *, float _Complex); 709 void ?{}( double _Complex *, double _Complex); 710 void ?{}( long double _Complex *, long double _Complex); 711 void ?{}( zero_t *, zero_t ); 712 void ?{}( one_t *, one_t ); 713 713 714 714 // dtor 715 void ^?{}( _Bool &);716 void ^?{}( char &);717 void ^?{}( char unsigned &);718 void ^?{}( char signed &);719 void ^?{}( int short &);720 void ^?{}( int short unsigned &);721 void ^?{}( signed int &);722 void ^?{}( unsigned int &);723 void ^?{}( signed long int &);724 void ^?{}( unsigned long int &);725 void ^?{}( signed long long int &);726 void ^?{}( unsigned long long int &);727 void ^?{}( float &);728 void ^?{}( double &);729 void ^?{}( long double &);730 void ^?{}( float _Complex &);731 void ^?{}( double _Complex &);732 void ^?{}( long double _Complex &);733 void ^?{}( zero_t &);734 void ^?{}( one_t &);715 void ^?{}( _Bool * ); 716 void ^?{}( char * ); 717 void ^?{}( char unsigned * ); 718 void ^?{}( char signed * ); 719 void ^?{}( int short * ); 720 void ^?{}( int short unsigned * ); 721 void ^?{}( signed int * ); 722 void ^?{}( unsigned int * ); 723 void ^?{}( signed long int * ); 724 void ^?{}( unsigned long int * ); 725 void ^?{}( signed long long int * ); 726 void ^?{}( unsigned long long int * ); 727 void ^?{}( float * ); 728 void ^?{}( double * ); 729 void ^?{}( long double * ); 730 void ^?{}( float _Complex * ); 731 void ^?{}( double _Complex * ); 732 void ^?{}( long double _Complex * ); 733 void ^?{}( zero_t * ); 734 void ^?{}( one_t * ); 735 735 736 736 // // default ctor … … 754 754 // copied from assignment section 755 755 // copy constructors 756 forall( ftype FT ) void ?{}( FT * &, FT * );757 forall( ftype FT ) void ?{}( FT * volatile &, FT * );758 759 forall( dtype DT ) void ?{}( DT * &, DT * );760 forall( dtype DT ) void ?{}( const DT * &, DT * );761 forall( dtype DT ) void ?{}( const DT * &, const DT * );762 forall( dtype DT ) void ?{}( volatile DT * &, DT * );763 forall( dtype DT ) void ?{}( volatile DT * &, volatile DT * );764 765 forall( dtype DT ) void ?{}( const volatile DT * &, DT * );766 forall( dtype DT ) void ?{}( const volatile DT * &, const DT * );767 forall( dtype DT ) void ?{}( const volatile DT * &, volatile DT * );768 forall( dtype DT ) void ?{}( const volatile DT * &, const volatile DT * );769 770 forall( dtype DT ) void ?{}( DT * &, void * );771 forall( dtype DT ) void ?{}( const DT * &, void * );772 forall( dtype DT ) void ?{}( const DT * &, const void * );773 forall( dtype DT ) void ?{}( volatile DT * &, void * );774 forall( dtype DT ) void ?{}( volatile DT * &, volatile void * );775 776 forall( dtype DT ) void ?{}( const volatile DT * &, void * );777 forall( dtype DT ) void ?{}( const volatile DT * &, const void * );778 forall( dtype DT ) void ?{}( const volatile DT * &, volatile void * );779 forall( dtype DT ) void ?{}( const volatile DT * &, const volatile void * );780 781 forall( dtype DT ) void ?{}( void * &, DT * );782 forall( dtype DT ) void ?{}( const void * &, DT * );783 forall( dtype DT ) void ?{}( const void * &, const DT * );784 forall( dtype DT ) void ?{}( volatile void * &, DT * );785 forall( dtype DT ) void ?{}( volatile void * &, volatile DT * );786 forall( dtype DT ) void ?{}( const volatile void * &, DT * );787 forall( dtype DT ) void ?{}( const volatile void * &, const DT * );788 forall( dtype DT ) void ?{}( const volatile void * &, volatile DT * );789 forall( dtype DT ) void ?{}( const volatile void * &, const volatile DT * );790 791 void ?{}( void * &, void * );792 void ?{}( const void * &, void * );793 void ?{}( const void * &, const void * );794 void ?{}( volatile void * &, void * );795 void ?{}( volatile void * &, volatile void * );796 void ?{}( const volatile void * &, void * );797 void ?{}( const volatile void * &, const void * );798 void ?{}( const volatile void * &, volatile void * );799 void ?{}( const volatile void * &, const volatile void * );800 801 // forall( dtype DT ) void ?{}( DT * &, zero_t );802 // forall( dtype DT ) void ?{}( DT * volatile &, zero_t );803 forall( dtype DT ) void ?{}( const DT * &, zero_t );804 // forall( dtype DT ) void ?{}( volatile DT * &, zero_t );805 // forall( dtype DT ) void ?{}( volatile DT * volatile &, zero_t );806 forall( dtype DT ) void ?{}( const volatile DT * &, zero_t );807 808 forall( ftype FT ) void ?{}( FT * &, forall( ftype FT2 ) FT2 *);756 forall( ftype FT ) void ?{}( FT **, FT * ); 757 forall( ftype FT ) void ?{}( FT * volatile *, FT * ); 758 759 forall( dtype DT ) void ?{}( DT * *, DT * ); 760 forall( dtype DT ) void ?{}( const DT * *, DT * ); 761 forall( dtype DT ) void ?{}( const DT * *, const DT * ); 762 forall( dtype DT ) void ?{}( volatile DT * *, DT * ); 763 forall( dtype DT ) void ?{}( volatile DT * *, volatile DT * ); 764 765 forall( dtype DT ) void ?{}( const volatile DT * *, DT * ); 766 forall( dtype DT ) void ?{}( const volatile DT * *, const DT * ); 767 forall( dtype DT ) void ?{}( const volatile DT * *, volatile DT * ); 768 forall( dtype DT ) void ?{}( const volatile DT * *, const volatile DT * ); 769 770 forall( dtype DT ) void ?{}( DT * *, void * ); 771 forall( dtype DT ) void ?{}( const DT * *, void * ); 772 forall( dtype DT ) void ?{}( const DT * *, const void * ); 773 forall( dtype DT ) void ?{}( volatile DT * *, void * ); 774 forall( dtype DT ) void ?{}( volatile DT * *, volatile void * ); 775 776 forall( dtype DT ) void ?{}( const volatile DT * *, void * ); 777 forall( dtype DT ) void ?{}( const volatile DT * *, const void * ); 778 forall( dtype DT ) void ?{}( const volatile DT * *, volatile void * ); 779 forall( dtype DT ) void ?{}( const volatile DT * *, const volatile void * ); 780 781 forall( dtype DT ) void ?{}( void * *, DT * ); 782 forall( dtype DT ) void ?{}( const void * *, DT * ); 783 forall( dtype DT ) void ?{}( const void * *, const DT * ); 784 forall( dtype DT ) void ?{}( volatile void * *, DT * ); 785 forall( dtype DT ) void ?{}( volatile void * *, volatile DT * ); 786 forall( dtype DT ) void ?{}( const volatile void * *, DT * ); 787 forall( dtype DT ) void ?{}( const volatile void * *, const DT * ); 788 forall( dtype DT ) void ?{}( const volatile void * *, volatile DT * ); 789 forall( dtype DT ) void ?{}( const volatile void * *, const volatile DT * ); 790 791 void ?{}( void * *, void * ); 792 void ?{}( const void * *, void * ); 793 void ?{}( const void * *, const void * ); 794 void ?{}( volatile void * *, void * ); 795 void ?{}( volatile void * *, volatile void * ); 796 void ?{}( const volatile void * *, void * ); 797 void ?{}( const volatile void * *, const void * ); 798 void ?{}( const volatile void * *, volatile void * ); 799 void ?{}( const volatile void * *, const volatile void * ); 800 801 // //forall( dtype DT ) void ?{}( DT * *, zero_t ); 802 // //forall( dtype DT ) void ?{}( DT * volatile *, zero_t ); 803 // forall( dtype DT ) void ?{}( const DT * *, zero_t ); 804 // //forall( dtype DT ) void ?{}( volatile DT * *, zero_t ); 805 // //forall( dtype DT ) void ?{}( volatile DT * volatile *, zero_t ); 806 // forall( dtype DT ) void ?{}( const volatile DT * *, zero_t ); 807 808 // forall( ftype FT ) void ?{}( FT * *, zero_t ); 809 809 810 810 // default ctors 811 forall( ftype FT ) void ?{}( FT * &);812 813 forall( dtype DT ) void ?{}( DT * &);814 forall( dtype DT ) void ?{}( const DT * &);815 forall( dtype DT ) void ?{}( volatile DT * &);816 forall( dtype DT ) void ?{}( const volatile DT * &);817 818 void ?{}( void * &);819 void ?{}( const void * &);820 void ?{}( volatile void * &);821 void ?{}( const volatile void * &);811 forall( ftype FT ) void ?{}( FT * * ); 812 813 forall( dtype DT ) void ?{}( DT * *); 814 forall( dtype DT ) void ?{}( const DT * *); 815 forall( dtype DT ) void ?{}( volatile DT * *); 816 forall( dtype DT ) void ?{}( const volatile DT * *); 817 818 void ?{}( void * *); 819 void ?{}( const void * *); 820 void ?{}( volatile void * *); 821 void ?{}( const volatile void * *); 822 822 823 823 // dtors 824 forall( ftype FT ) void ^?{}( FT * &);825 826 forall( dtype DT ) void ^?{}( DT * &);827 forall( dtype DT ) void ^?{}( const DT * &);828 forall( dtype DT ) void ^?{}( volatile DT * &);829 forall( dtype DT ) void ^?{}( const volatile DT * &);830 831 void ^?{}( void * &);832 void ^?{}( const void * &);833 void ^?{}( volatile void * &);834 void ^?{}( const volatile void * &);824 forall( ftype FT ) void ^?{}( FT * * ); 825 826 forall( dtype DT ) void ^?{}( DT * *); 827 forall( dtype DT ) void ^?{}( const DT * *); 828 forall( dtype DT ) void ^?{}( volatile DT * *); 829 forall( dtype DT ) void ^?{}( const volatile DT * *); 830 831 void ^?{}( void * *); 832 void ^?{}( const void * *); 833 void ^?{}( volatile void * *); 834 void ^?{}( const volatile void * *); 835 835 836 836 // Local Variables: // -
src/tests/.expect/64/KRfunctions.txt
r8217e8f rbd46af4 17 17 int __i__i_1; 18 18 }; 19 static inline void ___constructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1);20 static inline void ___constructor__F_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);21 static inline void ___destructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1);22 static inline struct S ___operator_assign__F2sS_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);23 static inline void ___constructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1){24 ((void)((* ___dst__R2sS_1).__i__i_1) /* ?{} */);19 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1); 20 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1); 21 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1); 22 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1); 23 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){ 24 ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))) /* ?{} */); 25 25 } 26 static inline void ___constructor__F_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){27 ((void)((* ___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1) /* ?{} */);26 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){ 27 ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))=___src__2sS_1.__i__i_1) /* ?{} */); 28 28 } 29 static inline void ___destructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1){30 ((void)((* ___dst__R2sS_1).__i__i_1) /* ^?{} */);29 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){ 30 ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))) /* ^?{} */); 31 31 } 32 static inline struct S ___operator_assign__F2sS_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){32 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){ 33 33 struct S ___ret__2sS_1; 34 ((void)((*___dst__ R2sS_1).__i__i_1=___src__2sS_1.__i__i_1));35 ((void)___constructor__F_ R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));34 ((void)((*___dst__P2sS_1).__i__i_1=___src__2sS_1.__i__i_1)); 35 ((void)___constructor__F_P2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 36 36 return ((struct S )___ret__2sS_1); 37 37 } 38 static inline void ___constructor__F_ R2sSi_autogen___1(struct S *___dst__R2sS_1, int __i__i_1){39 ((void)((* ___dst__R2sS_1).__i__i_1=__i__i_1) /* ?{} */);38 static inline void ___constructor__F_P2sSi_autogen___1(struct S *___dst__P2sS_1, int __i__i_1){ 39 ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))=__i__i_1) /* ?{} */); 40 40 } 41 41 int __f3__Fi_2sS2sSPi__1(struct S __a__2sS_1, struct S __b__2sS_1, int *__c__Pi_1){ … … 85 85 int __b__i_2; 86 86 int *(*_tmp_cp_ret0)(int __x__i_1, int __y__i_1); 87 ((void)(__x__PFPi_ii__2=(( (void)(_tmp_cp_ret0=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5))) , _tmp_cp_ret0)));88 ((void)( _tmp_cp_ret0) /* ^?{} */);87 ((void)(__x__PFPi_ii__2=((_tmp_cp_ret0=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5)) , _tmp_cp_ret0))); 88 ((void)((*((int *(**)(int __x__i_1, int __y__i_1))(&_tmp_cp_ret0)))) /* ^?{} */); 89 89 const int __f1__FCi_iPiPi__2(int __a__i_2, int *__b__Pi_2, int *__c__Pi_2){ 90 90 __attribute__ ((unused)) const int ___retval_f1__Ci_2; -
src/tests/.expect/64/attributes.txt
r8217e8f rbd46af4 11 11 __attribute__ ((unused)) struct __anonymous0 { 12 12 }; 13 static inline void ___constructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);14 static inline void ___constructor__F_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);15 static inline void ___destructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);16 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);17 static inline void ___constructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){18 } 19 static inline void ___constructor__F_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){20 } 21 static inline void ___destructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){22 } 23 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){13 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1); 14 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1); 15 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1); 16 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1); 17 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){ 18 } 19 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){ 20 } 21 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){ 22 } 23 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){ 24 24 struct __anonymous0 ___ret__13s__anonymous0_1; 25 ((void)___constructor__F_ R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));25 ((void)___constructor__F_P13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 26 26 return ((struct __anonymous0 )___ret__13s__anonymous0_1); 27 27 } … … 29 29 __attribute__ ((unused)) struct Agn2 { 30 30 }; 31 static inline void ___constructor__F_ R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1);32 static inline void ___constructor__F_ R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1);33 static inline void ___destructor__F_ R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1);34 static inline struct Agn2 ___operator_assign__F5sAgn2_ R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1);35 static inline void ___constructor__F_ R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1){36 } 37 static inline void ___constructor__F_ R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){38 } 39 static inline void ___destructor__F_ R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1){40 } 41 static inline struct Agn2 ___operator_assign__F5sAgn2_ R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){31 static inline void ___constructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1); 32 static inline void ___constructor__F_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1); 33 static inline void ___destructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1); 34 static inline struct Agn2 ___operator_assign__F5sAgn2_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1); 35 static inline void ___constructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1){ 36 } 37 static inline void ___constructor__F_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1){ 38 } 39 static inline void ___destructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1){ 40 } 41 static inline struct Agn2 ___operator_assign__F5sAgn2_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1){ 42 42 struct Agn2 ___ret__5sAgn2_1; 43 ((void)___constructor__F_ R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));43 ((void)___constructor__F_P5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1)); 44 44 return ((struct Agn2 )___ret__5sAgn2_1); 45 45 } … … 65 65 __attribute__ ((unused,unused)) int *__f9__Pi_1; 66 66 }; 67 static inline void ___constructor__F_ R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);68 static inline void ___constructor__F_ R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1);69 static inline void ___destructor__F_ R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);70 static inline struct Fdl ___operator_assign__F4sFdl_ R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1);71 static inline void ___constructor__F_ R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){72 ((void)((* ___dst__R4sFdl_1).__f1__i_1) /* ?{} */);73 ((void)((* ___dst__R4sFdl_1).__f2__i_1) /* ?{} */);74 ((void)((* ___dst__R4sFdl_1).__f3__i_1) /* ?{} */);75 ((void)((* ___dst__R4sFdl_1).__f4__i_1) /* ?{} */);76 ((void)((* ___dst__R4sFdl_1).__f5__i_1) /* ?{} */);77 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ?{} */);78 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);79 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);80 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);81 } 82 static inline void ___constructor__F_ R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1){83 ((void)((* ___dst__R4sFdl_1).__f1__i_1=___src__4sFdl_1.__f1__i_1) /* ?{} */);84 ((void)((* ___dst__R4sFdl_1).__f2__i_1=___src__4sFdl_1.__f2__i_1) /* ?{} */);85 ((void)((* ___dst__R4sFdl_1).__f3__i_1=___src__4sFdl_1.__f3__i_1) /* ?{} */);86 ((void)((* ___dst__R4sFdl_1).__f4__i_1=___src__4sFdl_1.__f4__i_1) /* ?{} */);87 ((void)((* ___dst__R4sFdl_1).__f5__i_1=___src__4sFdl_1.__f5__i_1) /* ?{} */);88 ((void)((* ___dst__R4sFdl_1).__f6__i_1=___src__4sFdl_1.__f6__i_1) /* ?{} */);89 ((void)((* ___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */);90 ((void)((* ___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1) /* ?{} */);91 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */);92 } 93 static inline void ___destructor__F_ R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){94 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */);95 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ^?{} */);96 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ^?{} */);97 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ^?{} */);98 ((void)((* ___dst__R4sFdl_1).__f5__i_1) /* ^?{} */);99 ((void)((* ___dst__R4sFdl_1).__f4__i_1) /* ^?{} */);100 ((void)((* ___dst__R4sFdl_1).__f3__i_1) /* ^?{} */);101 ((void)((* ___dst__R4sFdl_1).__f2__i_1) /* ^?{} */);102 ((void)((* ___dst__R4sFdl_1).__f1__i_1) /* ^?{} */);103 } 104 static inline struct Fdl ___operator_assign__F4sFdl_ R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1){67 static inline void ___constructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1); 68 static inline void ___constructor__F_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1); 69 static inline void ___destructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1); 70 static inline struct Fdl ___operator_assign__F4sFdl_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1); 71 static inline void ___constructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1){ 72 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))) /* ?{} */); 73 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))) /* ?{} */); 74 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ?{} */); 75 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */); 76 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */); 77 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */); 78 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 79 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 80 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 81 } 82 static inline void ___constructor__F_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1){ 83 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=___src__4sFdl_1.__f1__i_1) /* ?{} */); 84 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=___src__4sFdl_1.__f2__i_1) /* ?{} */); 85 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=___src__4sFdl_1.__f3__i_1) /* ?{} */); 86 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=___src__4sFdl_1.__f4__i_1) /* ?{} */); 87 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=___src__4sFdl_1.__f5__i_1) /* ?{} */); 88 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=___src__4sFdl_1.__f6__i_1) /* ?{} */); 89 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=___src__4sFdl_1.__f7__i_1) /* ?{} */); 90 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))=___src__4sFdl_1.__f8__i_1) /* ?{} */); 91 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))=___src__4sFdl_1.__f9__Pi_1) /* ?{} */); 92 } 93 static inline void ___destructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1){ 94 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ^?{} */); 95 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ^?{} */); 96 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ^?{} */); 97 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ^?{} */); 98 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ^?{} */); 99 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ^?{} */); 100 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ^?{} */); 101 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))) /* ^?{} */); 102 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))) /* ^?{} */); 103 } 104 static inline struct Fdl ___operator_assign__F4sFdl_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1){ 105 105 struct Fdl ___ret__4sFdl_1; 106 ((void)((*___dst__ R4sFdl_1).__f1__i_1=___src__4sFdl_1.__f1__i_1));107 ((void)((*___dst__ R4sFdl_1).__f2__i_1=___src__4sFdl_1.__f2__i_1));108 ((void)((*___dst__ R4sFdl_1).__f3__i_1=___src__4sFdl_1.__f3__i_1));109 ((void)((*___dst__ R4sFdl_1).__f4__i_1=___src__4sFdl_1.__f4__i_1));110 ((void)((*___dst__ R4sFdl_1).__f5__i_1=___src__4sFdl_1.__f5__i_1));111 ((void)((*___dst__ R4sFdl_1).__f6__i_1=___src__4sFdl_1.__f6__i_1));112 ((void)((*___dst__ R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1));113 ((void)((*___dst__ R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1));114 ((void)((*___dst__ R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1));115 ((void)___constructor__F_ R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));106 ((void)((*___dst__P4sFdl_1).__f1__i_1=___src__4sFdl_1.__f1__i_1)); 107 ((void)((*___dst__P4sFdl_1).__f2__i_1=___src__4sFdl_1.__f2__i_1)); 108 ((void)((*___dst__P4sFdl_1).__f3__i_1=___src__4sFdl_1.__f3__i_1)); 109 ((void)((*___dst__P4sFdl_1).__f4__i_1=___src__4sFdl_1.__f4__i_1)); 110 ((void)((*___dst__P4sFdl_1).__f5__i_1=___src__4sFdl_1.__f5__i_1)); 111 ((void)((*___dst__P4sFdl_1).__f6__i_1=___src__4sFdl_1.__f6__i_1)); 112 ((void)((*___dst__P4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1)); 113 ((void)((*___dst__P4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1)); 114 ((void)((*___dst__P4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1)); 115 ((void)___constructor__F_P4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1)); 116 116 return ((struct Fdl )___ret__4sFdl_1); 117 117 } 118 static inline void ___constructor__F_ R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1){119 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);120 ((void)((* ___dst__R4sFdl_1).__f2__i_1) /* ?{} */);121 ((void)((* ___dst__R4sFdl_1).__f3__i_1) /* ?{} */);122 ((void)((* ___dst__R4sFdl_1).__f4__i_1) /* ?{} */);123 ((void)((* ___dst__R4sFdl_1).__f5__i_1) /* ?{} */);124 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ?{} */);125 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);126 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);127 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);128 } 129 static inline void ___constructor__F_ R4sFdlii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1){130 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);131 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);132 ((void)((* ___dst__R4sFdl_1).__f3__i_1) /* ?{} */);133 ((void)((* ___dst__R4sFdl_1).__f4__i_1) /* ?{} */);134 ((void)((* ___dst__R4sFdl_1).__f5__i_1) /* ?{} */);135 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ?{} */);136 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);137 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);138 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);139 } 140 static inline void ___constructor__F_ R4sFdliii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1){141 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);142 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);143 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);144 ((void)((* ___dst__R4sFdl_1).__f4__i_1) /* ?{} */);145 ((void)((* ___dst__R4sFdl_1).__f5__i_1) /* ?{} */);146 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ?{} */);147 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);148 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);149 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);150 } 151 static inline void ___constructor__F_ R4sFdliiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1){152 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);153 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);154 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);155 ((void)((* ___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);156 ((void)((* ___dst__R4sFdl_1).__f5__i_1) /* ?{} */);157 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ?{} */);158 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);159 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);160 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);161 } 162 static inline void ___constructor__F_ R4sFdliiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1){163 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);164 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);165 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);166 ((void)((* ___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);167 ((void)((* ___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);168 ((void)((* ___dst__R4sFdl_1).__f6__i_1) /* ?{} */);169 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);170 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);171 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);172 } 173 static inline void ___constructor__F_ R4sFdliiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1){174 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);175 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);176 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);177 ((void)((* ___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);178 ((void)((* ___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);179 ((void)((* ___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);180 ((void)((* ___dst__R4sFdl_1).__f7__i_1) /* ?{} */);181 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);182 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);183 } 184 static inline void ___constructor__F_ R4sFdliiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1){185 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);186 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);187 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);188 ((void)((* ___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);189 ((void)((* ___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);190 ((void)((* ___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);191 ((void)((* ___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);192 ((void)((* ___dst__R4sFdl_1).__f8__i_1) /* ?{} */);193 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);194 } 195 static inline void ___constructor__F_ R4sFdliiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1){196 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);197 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);198 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);199 ((void)((* ___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);200 ((void)((* ___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);201 ((void)((* ___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);202 ((void)((* ___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);203 ((void)((* ___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);204 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);205 } 206 static inline void ___constructor__F_ R4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1, int *__f9__Pi_1){207 ((void)((* ___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);208 ((void)((* ___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);209 ((void)((* ___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);210 ((void)((* ___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);211 ((void)((* ___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);212 ((void)((* ___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);213 ((void)((* ___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);214 ((void)((* ___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);215 ((void)((* ___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */);118 static inline void ___constructor__F_P4sFdli_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1){ 119 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 120 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))) /* ?{} */); 121 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ?{} */); 122 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */); 123 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */); 124 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */); 125 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 126 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 127 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 128 } 129 static inline void ___constructor__F_P4sFdlii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1){ 130 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 131 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 132 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ?{} */); 133 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */); 134 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */); 135 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */); 136 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 137 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 138 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 139 } 140 static inline void ___constructor__F_P4sFdliii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1){ 141 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 142 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 143 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 144 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */); 145 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */); 146 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */); 147 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 148 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 149 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 150 } 151 static inline void ___constructor__F_P4sFdliiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1){ 152 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 153 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 154 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 155 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */); 156 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */); 157 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */); 158 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 159 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 160 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 161 } 162 static inline void ___constructor__F_P4sFdliiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1){ 163 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 164 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 165 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 166 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */); 167 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */); 168 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */); 169 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 170 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 171 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 172 } 173 static inline void ___constructor__F_P4sFdliiiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1){ 174 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 175 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 176 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 177 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */); 178 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */); 179 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */); 180 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */); 181 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 182 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 183 } 184 static inline void ___constructor__F_P4sFdliiiiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1){ 185 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 186 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 187 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 188 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */); 189 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */); 190 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */); 191 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=__f7__i_1) /* ?{} */); 192 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */); 193 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 194 } 195 static inline void ___constructor__F_P4sFdliiiiiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1){ 196 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 197 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 198 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 199 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */); 200 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */); 201 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */); 202 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=__f7__i_1) /* ?{} */); 203 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))=__f8__i_1) /* ?{} */); 204 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */); 205 } 206 static inline void ___constructor__F_P4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1, int *__f9__Pi_1){ 207 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */); 208 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */); 209 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */); 210 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */); 211 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */); 212 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */); 213 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=__f7__i_1) /* ?{} */); 214 ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))=__f8__i_1) /* ?{} */); 215 ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))=__f9__Pi_1) /* ?{} */); 216 216 } 217 217 __attribute__ ((unused)) int __f__Fi___1() asm ( "xyz" ); … … 288 288 int __i__i_2; 289 289 }; 290 inline void ___constructor__F_ R13s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2){291 ((void)((* ___dst__R13s__anonymous4_2).__i__i_2) /* ?{} */);292 } 293 inline void ___constructor__F_ R13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){294 ((void)((* ___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2) /* ?{} */);295 } 296 inline void ___destructor__F_ R13s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2){297 ((void)((* ___dst__R13s__anonymous4_2).__i__i_2) /* ^?{} */);298 } 299 inline struct __anonymous4 ___operator_assign__F13s__anonymous4_ R13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){290 inline void ___constructor__F_P13s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2){ 291 ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))) /* ?{} */); 292 } 293 inline void ___constructor__F_P13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){ 294 ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))=___src__13s__anonymous4_2.__i__i_2) /* ?{} */); 295 } 296 inline void ___destructor__F_P13s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2){ 297 ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))) /* ^?{} */); 298 } 299 inline struct __anonymous4 ___operator_assign__F13s__anonymous4_P13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){ 300 300 struct __anonymous4 ___ret__13s__anonymous4_2; 301 ((void)((*___dst__ R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2));302 ((void)___constructor__F_ R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2));301 ((void)((*___dst__P13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2)); 302 ((void)___constructor__F_P13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2)); 303 303 return ((struct __anonymous4 )___ret__13s__anonymous4_2); 304 304 } 305 inline void ___constructor__F_ R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, int __i__i_2){306 ((void)((* ___dst__R13s__anonymous4_2).__i__i_2=__i__i_2) /* ?{} */);305 inline void ___constructor__F_P13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2, int __i__i_2){ 306 ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))=__i__i_2) /* ?{} */); 307 307 } 308 308 ((void)sizeof(struct __anonymous4 )); … … 310 310 __R__C13e__anonymous5_2, 311 311 }; 312 inline void ___constructor__F_ R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){313 } 314 inline void ___constructor__F_ R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){315 ((void)((*___dst__ R13e__anonymous5_2)=___src__13e__anonymous5_2));316 } 317 inline void ___destructor__F_ R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){318 } 319 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_ R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){312 inline void ___constructor__F_P13e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2){ 313 } 314 inline void ___constructor__F_P13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 315 ((void)((*___dst__P13e__anonymous5_2)=___src__13e__anonymous5_2)); 316 } 317 inline void ___destructor__F_P13e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2){ 318 } 319 inline enum __anonymous5 ___operator_assign__F13e__anonymous5_P13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){ 320 320 enum __anonymous5 ___ret__13e__anonymous5_2; 321 ((void)(___ret__13e__anonymous5_2=((*___dst__ R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */);321 ((void)(___ret__13e__anonymous5_2=((*___dst__P13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */); 322 322 return ((enum __anonymous5 )___ret__13e__anonymous5_2); 323 323 } … … 337 337 __attribute__ ((unused,unused)) int (*__anonymous_object31)(); 338 338 }; 339 static inline void ___constructor__F_ R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);340 static inline void ___constructor__F_ R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1);341 static inline void ___destructor__F_ R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);342 static inline struct Vad ___operator_assign__F4sVad_ R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1);343 static inline void ___constructor__F_ R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){344 } 345 static inline void ___constructor__F_ R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){346 } 347 static inline void ___destructor__F_ R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){348 } 349 static inline struct Vad ___operator_assign__F4sVad_ R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){339 static inline void ___constructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1); 340 static inline void ___constructor__F_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1); 341 static inline void ___destructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1); 342 static inline struct Vad ___operator_assign__F4sVad_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1); 343 static inline void ___constructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1){ 344 } 345 static inline void ___constructor__F_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1){ 346 } 347 static inline void ___destructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1){ 348 } 349 static inline struct Vad ___operator_assign__F4sVad_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1){ 350 350 struct Vad ___ret__4sVad_1; 351 ((void)___constructor__F_ R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1));351 ((void)___constructor__F_P4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1)); 352 352 return ((struct Vad )___ret__4sVad_1); 353 353 } -
src/tests/.expect/64/declarationSpecifier.txt
r8217e8f rbd46af4 16 16 int __i__i_1; 17 17 }; 18 static inline void ___constructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);19 static inline void ___constructor__F_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);20 static inline void ___destructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);21 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);22 static inline void ___constructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){23 ((void)((* ___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */);24 } 25 static inline void ___constructor__F_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){26 ((void)((* ___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1) /* ?{} */);27 } 28 static inline void ___destructor__F_ R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){29 ((void)((* ___dst__R13s__anonymous0_1).__i__i_1) /* ^?{} */);30 } 31 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_ R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){18 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1); 19 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1); 20 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1); 21 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1); 22 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){ 23 ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))) /* ?{} */); 24 } 25 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){ 26 ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))=___src__13s__anonymous0_1.__i__i_1) /* ?{} */); 27 } 28 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){ 29 ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))) /* ^?{} */); 30 } 31 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){ 32 32 struct __anonymous0 ___ret__13s__anonymous0_1; 33 ((void)((*___dst__ R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1));34 ((void)___constructor__F_ R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));33 ((void)((*___dst__P13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1)); 34 ((void)___constructor__F_P13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1)); 35 35 return ((struct __anonymous0 )___ret__13s__anonymous0_1); 36 36 } 37 static inline void ___constructor__F_ R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, int __i__i_1){38 ((void)((* ___dst__R13s__anonymous0_1).__i__i_1=__i__i_1) /* ?{} */);37 static inline void ___constructor__F_P13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, int __i__i_1){ 38 ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))=__i__i_1) /* ?{} */); 39 39 } 40 40 volatile const struct __anonymous0 __x10__CV13s__anonymous0_1; … … 42 42 int __i__i_1; 43 43 }; 44 static inline void ___constructor__F_ R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);45 static inline void ___constructor__F_ R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);46 static inline void ___destructor__F_ R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);47 static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_ R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);48 static inline void ___constructor__F_ R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){49 ((void)((* ___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */);50 } 51 static inline void ___constructor__F_ R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){52 ((void)((* ___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1) /* ?{} */);53 } 54 static inline void ___destructor__F_ R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){55 ((void)((* ___dst__R13s__anonymous1_1).__i__i_1) /* ^?{} */);56 } 57 static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_ R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){44 static inline void ___constructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1); 45 static inline void ___constructor__F_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1); 46 static inline void ___destructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1); 47 static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1); 48 static inline void ___constructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1){ 49 ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))) /* ?{} */); 50 } 51 static inline void ___constructor__F_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){ 52 ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))=___src__13s__anonymous1_1.__i__i_1) /* ?{} */); 53 } 54 static inline void ___destructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1){ 55 ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))) /* ^?{} */); 56 } 57 static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){ 58 58 struct __anonymous1 ___ret__13s__anonymous1_1; 59 ((void)((*___dst__ R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1));60 ((void)___constructor__F_ R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1));59 ((void)((*___dst__P13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1)); 60 ((void)___constructor__F_P13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1)); 61 61 return ((struct __anonymous1 )___ret__13s__anonymous1_1); 62 62 } 63 static inline void ___constructor__F_ R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, int __i__i_1){64 ((void)((* ___dst__R13s__anonymous1_1).__i__i_1=__i__i_1) /* ?{} */);63 static inline void ___constructor__F_P13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, int __i__i_1){ 64 ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))=__i__i_1) /* ?{} */); 65 65 } 66 66 volatile const struct __anonymous1 __x11__CV13s__anonymous1_1; … … 68 68 int __i__i_1; 69 69 }; 70 static inline void ___constructor__F_ R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);71 static inline void ___constructor__F_ R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);72 static inline void ___destructor__F_ R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);73 static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_ R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);74 static inline void ___constructor__F_ R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){75 ((void)((* ___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */);76 } 77 static inline void ___constructor__F_ R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){78 ((void)((* ___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1) /* ?{} */);79 } 80 static inline void ___destructor__F_ R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){81 ((void)((* ___dst__R13s__anonymous2_1).__i__i_1) /* ^?{} */);82 } 83 static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_ R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){70 static inline void ___constructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1); 71 static inline void ___constructor__F_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1); 72 static inline void ___destructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1); 73 static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1); 74 static inline void ___constructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1){ 75 ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))) /* ?{} */); 76 } 77 static inline void ___constructor__F_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){ 78 ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))=___src__13s__anonymous2_1.__i__i_1) /* ?{} */); 79 } 80 static inline void ___destructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1){ 81 ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))) /* ^?{} */); 82 } 83 static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){ 84 84 struct __anonymous2 ___ret__13s__anonymous2_1; 85 ((void)((*___dst__ R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1));86 ((void)___constructor__F_ R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1));85 ((void)((*___dst__P13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1)); 86 ((void)___constructor__F_P13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1)); 87 87 return ((struct __anonymous2 )___ret__13s__anonymous2_1); 88 88 } 89 static inline void ___constructor__F_ R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, int __i__i_1){90 ((void)((* ___dst__R13s__anonymous2_1).__i__i_1=__i__i_1) /* ?{} */);89 static inline void ___constructor__F_P13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, int __i__i_1){ 90 ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))=__i__i_1) /* ?{} */); 91 91 } 92 92 volatile const struct __anonymous2 __x12__CV13s__anonymous2_1; … … 94 94 int __i__i_1; 95 95 }; 96 static inline void ___constructor__F_ R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);97 static inline void ___constructor__F_ R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);98 static inline void ___destructor__F_ R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);99 static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_ R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);100 static inline void ___constructor__F_ R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){101 ((void)((* ___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */);102 } 103 static inline void ___constructor__F_ R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){104 ((void)((* ___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1) /* ?{} */);105 } 106 static inline void ___destructor__F_ R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){107 ((void)((* ___dst__R13s__anonymous3_1).__i__i_1) /* ^?{} */);108 } 109 static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_ R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){96 static inline void ___constructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1); 97 static inline void ___constructor__F_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1); 98 static inline void ___destructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1); 99 static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1); 100 static inline void ___constructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1){ 101 ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))) /* ?{} */); 102 } 103 static inline void ___constructor__F_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){ 104 ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))=___src__13s__anonymous3_1.__i__i_1) /* ?{} */); 105 } 106 static inline void ___destructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1){ 107 ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))) /* ^?{} */); 108 } 109 static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){ 110 110 struct __anonymous3 ___ret__13s__anonymous3_1; 111 ((void)((*___dst__ R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1));112 ((void)___constructor__F_ R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1));111 ((void)((*___dst__P13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1)); 112 ((void)___constructor__F_P13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1)); 113 113 return ((struct __anonymous3 )___ret__13s__anonymous3_1); 114 114 } 115 static inline void ___constructor__F_ R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, int __i__i_1){116 ((void)((* ___dst__R13s__anonymous3_1).__i__i_1=__i__i_1) /* ?{} */);115 static inline void ___constructor__F_P13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, int __i__i_1){ 116 ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))=__i__i_1) /* ?{} */); 117 117 } 118 118 static volatile const struct __anonymous3 __x13__CV13s__anonymous3_1; … … 120 120 int __i__i_1; 121 121 }; 122 static inline void ___constructor__F_ R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);123 static inline void ___constructor__F_ R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);124 static inline void ___destructor__F_ R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);125 static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_ R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);126 static inline void ___constructor__F_ R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){127 ((void)((* ___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */);128 } 129 static inline void ___constructor__F_ R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){130 ((void)((* ___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1) /* ?{} */);131 } 132 static inline void ___destructor__F_ R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){133 ((void)((* ___dst__R13s__anonymous4_1).__i__i_1) /* ^?{} */);134 } 135 static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_ R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){122 static inline void ___constructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1); 123 static inline void ___constructor__F_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1); 124 static inline void ___destructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1); 125 static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1); 126 static inline void ___constructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1){ 127 ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))) /* ?{} */); 128 } 129 static inline void ___constructor__F_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){ 130 ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))=___src__13s__anonymous4_1.__i__i_1) /* ?{} */); 131 } 132 static inline void ___destructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1){ 133 ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))) /* ^?{} */); 134 } 135 static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){ 136 136 struct __anonymous4 ___ret__13s__anonymous4_1; 137 ((void)((*___dst__ R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1));138 ((void)___constructor__F_ R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1));137 ((void)((*___dst__P13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1)); 138 ((void)___constructor__F_P13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1)); 139 139 return ((struct __anonymous4 )___ret__13s__anonymous4_1); 140 140 } 141 static inline void ___constructor__F_ R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, int __i__i_1){142 ((void)((* ___dst__R13s__anonymous4_1).__i__i_1=__i__i_1) /* ?{} */);141 static inline void ___constructor__F_P13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, int __i__i_1){ 142 ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))=__i__i_1) /* ?{} */); 143 143 } 144 144 static volatile const struct __anonymous4 __x14__CV13s__anonymous4_1; … … 146 146 int __i__i_1; 147 147 }; 148 static inline void ___constructor__F_ R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);149 static inline void ___constructor__F_ R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);150 static inline void ___destructor__F_ R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);151 static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_ R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);152 static inline void ___constructor__F_ R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){153 ((void)((* ___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */);154 } 155 static inline void ___constructor__F_ R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){156 ((void)((* ___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1) /* ?{} */);157 } 158 static inline void ___destructor__F_ R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){159 ((void)((* ___dst__R13s__anonymous5_1).__i__i_1) /* ^?{} */);160 } 161 static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_ R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){148 static inline void ___constructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1); 149 static inline void ___constructor__F_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1); 150 static inline void ___destructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1); 151 static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1); 152 static inline void ___constructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1){ 153 ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))) /* ?{} */); 154 } 155 static inline void ___constructor__F_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){ 156 ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))=___src__13s__anonymous5_1.__i__i_1) /* ?{} */); 157 } 158 static inline void ___destructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1){ 159 ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))) /* ^?{} */); 160 } 161 static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){ 162 162 struct __anonymous5 ___ret__13s__anonymous5_1; 163 ((void)((*___dst__ R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1));164 ((void)___constructor__F_ R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1));163 ((void)((*___dst__P13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1)); 164 ((void)___constructor__F_P13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1)); 165 165 return ((struct __anonymous5 )___ret__13s__anonymous5_1); 166 166 } 167 static inline void ___constructor__F_ R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, int __i__i_1){168 ((void)((* ___dst__R13s__anonymous5_1).__i__i_1=__i__i_1) /* ?{} */);167 static inline void ___constructor__F_P13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, int __i__i_1){ 168 ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))=__i__i_1) /* ?{} */); 169 169 } 170 170 static volatile const struct __anonymous5 __x15__CV13s__anonymous5_1; … … 172 172 int __i__i_1; 173 173 }; 174 static inline void ___constructor__F_ R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);175 static inline void ___constructor__F_ R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);176 static inline void ___destructor__F_ R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);177 static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_ R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);178 static inline void ___constructor__F_ R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){179 ((void)((* ___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */);180 } 181 static inline void ___constructor__F_ R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){182 ((void)((* ___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1) /* ?{} */);183 } 184 static inline void ___destructor__F_ R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){185 ((void)((* ___dst__R13s__anonymous6_1).__i__i_1) /* ^?{} */);186 } 187 static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_ R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){174 static inline void ___constructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1); 175 static inline void ___constructor__F_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1); 176 static inline void ___destructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1); 177 static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1); 178 static inline void ___constructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1){ 179 ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))) /* ?{} */); 180 } 181 static inline void ___constructor__F_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){ 182 ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))=___src__13s__anonymous6_1.__i__i_1) /* ?{} */); 183 } 184 static inline void ___destructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1){ 185 ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))) /* ^?{} */); 186 } 187 static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){ 188 188 struct __anonymous6 ___ret__13s__anonymous6_1; 189 ((void)((*___dst__ R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1));190 ((void)___constructor__F_ R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1));189 ((void)((*___dst__P13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1)); 190 ((void)___constructor__F_P13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1)); 191 191 return ((struct __anonymous6 )___ret__13s__anonymous6_1); 192 192 } 193 static inline void ___constructor__F_ R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, int __i__i_1){194 ((void)((* ___dst__R13s__anonymous6_1).__i__i_1=__i__i_1) /* ?{} */);193 static inline void ___constructor__F_P13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, int __i__i_1){ 194 ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))=__i__i_1) /* ?{} */); 195 195 } 196 196 static volatile const struct __anonymous6 __x16__CV13s__anonymous6_1; … … 198 198 int __i__i_1; 199 199 }; 200 static inline void ___constructor__F_ R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);201 static inline void ___constructor__F_ R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);202 static inline void ___destructor__F_ R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);203 static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_ R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);204 static inline void ___constructor__F_ R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){205 ((void)((* ___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */);206 } 207 static inline void ___constructor__F_ R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){208 ((void)((* ___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1) /* ?{} */);209 } 210 static inline void ___destructor__F_ R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){211 ((void)((* ___dst__R13s__anonymous7_1).__i__i_1) /* ^?{} */);212 } 213 static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_ R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){200 static inline void ___constructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1); 201 static inline void ___constructor__F_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1); 202 static inline void ___destructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1); 203 static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1); 204 static inline void ___constructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1){ 205 ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))) /* ?{} */); 206 } 207 static inline void ___constructor__F_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){ 208 ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))=___src__13s__anonymous7_1.__i__i_1) /* ?{} */); 209 } 210 static inline void ___destructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1){ 211 ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))) /* ^?{} */); 212 } 213 static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){ 214 214 struct __anonymous7 ___ret__13s__anonymous7_1; 215 ((void)((*___dst__ R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1));216 ((void)___constructor__F_ R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1));215 ((void)((*___dst__P13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1)); 216 ((void)___constructor__F_P13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1)); 217 217 return ((struct __anonymous7 )___ret__13s__anonymous7_1); 218 218 } 219 static inline void ___constructor__F_ R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, int __i__i_1){220 ((void)((* ___dst__R13s__anonymous7_1).__i__i_1=__i__i_1) /* ?{} */);219 static inline void ___constructor__F_P13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, int __i__i_1){ 220 ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))=__i__i_1) /* ?{} */); 221 221 } 222 222 static volatile const struct __anonymous7 __x17__CV13s__anonymous7_1; … … 232 232 short __i__s_1; 233 233 }; 234 static inline void ___constructor__F_ R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);235 static inline void ___constructor__F_ R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);236 static inline void ___destructor__F_ R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);237 static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_ R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);238 static inline void ___constructor__F_ R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){239 ((void)((* ___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */);240 } 241 static inline void ___constructor__F_ R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){242 ((void)((* ___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1) /* ?{} */);243 } 244 static inline void ___destructor__F_ R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){245 ((void)((* ___dst__R13s__anonymous8_1).__i__s_1) /* ^?{} */);246 } 247 static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_ R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){234 static inline void ___constructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1); 235 static inline void ___constructor__F_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1); 236 static inline void ___destructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1); 237 static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1); 238 static inline void ___constructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1){ 239 ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))) /* ?{} */); 240 } 241 static inline void ___constructor__F_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){ 242 ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))=___src__13s__anonymous8_1.__i__s_1) /* ?{} */); 243 } 244 static inline void ___destructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1){ 245 ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))) /* ^?{} */); 246 } 247 static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){ 248 248 struct __anonymous8 ___ret__13s__anonymous8_1; 249 ((void)((*___dst__ R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1));250 ((void)___constructor__F_ R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1));249 ((void)((*___dst__P13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1)); 250 ((void)___constructor__F_P13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1)); 251 251 return ((struct __anonymous8 )___ret__13s__anonymous8_1); 252 252 } 253 static inline void ___constructor__F_ R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, short __i__s_1){254 ((void)((* ___dst__R13s__anonymous8_1).__i__s_1=__i__s_1) /* ?{} */);253 static inline void ___constructor__F_P13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, short __i__s_1){ 254 ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))=__i__s_1) /* ?{} */); 255 255 } 256 256 volatile const struct __anonymous8 __x29__CV13s__anonymous8_1; … … 258 258 short __i__s_1; 259 259 }; 260 static inline void ___constructor__F_ R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);261 static inline void ___constructor__F_ R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);262 static inline void ___destructor__F_ R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);263 static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_ R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);264 static inline void ___constructor__F_ R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){265 ((void)((* ___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */);266 } 267 static inline void ___constructor__F_ R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){268 ((void)((* ___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1) /* ?{} */);269 } 270 static inline void ___destructor__F_ R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){271 ((void)((* ___dst__R13s__anonymous9_1).__i__s_1) /* ^?{} */);272 } 273 static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_ R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){260 static inline void ___constructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1); 261 static inline void ___constructor__F_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1); 262 static inline void ___destructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1); 263 static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1); 264 static inline void ___constructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1){ 265 ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))) /* ?{} */); 266 } 267 static inline void ___constructor__F_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){ 268 ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))=___src__13s__anonymous9_1.__i__s_1) /* ?{} */); 269 } 270 static inline void ___destructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1){ 271 ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))) /* ^?{} */); 272 } 273 static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){ 274 274 struct __anonymous9 ___ret__13s__anonymous9_1; 275 ((void)((*___dst__ R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1));276 ((void)___constructor__F_ R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1));275 ((void)((*___dst__P13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1)); 276 ((void)___constructor__F_P13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1)); 277 277 return ((struct __anonymous9 )___ret__13s__anonymous9_1); 278 278 } 279 static inline void ___constructor__F_ R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, short __i__s_1){280 ((void)((* ___dst__R13s__anonymous9_1).__i__s_1=__i__s_1) /* ?{} */);279 static inline void ___constructor__F_P13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, short __i__s_1){ 280 ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))=__i__s_1) /* ?{} */); 281 281 } 282 282 volatile const struct __anonymous9 __x30__CV13s__anonymous9_1; … … 284 284 short __i__s_1; 285 285 }; 286 static inline void ___constructor__F_ R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);287 static inline void ___constructor__F_ R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);288 static inline void ___destructor__F_ R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);289 static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_ R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);290 static inline void ___constructor__F_ R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){291 ((void)((* ___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */);292 } 293 static inline void ___constructor__F_ R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){294 ((void)((* ___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1) /* ?{} */);295 } 296 static inline void ___destructor__F_ R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){297 ((void)((* ___dst__R14s__anonymous10_1).__i__s_1) /* ^?{} */);298 } 299 static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_ R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){286 static inline void ___constructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1); 287 static inline void ___constructor__F_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1); 288 static inline void ___destructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1); 289 static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1); 290 static inline void ___constructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1){ 291 ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))) /* ?{} */); 292 } 293 static inline void ___constructor__F_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){ 294 ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))=___src__14s__anonymous10_1.__i__s_1) /* ?{} */); 295 } 296 static inline void ___destructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1){ 297 ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))) /* ^?{} */); 298 } 299 static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){ 300 300 struct __anonymous10 ___ret__14s__anonymous10_1; 301 ((void)((*___dst__ R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1));302 ((void)___constructor__F_ R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1));301 ((void)((*___dst__P14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1)); 302 ((void)___constructor__F_P14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1)); 303 303 return ((struct __anonymous10 )___ret__14s__anonymous10_1); 304 304 } 305 static inline void ___constructor__F_ R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, short __i__s_1){306 ((void)((* ___dst__R14s__anonymous10_1).__i__s_1=__i__s_1) /* ?{} */);305 static inline void ___constructor__F_P14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, short __i__s_1){ 306 ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))=__i__s_1) /* ?{} */); 307 307 } 308 308 volatile const struct __anonymous10 __x31__CV14s__anonymous10_1; … … 310 310 short __i__s_1; 311 311 }; 312 static inline void ___constructor__F_ R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);313 static inline void ___constructor__F_ R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);314 static inline void ___destructor__F_ R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);315 static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_ R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);316 static inline void ___constructor__F_ R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){317 ((void)((* ___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */);318 } 319 static inline void ___constructor__F_ R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){320 ((void)((* ___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1) /* ?{} */);321 } 322 static inline void ___destructor__F_ R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){323 ((void)((* ___dst__R14s__anonymous11_1).__i__s_1) /* ^?{} */);324 } 325 static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_ R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){312 static inline void ___constructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1); 313 static inline void ___constructor__F_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1); 314 static inline void ___destructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1); 315 static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1); 316 static inline void ___constructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1){ 317 ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))) /* ?{} */); 318 } 319 static inline void ___constructor__F_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){ 320 ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))=___src__14s__anonymous11_1.__i__s_1) /* ?{} */); 321 } 322 static inline void ___destructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1){ 323 ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))) /* ^?{} */); 324 } 325 static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){ 326 326 struct __anonymous11 ___ret__14s__anonymous11_1; 327 ((void)((*___dst__ R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1));328 ((void)___constructor__F_ R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1));327 ((void)((*___dst__P14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1)); 328 ((void)___constructor__F_P14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1)); 329 329 return ((struct __anonymous11 )___ret__14s__anonymous11_1); 330 330 } 331 static inline void ___constructor__F_ R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, short __i__s_1){332 ((void)((* ___dst__R14s__anonymous11_1).__i__s_1=__i__s_1) /* ?{} */);331 static inline void ___constructor__F_P14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, short __i__s_1){ 332 ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))=__i__s_1) /* ?{} */); 333 333 } 334 334 static volatile const struct __anonymous11 __x32__CV14s__anonymous11_1; … … 336 336 short __i__s_1; 337 337 }; 338 static inline void ___constructor__F_ R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);339 static inline void ___constructor__F_ R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);340 static inline void ___destructor__F_ R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);341 static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_ R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);342 static inline void ___constructor__F_ R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){343 ((void)((* ___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */);344 } 345 static inline void ___constructor__F_ R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){346 ((void)((* ___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1) /* ?{} */);347 } 348 static inline void ___destructor__F_ R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){349 ((void)((* ___dst__R14s__anonymous12_1).__i__s_1) /* ^?{} */);350 } 351 static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_ R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){338 static inline void ___constructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1); 339 static inline void ___constructor__F_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1); 340 static inline void ___destructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1); 341 static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1); 342 static inline void ___constructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1){ 343 ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))) /* ?{} */); 344 } 345 static inline void ___constructor__F_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){ 346 ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))=___src__14s__anonymous12_1.__i__s_1) /* ?{} */); 347 } 348 static inline void ___destructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1){ 349 ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))) /* ^?{} */); 350 } 351 static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){ 352 352 struct __anonymous12 ___ret__14s__anonymous12_1; 353 ((void)((*___dst__ R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1));354 ((void)___constructor__F_ R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1));353 ((void)((*___dst__P14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1)); 354 ((void)___constructor__F_P14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1)); 355 355 return ((struct __anonymous12 )___ret__14s__anonymous12_1); 356 356 } 357 static inline void ___constructor__F_ R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, short __i__s_1){358 ((void)((* ___dst__R14s__anonymous12_1).__i__s_1=__i__s_1) /* ?{} */);357 static inline void ___constructor__F_P14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, short __i__s_1){ 358 ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))=__i__s_1) /* ?{} */); 359 359 } 360 360 static volatile const struct __anonymous12 __x33__CV14s__anonymous12_1; … … 362 362 short __i__s_1; 363 363 }; 364 static inline void ___constructor__F_ R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);365 static inline void ___constructor__F_ R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);366 static inline void ___destructor__F_ R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);367 static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_ R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);368 static inline void ___constructor__F_ R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){369 ((void)((* ___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */);370 } 371 static inline void ___constructor__F_ R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){372 ((void)((* ___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1) /* ?{} */);373 } 374 static inline void ___destructor__F_ R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){375 ((void)((* ___dst__R14s__anonymous13_1).__i__s_1) /* ^?{} */);376 } 377 static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_ R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){364 static inline void ___constructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1); 365 static inline void ___constructor__F_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1); 366 static inline void ___destructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1); 367 static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1); 368 static inline void ___constructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1){ 369 ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))) /* ?{} */); 370 } 371 static inline void ___constructor__F_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){ 372 ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))=___src__14s__anonymous13_1.__i__s_1) /* ?{} */); 373 } 374 static inline void ___destructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1){ 375 ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))) /* ^?{} */); 376 } 377 static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){ 378 378 struct __anonymous13 ___ret__14s__anonymous13_1; 379 ((void)((*___dst__ R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1));380 ((void)___constructor__F_ R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1));379 ((void)((*___dst__P14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1)); 380 ((void)___constructor__F_P14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1)); 381 381 return ((struct __anonymous13 )___ret__14s__anonymous13_1); 382 382 } 383 static inline void ___constructor__F_ R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, short __i__s_1){384 ((void)((* ___dst__R14s__anonymous13_1).__i__s_1=__i__s_1) /* ?{} */);383 static inline void ___constructor__F_P14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, short __i__s_1){ 384 ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))=__i__s_1) /* ?{} */); 385 385 } 386 386 static volatile const struct __anonymous13 __x34__CV14s__anonymous13_1; … … 388 388 short __i__s_1; 389 389 }; 390 static inline void ___constructor__F_ R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);391 static inline void ___constructor__F_ R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);392 static inline void ___destructor__F_ R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);393 static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_ R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);394 static inline void ___constructor__F_ R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){395 ((void)((* ___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */);396 } 397 static inline void ___constructor__F_ R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){398 ((void)((* ___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1) /* ?{} */);399 } 400 static inline void ___destructor__F_ R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){401 ((void)((* ___dst__R14s__anonymous14_1).__i__s_1) /* ^?{} */);402 } 403 static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_ R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){390 static inline void ___constructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1); 391 static inline void ___constructor__F_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1); 392 static inline void ___destructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1); 393 static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1); 394 static inline void ___constructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1){ 395 ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))) /* ?{} */); 396 } 397 static inline void ___constructor__F_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){ 398 ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))=___src__14s__anonymous14_1.__i__s_1) /* ?{} */); 399 } 400 static inline void ___destructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1){ 401 ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))) /* ^?{} */); 402 } 403 static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){ 404 404 struct __anonymous14 ___ret__14s__anonymous14_1; 405 ((void)((*___dst__ R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1));406 ((void)___constructor__F_ R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1));405 ((void)((*___dst__P14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1)); 406 ((void)___constructor__F_P14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1)); 407 407 return ((struct __anonymous14 )___ret__14s__anonymous14_1); 408 408 } 409 static inline void ___constructor__F_ R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, short __i__s_1){410 ((void)((* ___dst__R14s__anonymous14_1).__i__s_1=__i__s_1) /* ?{} */);409 static inline void ___constructor__F_P14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, short __i__s_1){ 410 ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))=__i__s_1) /* ?{} */); 411 411 } 412 412 static volatile const struct __anonymous14 __x35__CV14s__anonymous14_1; … … 414 414 short __i__s_1; 415 415 }; 416 static inline void ___constructor__F_ R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);417 static inline void ___constructor__F_ R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);418 static inline void ___destructor__F_ R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);419 static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_ R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);420 static inline void ___constructor__F_ R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){421 ((void)((* ___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */);422 } 423 static inline void ___constructor__F_ R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){424 ((void)((* ___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1) /* ?{} */);425 } 426 static inline void ___destructor__F_ R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){427 ((void)((* ___dst__R14s__anonymous15_1).__i__s_1) /* ^?{} */);428 } 429 static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_ R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){416 static inline void ___constructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1); 417 static inline void ___constructor__F_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1); 418 static inline void ___destructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1); 419 static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1); 420 static inline void ___constructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1){ 421 ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))) /* ?{} */); 422 } 423 static inline void ___constructor__F_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){ 424 ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))=___src__14s__anonymous15_1.__i__s_1) /* ?{} */); 425 } 426 static inline void ___destructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1){ 427 ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))) /* ^?{} */); 428 } 429 static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){ 430 430 struct __anonymous15 ___ret__14s__anonymous15_1; 431 ((void)((*___dst__ R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1));432 ((void)___constructor__F_ R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1));431 ((void)((*___dst__P14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1)); 432 ((void)___constructor__F_P14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1)); 433 433 return ((struct __anonymous15 )___ret__14s__anonymous15_1); 434 434 } 435 static inline void ___constructor__F_ R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, short __i__s_1){436 ((void)((* ___dst__R14s__anonymous15_1).__i__s_1=__i__s_1) /* ?{} */);435 static inline void ___constructor__F_P14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, short __i__s_1){ 436 ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))=__i__s_1) /* ?{} */); 437 437 } 438 438 static volatile const struct __anonymous15 __x36__CV14s__anonymous15_1; … … 456 456 int __i__i_1; 457 457 }; 458 static inline void ___constructor__F_ R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);459 static inline void ___constructor__F_ R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);460 static inline void ___destructor__F_ R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);461 static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_ R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);462 static inline void ___constructor__F_ R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){463 ((void)((* ___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */);464 } 465 static inline void ___constructor__F_ R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){466 ((void)((* ___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1) /* ?{} */);467 } 468 static inline void ___destructor__F_ R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){469 ((void)((* ___dst__R14s__anonymous16_1).__i__i_1) /* ^?{} */);470 } 471 static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_ R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){458 static inline void ___constructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1); 459 static inline void ___constructor__F_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1); 460 static inline void ___destructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1); 461 static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1); 462 static inline void ___constructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1){ 463 ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))) /* ?{} */); 464 } 465 static inline void ___constructor__F_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){ 466 ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))=___src__14s__anonymous16_1.__i__i_1) /* ?{} */); 467 } 468 static inline void ___destructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1){ 469 ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))) /* ^?{} */); 470 } 471 static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){ 472 472 struct __anonymous16 ___ret__14s__anonymous16_1; 473 ((void)((*___dst__ R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1));474 ((void)___constructor__F_ R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1));473 ((void)((*___dst__P14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1)); 474 ((void)___constructor__F_P14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1)); 475 475 return ((struct __anonymous16 )___ret__14s__anonymous16_1); 476 476 } 477 static inline void ___constructor__F_ R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, int __i__i_1){478 ((void)((* ___dst__R14s__anonymous16_1).__i__i_1=__i__i_1) /* ?{} */);477 static inline void ___constructor__F_P14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, int __i__i_1){ 478 ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))=__i__i_1) /* ?{} */); 479 479 } 480 480 static inline volatile const struct __anonymous16 __f31__FCV14s__anonymous16___1(); … … 482 482 int __i__i_1; 483 483 }; 484 static inline void ___constructor__F_ R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);485 static inline void ___constructor__F_ R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);486 static inline void ___destructor__F_ R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);487 static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_ R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);488 static inline void ___constructor__F_ R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){489 ((void)((* ___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */);490 } 491 static inline void ___constructor__F_ R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){492 ((void)((* ___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1) /* ?{} */);493 } 494 static inline void ___destructor__F_ R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){495 ((void)((* ___dst__R14s__anonymous17_1).__i__i_1) /* ^?{} */);496 } 497 static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_ R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){484 static inline void ___constructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1); 485 static inline void ___constructor__F_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1); 486 static inline void ___destructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1); 487 static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1); 488 static inline void ___constructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1){ 489 ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))) /* ?{} */); 490 } 491 static inline void ___constructor__F_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){ 492 ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))=___src__14s__anonymous17_1.__i__i_1) /* ?{} */); 493 } 494 static inline void ___destructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1){ 495 ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))) /* ^?{} */); 496 } 497 static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){ 498 498 struct __anonymous17 ___ret__14s__anonymous17_1; 499 ((void)((*___dst__ R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1));500 ((void)___constructor__F_ R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1));499 ((void)((*___dst__P14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1)); 500 ((void)___constructor__F_P14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1)); 501 501 return ((struct __anonymous17 )___ret__14s__anonymous17_1); 502 502 } 503 static inline void ___constructor__F_ R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, int __i__i_1){504 ((void)((* ___dst__R14s__anonymous17_1).__i__i_1=__i__i_1) /* ?{} */);503 static inline void ___constructor__F_P14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, int __i__i_1){ 504 ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))=__i__i_1) /* ?{} */); 505 505 } 506 506 static inline volatile const struct __anonymous17 __f32__FCV14s__anonymous17___1(); … … 508 508 int __i__i_1; 509 509 }; 510 static inline void ___constructor__F_ R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);511 static inline void ___constructor__F_ R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);512 static inline void ___destructor__F_ R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);513 static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_ R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);514 static inline void ___constructor__F_ R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){515 ((void)((* ___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */);516 } 517 static inline void ___constructor__F_ R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){518 ((void)((* ___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1) /* ?{} */);519 } 520 static inline void ___destructor__F_ R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){521 ((void)((* ___dst__R14s__anonymous18_1).__i__i_1) /* ^?{} */);522 } 523 static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_ R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){510 static inline void ___constructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1); 511 static inline void ___constructor__F_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1); 512 static inline void ___destructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1); 513 static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1); 514 static inline void ___constructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1){ 515 ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))) /* ?{} */); 516 } 517 static inline void ___constructor__F_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){ 518 ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))=___src__14s__anonymous18_1.__i__i_1) /* ?{} */); 519 } 520 static inline void ___destructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1){ 521 ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))) /* ^?{} */); 522 } 523 static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){ 524 524 struct __anonymous18 ___ret__14s__anonymous18_1; 525 ((void)((*___dst__ R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1));526 ((void)___constructor__F_ R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1));525 ((void)((*___dst__P14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1)); 526 ((void)___constructor__F_P14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1)); 527 527 return ((struct __anonymous18 )___ret__14s__anonymous18_1); 528 528 } 529 static inline void ___constructor__F_ R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, int __i__i_1){530 ((void)((* ___dst__R14s__anonymous18_1).__i__i_1=__i__i_1) /* ?{} */);529 static inline void ___constructor__F_P14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, int __i__i_1){ 530 ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))=__i__i_1) /* ?{} */); 531 531 } 532 532 static inline volatile const struct __anonymous18 __f33__FCV14s__anonymous18___1(); … … 534 534 int __i__i_1; 535 535 }; 536 static inline void ___constructor__F_ R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);537 static inline void ___constructor__F_ R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);538 static inline void ___destructor__F_ R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);539 static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_ R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);540 static inline void ___constructor__F_ R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){541 ((void)((* ___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */);542 } 543 static inline void ___constructor__F_ R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){544 ((void)((* ___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1) /* ?{} */);545 } 546 static inline void ___destructor__F_ R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){547 ((void)((* ___dst__R14s__anonymous19_1).__i__i_1) /* ^?{} */);548 } 549 static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_ R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){536 static inline void ___constructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1); 537 static inline void ___constructor__F_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1); 538 static inline void ___destructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1); 539 static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1); 540 static inline void ___constructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1){ 541 ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))) /* ?{} */); 542 } 543 static inline void ___constructor__F_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){ 544 ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))=___src__14s__anonymous19_1.__i__i_1) /* ?{} */); 545 } 546 static inline void ___destructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1){ 547 ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))) /* ^?{} */); 548 } 549 static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){ 550 550 struct __anonymous19 ___ret__14s__anonymous19_1; 551 ((void)((*___dst__ R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1));552 ((void)___constructor__F_ R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1));551 ((void)((*___dst__P14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1)); 552 ((void)___constructor__F_P14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1)); 553 553 return ((struct __anonymous19 )___ret__14s__anonymous19_1); 554 554 } 555 static inline void ___constructor__F_ R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, int __i__i_1){556 ((void)((* ___dst__R14s__anonymous19_1).__i__i_1=__i__i_1) /* ?{} */);555 static inline void ___constructor__F_P14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, int __i__i_1){ 556 ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))=__i__i_1) /* ?{} */); 557 557 } 558 558 static inline volatile const struct __anonymous19 __f34__FCV14s__anonymous19___1(); … … 560 560 int __i__i_1; 561 561 }; 562 static inline void ___constructor__F_ R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);563 static inline void ___constructor__F_ R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);564 static inline void ___destructor__F_ R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);565 static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_ R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);566 static inline void ___constructor__F_ R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){567 ((void)((* ___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */);568 } 569 static inline void ___constructor__F_ R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){570 ((void)((* ___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1) /* ?{} */);571 } 572 static inline void ___destructor__F_ R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){573 ((void)((* ___dst__R14s__anonymous20_1).__i__i_1) /* ^?{} */);574 } 575 static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_ R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){562 static inline void ___constructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1); 563 static inline void ___constructor__F_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1); 564 static inline void ___destructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1); 565 static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1); 566 static inline void ___constructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1){ 567 ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))) /* ?{} */); 568 } 569 static inline void ___constructor__F_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){ 570 ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))=___src__14s__anonymous20_1.__i__i_1) /* ?{} */); 571 } 572 static inline void ___destructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1){ 573 ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))) /* ^?{} */); 574 } 575 static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){ 576 576 struct __anonymous20 ___ret__14s__anonymous20_1; 577 ((void)((*___dst__ R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1));578 ((void)___constructor__F_ R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1));577 ((void)((*___dst__P14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1)); 578 ((void)___constructor__F_P14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1)); 579 579 return ((struct __anonymous20 )___ret__14s__anonymous20_1); 580 580 } 581 static inline void ___constructor__F_ R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, int __i__i_1){582 ((void)((* ___dst__R14s__anonymous20_1).__i__i_1=__i__i_1) /* ?{} */);581 static inline void ___constructor__F_P14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, int __i__i_1){ 582 ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))=__i__i_1) /* ?{} */); 583 583 } 584 584 static inline volatile const struct __anonymous20 __f35__FCV14s__anonymous20___1(); … … 586 586 int __i__i_1; 587 587 }; 588 static inline void ___constructor__F_ R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);589 static inline void ___constructor__F_ R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);590 static inline void ___destructor__F_ R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);591 static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_ R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);592 static inline void ___constructor__F_ R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){593 ((void)((* ___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */);594 } 595 static inline void ___constructor__F_ R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){596 ((void)((* ___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1) /* ?{} */);597 } 598 static inline void ___destructor__F_ R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){599 ((void)((* ___dst__R14s__anonymous21_1).__i__i_1) /* ^?{} */);600 } 601 static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_ R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){588 static inline void ___constructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1); 589 static inline void ___constructor__F_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1); 590 static inline void ___destructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1); 591 static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1); 592 static inline void ___constructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1){ 593 ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))) /* ?{} */); 594 } 595 static inline void ___constructor__F_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){ 596 ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))=___src__14s__anonymous21_1.__i__i_1) /* ?{} */); 597 } 598 static inline void ___destructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1){ 599 ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))) /* ^?{} */); 600 } 601 static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){ 602 602 struct __anonymous21 ___ret__14s__anonymous21_1; 603 ((void)((*___dst__ R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1));604 ((void)___constructor__F_ R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1));603 ((void)((*___dst__P14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1)); 604 ((void)___constructor__F_P14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1)); 605 605 return ((struct __anonymous21 )___ret__14s__anonymous21_1); 606 606 } 607 static inline void ___constructor__F_ R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, int __i__i_1){608 ((void)((* ___dst__R14s__anonymous21_1).__i__i_1=__i__i_1) /* ?{} */);607 static inline void ___constructor__F_P14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, int __i__i_1){ 608 ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))=__i__i_1) /* ?{} */); 609 609 } 610 610 static inline volatile const struct __anonymous21 __f36__FCV14s__anonymous21___1(); … … 612 612 int __i__i_1; 613 613 }; 614 static inline void ___constructor__F_ R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);615 static inline void ___constructor__F_ R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);616 static inline void ___destructor__F_ R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);617 static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_ R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);618 static inline void ___constructor__F_ R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){619 ((void)((* ___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */);620 } 621 static inline void ___constructor__F_ R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){622 ((void)((* ___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1) /* ?{} */);623 } 624 static inline void ___destructor__F_ R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){625 ((void)((* ___dst__R14s__anonymous22_1).__i__i_1) /* ^?{} */);626 } 627 static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_ R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){614 static inline void ___constructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1); 615 static inline void ___constructor__F_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1); 616 static inline void ___destructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1); 617 static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1); 618 static inline void ___constructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1){ 619 ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))) /* ?{} */); 620 } 621 static inline void ___constructor__F_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){ 622 ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))=___src__14s__anonymous22_1.__i__i_1) /* ?{} */); 623 } 624 static inline void ___destructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1){ 625 ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))) /* ^?{} */); 626 } 627 static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){ 628 628 struct __anonymous22 ___ret__14s__anonymous22_1; 629 ((void)((*___dst__ R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1));630 ((void)___constructor__F_ R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1));629 ((void)((*___dst__P14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1)); 630 ((void)___constructor__F_P14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1)); 631 631 return ((struct __anonymous22 )___ret__14s__anonymous22_1); 632 632 } 633 static inline void ___constructor__F_ R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, int __i__i_1){634 ((void)((* ___dst__R14s__anonymous22_1).__i__i_1=__i__i_1) /* ?{} */);633 static inline void ___constructor__F_P14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, int __i__i_1){ 634 ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))=__i__i_1) /* ?{} */); 635 635 } 636 636 static inline volatile const struct __anonymous22 __f37__FCV14s__anonymous22___1(); … … 638 638 int __i__i_1; 639 639 }; 640 static inline void ___constructor__F_ R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);641 static inline void ___constructor__F_ R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);642 static inline void ___destructor__F_ R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);643 static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_ R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);644 static inline void ___constructor__F_ R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){645 ((void)((* ___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */);646 } 647 static inline void ___constructor__F_ R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){648 ((void)((* ___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1) /* ?{} */);649 } 650 static inline void ___destructor__F_ R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){651 ((void)((* ___dst__R14s__anonymous23_1).__i__i_1) /* ^?{} */);652 } 653 static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_ R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){640 static inline void ___constructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1); 641 static inline void ___constructor__F_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1); 642 static inline void ___destructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1); 643 static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1); 644 static inline void ___constructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1){ 645 ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))) /* ?{} */); 646 } 647 static inline void ___constructor__F_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){ 648 ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))=___src__14s__anonymous23_1.__i__i_1) /* ?{} */); 649 } 650 static inline void ___destructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1){ 651 ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))) /* ^?{} */); 652 } 653 static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){ 654 654 struct __anonymous23 ___ret__14s__anonymous23_1; 655 ((void)((*___dst__ R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1));656 ((void)___constructor__F_ R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1));655 ((void)((*___dst__P14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1)); 656 ((void)___constructor__F_P14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1)); 657 657 return ((struct __anonymous23 )___ret__14s__anonymous23_1); 658 658 } 659 static inline void ___constructor__F_ R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, int __i__i_1){660 ((void)((* ___dst__R14s__anonymous23_1).__i__i_1=__i__i_1) /* ?{} */);659 static inline void ___constructor__F_P14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, int __i__i_1){ 660 ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))=__i__i_1) /* ?{} */); 661 661 } 662 662 static inline volatile const struct __anonymous23 __f38__FCV14s__anonymous23___1(); … … 687 687 __attribute__ ((unused)) int ___retval_main__i_1; 688 688 int _tmp_cp_ret0; 689 ((void)(___retval_main__i_1=(( (void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);690 ((void)( _tmp_cp_ret0) /* ^?{} */);689 ((void)(___retval_main__i_1=((_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1)) , _tmp_cp_ret0)) /* ?{} */); 690 ((void)((*((int *)(&_tmp_cp_ret0)))) /* ^?{} */); 691 691 return ((int )___retval_main__i_1); 692 692 } -
src/tests/.expect/64/extension.txt
r8217e8f rbd46af4 13 13 __extension__ int __c__i_1; 14 14 }; 15 static inline void ___constructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1);16 static inline void ___constructor__F_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);17 static inline void ___destructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1);18 static inline struct S ___operator_assign__F2sS_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);19 static inline void ___constructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1){20 ((void)((* ___dst__R2sS_1).__a__i_1) /* ?{} */);21 ((void)((* ___dst__R2sS_1).__b__i_1) /* ?{} */);22 ((void)((* ___dst__R2sS_1).__c__i_1) /* ?{} */);15 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1); 16 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1); 17 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1); 18 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1); 19 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){ 20 ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))) /* ?{} */); 21 ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))) /* ?{} */); 22 ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ?{} */); 23 23 } 24 static inline void ___constructor__F_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){25 ((void)((* ___dst__R2sS_1).__a__i_1=___src__2sS_1.__a__i_1) /* ?{} */);26 ((void)((* ___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1) /* ?{} */);27 ((void)((* ___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1) /* ?{} */);24 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){ 25 ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=___src__2sS_1.__a__i_1) /* ?{} */); 26 ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))=___src__2sS_1.__b__i_1) /* ?{} */); 27 ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))=___src__2sS_1.__c__i_1) /* ?{} */); 28 28 } 29 static inline void ___destructor__F_ R2sS_autogen___1(struct S *___dst__R2sS_1){30 ((void)((* ___dst__R2sS_1).__c__i_1) /* ^?{} */);31 ((void)((* ___dst__R2sS_1).__b__i_1) /* ^?{} */);32 ((void)((* ___dst__R2sS_1).__a__i_1) /* ^?{} */);29 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){ 30 ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ^?{} */); 31 ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))) /* ^?{} */); 32 ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))) /* ^?{} */); 33 33 } 34 static inline struct S ___operator_assign__F2sS_ R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){34 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){ 35 35 struct S ___ret__2sS_1; 36 ((void)((*___dst__ R2sS_1).__a__i_1=___src__2sS_1.__a__i_1));37 ((void)((*___dst__ R2sS_1).__b__i_1=___src__2sS_1.__b__i_1));38 ((void)((*___dst__ R2sS_1).__c__i_1=___src__2sS_1.__c__i_1));39 ((void)___constructor__F_ R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));36 ((void)((*___dst__P2sS_1).__a__i_1=___src__2sS_1.__a__i_1)); 37 ((void)((*___dst__P2sS_1).__b__i_1=___src__2sS_1.__b__i_1)); 38 ((void)((*___dst__P2sS_1).__c__i_1=___src__2sS_1.__c__i_1)); 39 ((void)___constructor__F_P2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1)); 40 40 return ((struct S )___ret__2sS_1); 41 41 } 42 static inline void ___constructor__F_ R2sSi_autogen___1(struct S *___dst__R2sS_1, int __a__i_1){43 ((void)((* ___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);44 ((void)((* ___dst__R2sS_1).__b__i_1) /* ?{} */);45 ((void)((* ___dst__R2sS_1).__c__i_1) /* ?{} */);42 static inline void ___constructor__F_P2sSi_autogen___1(struct S *___dst__P2sS_1, int __a__i_1){ 43 ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=__a__i_1) /* ?{} */); 44 ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))) /* ?{} */); 45 ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ?{} */); 46 46 } 47 static inline void ___constructor__F_ R2sSii_autogen___1(struct S *___dst__R2sS_1, int __a__i_1, int __b__i_1){48 ((void)((* ___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);49 ((void)((* ___dst__R2sS_1).__b__i_1=__b__i_1) /* ?{} */);50 ((void)((* ___dst__R2sS_1).__c__i_1) /* ?{} */);47 static inline void ___constructor__F_P2sSii_autogen___1(struct S *___dst__P2sS_1, int __a__i_1, int __b__i_1){ 48 ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=__a__i_1) /* ?{} */); 49 ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))=__b__i_1) /* ?{} */); 50 ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ?{} */); 51 51 } 52 static inline void ___constructor__F_ R2sSiii_autogen___1(struct S *___dst__R2sS_1, int __a__i_1, int __b__i_1, int __c__i_1){53 ((void)((* ___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);54 ((void)((* ___dst__R2sS_1).__b__i_1=__b__i_1) /* ?{} */);55 ((void)((* ___dst__R2sS_1).__c__i_1=__c__i_1) /* ?{} */);52 static inline void ___constructor__F_P2sSiii_autogen___1(struct S *___dst__P2sS_1, int __a__i_1, int __b__i_1, int __c__i_1){ 53 ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=__a__i_1) /* ?{} */); 54 ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))=__b__i_1) /* ?{} */); 55 ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))=__c__i_1) /* ?{} */); 56 56 } 57 57 __extension__ union U { … … 60 60 __extension__ int __c__i_1; 61 61 }; 62 static inline void ___constructor__F_ R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){62 static inline void ___constructor__F_P2uU_autogen___1(union U *___dst__P2uU_1){ 63 63 } 64 static inline void ___constructor__F_ R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1){65 ((void)__builtin_memcpy(((void *)___dst__ R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));64 static inline void ___constructor__F_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){ 65 ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 66 66 } 67 static inline void ___destructor__F_ R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){67 static inline void ___destructor__F_P2uU_autogen___1(union U *___dst__P2uU_1){ 68 68 } 69 static inline union U ___operator_assign__F2uU_ R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1){69 static inline union U ___operator_assign__F2uU_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){ 70 70 union U ___ret__2uU_1; 71 ((void)__builtin_memcpy(((void *)___dst__ R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));72 ((void)___constructor__F_ R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));71 ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U ))); 72 ((void)___constructor__F_P2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1)); 73 73 return ((union U )___ret__2uU_1); 74 74 } 75 static inline void ___constructor__F_ R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, int __src__i_1){76 ((void)__builtin_memcpy(((void *)___dst__ R2uU_1), ((const void *)(&__src__i_1)), sizeof(int )));75 static inline void ___constructor__F_P2uUi_autogen___1(union U *___dst__P2uU_1, int __src__i_1){ 76 ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&__src__i_1)), sizeof(int ))); 77 77 } 78 78 __extension__ enum E { … … 102 102 ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2))); 103 103 int _tmp_cp_ret0; 104 ((void)(( (void)(_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3))) , _tmp_cp_ret0));105 ((void)( _tmp_cp_ret0) /* ^?{} */);104 ((void)((_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3)) , _tmp_cp_ret0)); 105 ((void)((*((int *)(&_tmp_cp_ret0)))) /* ^?{} */); 106 106 __extension__ int __mary__Fi_i__2(int __p__i_2){ 107 107 __attribute__ ((unused)) int ___retval_mary__i_2; … … 113 113 ((void)(((int )((__extension__ __a__i_2>__extension__ __b__i_2)!=((int )0))) ? __extension__ __c__i_2 : __extension__ __c__i_2)); 114 114 ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2))); 115 ((void)(( (void)(((void)__extension__ __a__i_2) , __extension__ __b__i_2)) , __extension__ __c__i_2));115 ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2)); 116 116 } -
src/tests/.expect/64/gccExtensions.txt
r8217e8f rbd46af4 43 43 __extension__ int __c__i_2; 44 44 }; 45 inline void ___constructor__F_ R2sS_autogen___2(struct S *___dst__R2sS_2){46 ((void)((* ___dst__R2sS_2).__a__i_2) /* ?{} */);47 ((void)((* ___dst__R2sS_2).__b__i_2) /* ?{} */);48 ((void)((* ___dst__R2sS_2).__c__i_2) /* ?{} */);45 inline void ___constructor__F_P2sS_autogen___2(struct S *___dst__P2sS_2){ 46 ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))) /* ?{} */); 47 ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))) /* ?{} */); 48 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ?{} */); 49 49 } 50 inline void ___constructor__F_ R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){51 ((void)((* ___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2) /* ?{} */);52 ((void)((* ___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2) /* ?{} */);53 ((void)((* ___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2) /* ?{} */);50 inline void ___constructor__F_P2sS2sS_autogen___2(struct S *___dst__P2sS_2, struct S ___src__2sS_2){ 51 ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=___src__2sS_2.__a__i_2) /* ?{} */); 52 ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))=___src__2sS_2.__b__i_2) /* ?{} */); 53 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=___src__2sS_2.__c__i_2) /* ?{} */); 54 54 } 55 inline void ___destructor__F_ R2sS_autogen___2(struct S *___dst__R2sS_2){56 ((void)((* ___dst__R2sS_2).__c__i_2) /* ^?{} */);57 ((void)((* ___dst__R2sS_2).__b__i_2) /* ^?{} */);58 ((void)((* ___dst__R2sS_2).__a__i_2) /* ^?{} */);55 inline void ___destructor__F_P2sS_autogen___2(struct S *___dst__P2sS_2){ 56 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ^?{} */); 57 ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))) /* ^?{} */); 58 ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))) /* ^?{} */); 59 59 } 60 inline struct S ___operator_assign__F2sS_ R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){60 inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___2(struct S *___dst__P2sS_2, struct S ___src__2sS_2){ 61 61 struct S ___ret__2sS_2; 62 ((void)((*___dst__ R2sS_2).__a__i_2=___src__2sS_2.__a__i_2));63 ((void)((*___dst__ R2sS_2).__b__i_2=___src__2sS_2.__b__i_2));64 ((void)((*___dst__ R2sS_2).__c__i_2=___src__2sS_2.__c__i_2));65 ((void)___constructor__F_ R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));62 ((void)((*___dst__P2sS_2).__a__i_2=___src__2sS_2.__a__i_2)); 63 ((void)((*___dst__P2sS_2).__b__i_2=___src__2sS_2.__b__i_2)); 64 ((void)((*___dst__P2sS_2).__c__i_2=___src__2sS_2.__c__i_2)); 65 ((void)___constructor__F_P2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2)); 66 66 return ((struct S )___ret__2sS_2); 67 67 } 68 inline void ___constructor__F_ R2sSi_autogen___2(struct S *___dst__R2sS_2, int __a__i_2){69 ((void)((* ___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);70 ((void)((* ___dst__R2sS_2).__b__i_2) /* ?{} */);71 ((void)((* ___dst__R2sS_2).__c__i_2) /* ?{} */);68 inline void ___constructor__F_P2sSi_autogen___2(struct S *___dst__P2sS_2, int __a__i_2){ 69 ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=__a__i_2) /* ?{} */); 70 ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))) /* ?{} */); 71 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ?{} */); 72 72 } 73 inline void ___constructor__F_ R2sSii_autogen___2(struct S *___dst__R2sS_2, int __a__i_2, int __b__i_2){74 ((void)((* ___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);75 ((void)((* ___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);76 ((void)((* ___dst__R2sS_2).__c__i_2) /* ?{} */);73 inline void ___constructor__F_P2sSii_autogen___2(struct S *___dst__P2sS_2, int __a__i_2, int __b__i_2){ 74 ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=__a__i_2) /* ?{} */); 75 ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))=__b__i_2) /* ?{} */); 76 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ?{} */); 77 77 } 78 inline void ___constructor__F_ R2sSiii_autogen___2(struct S *___dst__R2sS_2, int __a__i_2, int __b__i_2, int __c__i_2){79 ((void)((* ___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);80 ((void)((* ___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);81 ((void)((* ___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);78 inline void ___constructor__F_P2sSiii_autogen___2(struct S *___dst__P2sS_2, int __a__i_2, int __b__i_2, int __c__i_2){ 79 ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=__a__i_2) /* ?{} */); 80 ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))=__b__i_2) /* ?{} */); 81 ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=__c__i_2) /* ?{} */); 82 82 } 83 83 int __i__i_2 = ((int )__extension__ 3); … … 85 85 __extension__ int __b__i_2; 86 86 __extension__ int __c__i_2; 87 ((void)(( (void)(((void)__extension__ __a__i_2) , __extension__ __b__i_2)) , __extension__ __c__i_2));87 ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2)); 88 88 ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2))); 89 89 ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2))); … … 101 101 int __i__i_2; 102 102 }; 103 inline void ___constructor__F_ R3ss2_autogen___2(struct s2 *___dst__R3ss2_2){104 ((void)((* ___dst__R3ss2_2).__i__i_2) /* ?{} */);103 inline void ___constructor__F_P3ss2_autogen___2(struct s2 *___dst__P3ss2_2){ 104 ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))) /* ?{} */); 105 105 } 106 inline void ___constructor__F_ R3ss23ss2_autogen___2(struct s2 *___dst__R3ss2_2, struct s2 ___src__3ss2_2){107 ((void)((* ___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2) /* ?{} */);106 inline void ___constructor__F_P3ss23ss2_autogen___2(struct s2 *___dst__P3ss2_2, struct s2 ___src__3ss2_2){ 107 ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))=___src__3ss2_2.__i__i_2) /* ?{} */); 108 108 } 109 inline void ___destructor__F_ R3ss2_autogen___2(struct s2 *___dst__R3ss2_2){110 ((void)((* ___dst__R3ss2_2).__i__i_2) /* ^?{} */);109 inline void ___destructor__F_P3ss2_autogen___2(struct s2 *___dst__P3ss2_2){ 110 ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))) /* ^?{} */); 111 111 } 112 inline struct s2 ___operator_assign__F3ss2_ R3ss23ss2_autogen___2(struct s2 *___dst__R3ss2_2, struct s2 ___src__3ss2_2){112 inline struct s2 ___operator_assign__F3ss2_P3ss23ss2_autogen___2(struct s2 *___dst__P3ss2_2, struct s2 ___src__3ss2_2){ 113 113 struct s2 ___ret__3ss2_2; 114 ((void)((*___dst__ R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2));115 ((void)___constructor__F_ R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));114 ((void)((*___dst__P3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2)); 115 ((void)___constructor__F_P3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2)); 116 116 return ((struct s2 )___ret__3ss2_2); 117 117 } 118 inline void ___constructor__F_ R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, int __i__i_2){119 ((void)((* ___dst__R3ss2_2).__i__i_2=__i__i_2) /* ?{} */);118 inline void ___constructor__F_P3ss2i_autogen___2(struct s2 *___dst__P3ss2_2, int __i__i_2){ 119 ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))=__i__i_2) /* ?{} */); 120 120 } 121 121 struct s3 { 122 122 int __i__i_2; 123 123 }; 124 inline void ___constructor__F_ R3ss3_autogen___2(struct s3 *___dst__R3ss3_2){125 ((void)((* ___dst__R3ss3_2).__i__i_2) /* ?{} */);124 inline void ___constructor__F_P3ss3_autogen___2(struct s3 *___dst__P3ss3_2){ 125 ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))) /* ?{} */); 126 126 } 127 inline void ___constructor__F_ R3ss33ss3_autogen___2(struct s3 *___dst__R3ss3_2, struct s3 ___src__3ss3_2){128 ((void)((* ___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2) /* ?{} */);127 inline void ___constructor__F_P3ss33ss3_autogen___2(struct s3 *___dst__P3ss3_2, struct s3 ___src__3ss3_2){ 128 ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))=___src__3ss3_2.__i__i_2) /* ?{} */); 129 129 } 130 inline void ___destructor__F_ R3ss3_autogen___2(struct s3 *___dst__R3ss3_2){131 ((void)((* ___dst__R3ss3_2).__i__i_2) /* ^?{} */);130 inline void ___destructor__F_P3ss3_autogen___2(struct s3 *___dst__P3ss3_2){ 131 ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))) /* ^?{} */); 132 132 } 133 inline struct s3 ___operator_assign__F3ss3_ R3ss33ss3_autogen___2(struct s3 *___dst__R3ss3_2, struct s3 ___src__3ss3_2){133 inline struct s3 ___operator_assign__F3ss3_P3ss33ss3_autogen___2(struct s3 *___dst__P3ss3_2, struct s3 ___src__3ss3_2){ 134 134 struct s3 ___ret__3ss3_2; 135 ((void)((*___dst__ R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2));136 ((void)___constructor__F_ R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));135 ((void)((*___dst__P3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2)); 136 ((void)___constructor__F_P3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2)); 137 137 return ((struct s3 )___ret__3ss3_2); 138 138 } 139 inline void ___constructor__F_ R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, int __i__i_2){140 ((void)((* ___dst__R3ss3_2).__i__i_2=__i__i_2) /* ?{} */);139 inline void ___constructor__F_P3ss3i_autogen___2(struct s3 *___dst__P3ss3_2, int __i__i_2){ 140 ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))=__i__i_2) /* ?{} */); 141 141 } 142 142 struct s3 __x1__3ss3_2; … … 145 145 int __i__i_2; 146 146 }; 147 inline void ___constructor__F_ R3ss4_autogen___2(struct s4 *___dst__R3ss4_2){148 ((void)((* ___dst__R3ss4_2).__i__i_2) /* ?{} */);147 inline void ___constructor__F_P3ss4_autogen___2(struct s4 *___dst__P3ss4_2){ 148 ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))) /* ?{} */); 149 149 } 150 inline void ___constructor__F_ R3ss43ss4_autogen___2(struct s4 *___dst__R3ss4_2, struct s4 ___src__3ss4_2){151 ((void)((* ___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2) /* ?{} */);150 inline void ___constructor__F_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){ 151 ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))=___src__3ss4_2.__i__i_2) /* ?{} */); 152 152 } 153 inline void ___destructor__F_ R3ss4_autogen___2(struct s4 *___dst__R3ss4_2){154 ((void)((* ___dst__R3ss4_2).__i__i_2) /* ^?{} */);153 inline void ___destructor__F_P3ss4_autogen___2(struct s4 *___dst__P3ss4_2){ 154 ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))) /* ^?{} */); 155 155 } 156 inline struct s4 ___operator_assign__F3ss4_ R3ss43ss4_autogen___2(struct s4 *___dst__R3ss4_2, struct s4 ___src__3ss4_2){156 inline struct s4 ___operator_assign__F3ss4_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){ 157 157 struct s4 ___ret__3ss4_2; 158 ((void)((*___dst__ R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));159 ((void)___constructor__F_ R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));158 ((void)((*___dst__P3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2)); 159 ((void)___constructor__F_P3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2)); 160 160 return ((struct s4 )___ret__3ss4_2); 161 161 } 162 inline void ___constructor__F_ R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, int __i__i_2){163 ((void)((* ___dst__R3ss4_2).__i__i_2=__i__i_2) /* ?{} */);162 inline void ___constructor__F_P3ss4i_autogen___2(struct s4 *___dst__P3ss4_2, int __i__i_2){ 163 ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))=__i__i_2) /* ?{} */); 164 164 } 165 165 struct s4 __x2__3ss4_2; … … 184 184 __attribute__ ((unused)) int ___retval_main__i_1; 185 185 int _tmp_cp_ret0; 186 ((void)(___retval_main__i_1=(( (void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);187 ((void)( _tmp_cp_ret0) /* ^?{} */);186 ((void)(___retval_main__i_1=((_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1)) , _tmp_cp_ret0)) /* ?{} */); 187 ((void)((*((int *)(&_tmp_cp_ret0)))) /* ^?{} */); 188 188 return ((int )___retval_main__i_1); 189 189 } -
src/tests/.expect/castError.txt
r8217e8f rbd46af4 4 4 to: 5 5 char 6 Alternatives are: Cost ( 1, 0, 0 , 0): Cast of:6 Alternatives are: Cost ( 1, 0, 0 ): Cast of: 7 7 Variable Expression: f: function 8 8 accepting unspecified arguments … … 18 18 Environment: 19 19 20 Cost ( 1, 0, 0 , 0): Cast of:20 Cost ( 1, 0, 0 ): Cast of: 21 21 Variable Expression: f: signed int 22 22 … … 28 28 Environment: 29 29 30 Cost ( 1, 0, 0 , 0): Cast of:30 Cost ( 1, 0, 0 ): Cast of: 31 31 Variable Expression: f: double 32 32 -
src/tests/.expect/memberCtors-ERR1.txt
r8217e8f rbd46af4 1 memberCtors.c:71 error: in void ?{}(B &b), field a2 used before being constructed1 memberCtors.c:71 error: in void ?{}(B *b), field a2 used before being constructed -
src/tests/.expect/memberCtors.txt
r8217e8f rbd46af4 7 7 constructing int 8 8 begin construct B 9 assign b .a210 constructing int 11 constructing int 12 begin construct A 13 construct a .x9 assign b->a2 10 constructing int 11 constructing int 12 begin construct A 13 construct a->x 14 14 constructing int: 1001 15 assign a .y16 assigning int: 0 0 17 end construct A 18 copy constructing int: 0 19 copy constructing int: 0 20 begin copy construct A 21 copy construct this .x22 copy constructing int: 1001 23 assign this .y15 assign a->y 16 assigning int: 0 0 17 end construct A 18 copy constructing int: 0 19 copy constructing int: 0 20 begin copy construct A 21 copy construct this->x 22 copy constructing int: 1001 23 assign this->y 24 24 copy constructing int: 0 25 25 destructing int: 0 … … 40 40 copy constructing int: 0 41 41 begin copy construct A 42 copy construct this .x43 copy constructing int: 1001 44 assign this .y45 copy constructing int: 0 46 destructing int: 0 47 destructing int: 0 48 end copy construct A 49 destructing int: 0 50 destructing int: 0 51 destructing int: 1001 52 destructing int: 0 53 destructing int: 0 54 destructing int: 1001 55 construct b .a156 constructing int 57 constructing int 58 begin construct A 59 construct a .x42 copy construct this->x 43 copy constructing int: 1001 44 assign this->y 45 copy constructing int: 0 46 destructing int: 0 47 destructing int: 0 48 end copy construct A 49 destructing int: 0 50 destructing int: 0 51 destructing int: 1001 52 destructing int: 0 53 destructing int: 0 54 destructing int: 1001 55 construct b->a1 56 constructing int 57 constructing int 58 begin construct A 59 construct a->x 60 60 constructing int: 1000 61 assign a .y61 assign a->y 62 62 assigning int: 0 0 63 63 end construct A … … 70 70 copy constructing int: 0 71 71 begin copy construct A 72 copy construct this .x72 copy construct this->x 73 73 copy constructing int: 1000 74 assign this .y75 copy constructing int: 0 76 destructing int: 0 77 destructing int: 0 78 end copy construct A 79 copy constructing int: 0 80 copy constructing int: 0 81 begin copy construct A 82 copy construct this .x83 copy constructing int: 1001 84 assign this .y85 copy constructing int: 0 86 destructing int: 0 87 destructing int: 0 88 end copy construct A 89 copy constructing int: 0 90 copy constructing int: 0 91 begin copy construct A 92 copy construct this .x93 copy constructing int: 0 94 assign this .y74 assign this->y 75 copy constructing int: 0 76 destructing int: 0 77 destructing int: 0 78 end copy construct A 79 copy constructing int: 0 80 copy constructing int: 0 81 begin copy construct A 82 copy construct this->x 83 copy constructing int: 1001 84 assign this->y 85 copy constructing int: 0 86 destructing int: 0 87 destructing int: 0 88 end copy construct A 89 copy constructing int: 0 90 copy constructing int: 0 91 begin copy construct A 92 copy construct this->x 93 copy constructing int: 0 94 assign this->y 95 95 copy constructing int: 0 96 96 destructing int: 0 … … 101 101 constructing int 102 102 begin construct A 103 construct a .x103 construct a->x 104 104 constructing int: 999 105 assign a .y106 assigning int: 0 0 107 end construct A 108 copy constructing int: 0 109 copy constructing int: 0 110 begin copy construct A 111 copy construct this .x112 copy constructing int: 999 113 assign this .y105 assign a->y 106 assigning int: 0 0 107 end construct A 108 copy constructing int: 0 109 copy constructing int: 0 110 begin copy construct A 111 copy construct this->x 112 copy constructing int: 999 113 assign this->y 114 114 copy constructing int: 0 115 115 destructing int: 0 … … 130 130 copy constructing int: 0 131 131 begin copy construct A 132 copy construct this .x133 copy constructing int: 999 134 assign this .y132 copy construct this->x 133 copy constructing int: 999 134 assign this->y 135 135 copy constructing int: 0 136 136 destructing int: 0 … … 158 158 constructing int 159 159 begin construct A 160 construct a .x160 construct a->x 161 161 constructing int: 999 162 assign a .y163 assigning int: 0 0 164 end construct A 165 copy constructing int: 0 166 copy constructing int: 0 167 begin copy construct A 168 copy construct this .x169 copy constructing int: 999 170 assign this .y162 assign a->y 163 assigning int: 0 0 164 end construct A 165 copy constructing int: 0 166 copy constructing int: 0 167 begin copy construct A 168 copy construct this->x 169 copy constructing int: 999 170 assign this->y 171 171 copy constructing int: 0 172 172 destructing int: 0 … … 187 187 copy constructing int: 0 188 188 begin copy construct A 189 copy construct this .x190 copy constructing int: 999 191 assign this .y189 copy construct this->x 190 copy constructing int: 999 191 assign this->y 192 192 copy constructing int: 0 193 193 destructing int: 0 -
src/tests/alloc.c
r8217e8f rbd46af4 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // … … 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // alloc.c -- 8 // 7 // alloc.c -- 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Wed Feb 3 07:56:22 2016 … … 12 12 // Last Modified On : Thu Jul 20 16:01:10 2017 13 13 // Update Count : 318 14 // 14 // 15 15 16 16 #include <assert.h> … … 19 19 #include <stdlib.h> // posix_memalign 20 20 #include <fstream> 21 #include <stdlib> // access C malloc, realloc21 #include <stdlib> // access C malloc, realloc 22 22 23 23 int * foo( int * p, int c ) { return p; } … … 26 26 27 27 int main( void ) { 28 size_t dim = 10;29 int * p;28 size_t dim = 10; 29 int * p; 30 30 char fill = '\1'; 31 31 32 32 // allocation, non-array types 33 33 34 p = (void *)malloc( sizeof(*p) );// C malloc, type unsafe34 p = (void *)malloc( sizeof(*p) ); // C malloc, type unsafe 35 35 *p = 0xdeadbeef; 36 36 printf( "C malloc %#x\n", *p ); 37 free( p );38 39 p = malloc();// CFA malloc, type safe37 free( p ); 38 39 p = malloc(); // CFA malloc, type safe 40 40 *p = 0xdeadbeef; 41 41 printf( "CFA malloc %#x\n", *p ); 42 free( p );43 44 p = alloc();// CFA alloc, type safe42 free( p ); 43 44 p = alloc(); // CFA alloc, type safe 45 45 *p = 0xdeadbeef; 46 46 printf( "CFA alloc %#x\n", *p ); 47 free( p );48 49 p = alloc( fill );// CFA alloc, fill47 free( p ); 48 49 p = alloc( fill ); // CFA alloc, fill 50 50 printf( "CFA alloc, fill %08x\n", *p ); 51 51 … … 54 54 printf( "\n" ); 55 55 56 p = calloc( dim, sizeof( *p ) );// C array calloc, type unsafe56 p = calloc( dim, sizeof( *p ) ); // C array calloc, type unsafe 57 57 printf( "C array calloc, fill 0\n" ); 58 58 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); } 59 59 printf( "\n" ); 60 free( p );61 62 p = calloc( dim );// CFA array calloc, type safe60 free( p ); 61 62 p = calloc( dim ); // CFA array calloc, type safe 63 63 printf( "CFA array calloc, fill 0\n" ); 64 64 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); } 65 65 printf( "\n" ); 66 free( p );67 68 p = alloc( dim );// CFA array alloc, type safe66 free( p ); 67 68 p = alloc( dim ); // CFA array alloc, type safe 69 69 for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; } 70 70 printf( "CFA array alloc, no fill\n" ); 71 71 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); } 72 72 printf( "\n" ); 73 free( p );74 75 p = alloc( 2 * dim, fill );// CFA array alloc, fill73 free( p ); 74 75 p = alloc( 2 * dim, fill ); // CFA array alloc, fill 76 76 printf( "CFA array alloc, fill %#x\n", fill ); 77 77 for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); } … … 83 83 printf( "\n" ); 84 84 85 p = (void *)realloc( p, dim * sizeof(*p) );// C realloc85 p = (void *)realloc( p, dim * sizeof(*p) ); // C realloc 86 86 for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; } 87 87 printf( "C realloc\n" ); … … 89 89 printf( "\n" ); 90 90 91 p = realloc( p, 2 * dim * sizeof(*p) );// CFA realloc91 p = realloc( p, 2 * dim * sizeof(*p) ); // CFA realloc 92 92 for ( int i = dim; i < 2 * dim; i += 1 ) { p[i] = 0x1010101; } 93 93 printf( "CFA realloc\n" ); … … 100 100 printf( "\n" ); 101 101 102 p = alloc( p, dim );// CFA resize array alloc102 p = alloc( p, dim ); // CFA resize array alloc 103 103 for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; } 104 104 printf( "CFA resize alloc\n" ); … … 106 106 printf( "\n" ); 107 107 108 p = alloc( p, 2 * dim );// CFA resize array alloc108 p = alloc( p, 2 * dim ); // CFA resize array alloc 109 109 for ( int i = dim; i < 2 * dim; i += 1 ) { p[i] = 0x1010101; } 110 110 printf( "CFA resize array alloc\n" ); … … 112 112 printf( "\n" ); 113 113 114 p = alloc( p, dim );// CFA array alloc114 p = alloc( p, dim ); // CFA array alloc 115 115 printf( "CFA resize array alloc\n" ); 116 116 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); } … … 120 120 p = 0; 121 121 122 p = alloc( p, dim, fill );// CFA array alloc, fill122 p = alloc( p, dim, fill ); // CFA array alloc, fill 123 123 printf( "CFA resize array alloc, fill\n" ); 124 124 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); } 125 125 printf( "\n" ); 126 126 127 p = alloc( p, 2 * dim, fill );// CFA array alloc, fill127 p = alloc( p, 2 * dim, fill ); // CFA array alloc, fill 128 128 printf( "CFA resize array alloc, fill\n" ); 129 129 for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); } 130 130 printf( "\n" ); 131 131 132 p = alloc( p, dim, fill );// CFA array alloc, fill132 p = alloc( p, dim, fill ); // CFA array alloc, fill 133 133 printf( "CFA resize array alloc, fill\n" ); 134 134 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] );; } … … 137 137 138 138 139 struct Struct { int x; double y; };140 Struct st, st1, sta[dim], sta1[dim], * stp, * stp1;139 struct Struct { int x; double y; }; 140 Struct st, st1, sta[dim], sta1[dim], * stp, * stp1; 141 141 142 142 // alignment, non-array types … … 144 144 enum { Alignment = 128 }; 145 145 146 stp = (memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign146 stp = (memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign 147 147 assert( (uintptr_t)stp % Alignment == 0 ); 148 148 printf( "C memalign %d %g\n", stp->x, stp->y ); 149 free( stp );150 151 stp = (memalign( Alignment )){ 42, 42.5 };// CFA memalign149 free( stp ); 150 151 stp = (memalign( Alignment )){ 42, 42.5 }; // CFA memalign 152 152 assert( (uintptr_t)stp % Alignment == 0 ); 153 153 printf( "CFA memalign %d %g\n", stp->x, stp->y ); 154 free( stp );155 156 posix_memalign( (void **)&stp, Alignment, sizeof( *stp ) );// C posix_memalign154 free( stp ); 155 156 posix_memalign( (void **)&stp, Alignment, sizeof( *stp ) ); // C posix_memalign 157 157 *stp = (Struct){ 42, 42.5 }; 158 158 assert( (uintptr_t)stp % Alignment == 0 ); 159 159 printf( "CFA posix_memalign %d %g\n", stp->x, stp->y ); 160 free( stp );161 162 posix_memalign( &stp, Alignment );// CFA posix_memalign160 free( stp ); 161 162 posix_memalign( &stp, Alignment ); // CFA posix_memalign 163 163 *stp = (Struct){ 42, 42.5 }; 164 164 assert( (uintptr_t)stp % Alignment == 0 ); 165 165 printf( "CFA posix_memalign %d %g\n", stp->x, stp->y ); 166 free( stp );167 168 stp = (aligned_alloc( Alignment )){ 42, 42.5 };// CFA aligned_alloc166 free( stp ); 167 168 stp = (aligned_alloc( Alignment )){ 42, 42.5 }; // CFA aligned_alloc 169 169 assert( (uintptr_t)stp % Alignment == 0 ); 170 170 printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y ); 171 free( stp );172 173 stp = (align_alloc( Alignment )){ 42, 42.5 };// CFA align_alloc171 free( stp ); 172 173 stp = (align_alloc( Alignment )){ 42, 42.5 }; // CFA align_alloc 174 174 assert( (uintptr_t)stp % Alignment == 0 ); 175 175 printf( "CFA align_alloc %d %g\n", stp->x, stp->y ); 176 free( stp );177 178 stp = align_alloc( Alignment, fill );// CFA memalign, fill176 free( stp ); 177 178 stp = align_alloc( Alignment, fill ); // CFA memalign, fill 179 179 assert( (uintptr_t)stp % Alignment == 0 ); 180 180 printf( "CFA align_alloc fill %#x %a\n", stp->x, stp->y ); 181 free( stp );181 free( stp ); 182 182 183 183 … … 185 185 printf( "\n" ); 186 186 187 stp = align_alloc( Alignment, dim );// CFA array memalign187 stp = align_alloc( Alignment, dim ); // CFA array memalign 188 188 assert( (uintptr_t)stp % Alignment == 0 ); 189 189 for ( int i = 0; i < dim; i += 1 ) { stp[i] = (Struct){ 42, 42.5 }; } … … 191 191 for ( int i = 0; i < dim; i += 1 ) { printf( "%d %g, ", stp[i].x, stp[i].y ); } 192 192 printf( "\n" ); 193 free( stp );194 195 stp = align_alloc( Alignment, dim, fill );// CFA array memalign, fill193 free( stp ); 194 195 stp = align_alloc( Alignment, dim, fill ); // CFA array memalign, fill 196 196 assert( (uintptr_t)stp % Alignment == 0 ); 197 197 printf( "CFA array align_alloc, fill\n" ); 198 198 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", stp[i].x, stp[i].y ); } 199 199 printf( "\n" ); 200 free( stp );200 free( stp ); 201 201 202 202 … … 204 204 printf( "\n" ); 205 205 206 memset( &st, fill );// CFA memset, type safe206 memset( &st, fill ); // CFA memset, type safe 207 207 printf( "CFA memset %#x %a\n", st.x, st.y ); 208 memcpy( &st1, &st );// CFA memcpy, type safe208 memcpy( &st1, &st ); // CFA memcpy, type safe 209 209 printf( "CFA memcpy %#x %a\n", st1.x, st1.y ); 210 210 … … 213 213 printf( "\n" ); 214 214 215 memset( sta, dim, fill );// CFA array memset, type safe215 memset( sta, dim, fill ); // CFA array memset, type safe 216 216 printf( "CFA array memset\n" ); 217 217 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", sta[i].x, sta[i].y ); } 218 218 printf( "\n" ); 219 219 220 memcpy( sta1, sta, dim );// CFA array memcpy, type safe220 memcpy( sta1, sta, dim ); // CFA array memcpy, type safe 221 221 printf( "CFA memcpy\n" ); 222 222 for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", sta1[i].x, sta1[i].y ); } … … 245 245 printf( "\n" ); 246 246 247 float * fp = malloc() + 1;248 printf( "pointer arithmetic %d\n", fp == fp - 1 );249 free( fp - 1 );250 251 p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );247 float * fp = malloc() + 1; 248 printf( "pointer arithmetic %d\n", fp == fp - 1 ); 249 free( fp - 1 ); 250 251 p = foo( bar( baz( malloc(), 0 ), 0 ), 0 ); 252 252 *p = 0xdeadbeef; 253 253 printf( "CFA deep malloc %#x\n", *p ); 254 free( p );254 free( p ); 255 255 256 256 stp = malloc(); 257 257 printf( "\nSHOULD FAIL\n" ); 258 p = alloc( stp, dim * sizeof(*stp) );259 p = memset( stp, 10 );260 p = memcpy( &st1, &st );258 p = alloc( stp, dim * sizeof(*stp) ); 259 p = memset( stp, 10 ); 260 p = memcpy( &st1, &st ); 261 261 } // main 262 262 -
src/tests/avltree/avl.h
r8217e8f rbd46af4 22 22 // forall( otype T, ttype Params | { void ?{}(T *, Params); } ) T * new( Params p ); 23 23 24 forall(dtype T | { void ^?{}(T &); })24 forall(dtype T | { void ^?{}(T *); }) 25 25 void delete(T * x); 26 26 … … 58 58 59 59 forall(otype K | Comparable(K), otype V) 60 void ?{}(tree(K, V) &t, K key, V value);60 void ?{}(tree(K, V) *t, K key, V value); 61 61 62 62 forall(otype K, otype V) 63 void ^?{}(tree(K, V) &t);63 void ^?{}(tree(K, V) * t); 64 64 65 65 forall(otype K | Comparable(K), otype V) -
src/tests/avltree/avl1.c
r8217e8f rbd46af4 3 3 4 4 forall(otype K | Comparable(K), otype V) 5 void ?{}(tree(K, V) &t, K key, V value){6 ( t.key) { key };7 ( t.value) { value };8 t .parent = NULL;9 t .left = NULL;10 t .right = NULL;11 t .balance = 0;5 void ?{}(tree(K, V) *t, K key, V value){ 6 (&t->key) { key }; 7 (&t->value) { value }; 8 t->parent = NULL; 9 t->left = NULL; 10 t->right = NULL; 11 t->balance = 0; 12 12 } 13 13 14 14 forall(otype K, otype V) 15 void ^?{}(tree(K, V) &t){16 delete(t .left);17 delete(t .right);18 ^( t.key){};19 ^( t.value){};15 void ^?{}(tree(K, V) * t){ 16 delete(t->left); 17 delete(t->right); 18 ^(&t->key){}; 19 ^(&t->value){}; 20 20 } 21 21 … … 24 24 // infinite loop trying to resolve ... t = malloc(); 25 25 tree(K, V) * t = malloc(sizeof(tree(K,V))); 26 (*t){ key, value };26 t { key, value }; 27 27 return t; 28 28 } -
src/tests/coroutine.c
r8217e8f rbd46af4 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 7 // fibonacci.c -- 8 // 6 // 7 // fibonacci.c -- 8 // 9 9 // Author : Thierry Delisle 10 10 // Created On : Thu Jun 8 07:29:37 2017 … … 12 12 // Last Modified On : Thu Jun 8 07:37:12 2017 13 13 // Update Count : 5 14 // 14 // 15 15 16 16 #include <fstream> … … 21 21 }; 22 22 23 void ?{}( Fibonacci &this ) {24 this .fn = 0;23 void ?{}( Fibonacci * this ) { 24 this->fn = 0; 25 25 } 26 26 27 void main( Fibonacci &this ) {27 void main( Fibonacci * this ) { 28 28 int fn1, fn2; // retained between resumes 29 this .fn = 0; // case 030 fn1 = this .fn;29 this->fn = 0; // case 0 30 fn1 = this->fn; 31 31 suspend(); // return to last resume 32 32 33 this .fn = 1; // case 133 this->fn = 1; // case 1 34 34 fn2 = fn1; 35 fn1 = this .fn;35 fn1 = this->fn; 36 36 suspend(); // return to last resume 37 37 38 38 for ( ;; ) { // general case 39 this .fn = fn1 + fn2;39 this->fn = fn1 + fn2; 40 40 fn2 = fn1; 41 fn1 = this .fn;41 fn1 = this->fn; 42 42 suspend(); // return to last resume 43 43 } // for 44 44 } 45 45 46 int next( Fibonacci &this ) {46 int next( Fibonacci * this ) { 47 47 resume( this ); // transfer to last suspend 48 return this .fn;48 return this->fn; 49 49 } 50 50 … … 52 52 Fibonacci f1, f2; 53 53 for ( int i = 1; i <= 10; i += 1 ) { 54 sout | next( f1 ) | ' ' | next(f2 ) | endl;54 sout | next( &f1 ) | ' ' | next( &f2 ) | endl; 55 55 } // for 56 56 } -
src/tests/dtor-early-exit.c
r8217e8f rbd46af4 27 27 28 28 // don't want these called 29 void ?{}(A &a) { assert( false ); }30 void ?{}(A & a, const char * name) { a.name = name; sout | "construct " | name | endl; a.x = (int*)malloc(); }31 void ?{}(A &a, const char * name, int * ptr) { assert( false ); }32 33 A ?=?(A & a, A b) { sout | "assign " | a.name | " " | b.name; return a; }34 void ?{}(A & a, A b) { sout | "copy construct " | b.name | endl; a.x = (int*)malloc(); }35 void ^?{}(A & a) { sout | "destruct " | a.name | endl; free(a.x); }29 void ?{}(A * a) { assert( false ); } 30 void ?{}(A * a, const char * name) { a->name = name; sout | "construct " | name | endl; a->x = (int*)malloc(); } 31 void ?{}(A * a, const char * name, int * ptr) { assert( false ); } 32 33 A ?=?(A * a, A a) { sout | "assign " | a->name | " " | a.name; return a; } 34 void ?{}(A * a, A a) { sout | "copy construct " | a.name | endl; a->x = (int*)malloc(); } 35 void ^?{}(A * a) { sout | "destruct " | a->name | endl; free(a->x); } 36 36 37 37 // test returns -
src/tests/globals.c
r8217e8f rbd46af4 5 5 }; 6 6 7 void ?{}( value_t & this ) { this.value = 22; }7 void ?{}( value_t * this ) { this->value = 22; } 8 8 9 9 //Standard case … … 12 12 }; 13 13 14 void ?{}( g_t & this ) { (this.val){}; }14 void ?{}( g_t * this ) { (&this->val){}; } 15 15 16 16 g_t g; … … 25 25 //Inline case 26 26 struct gi_t; 27 void ?{}( gi_t &this );27 void ?{}( gi_t * this ); 28 28 29 29 struct gi_t { … … 31 31 } gi; 32 32 33 void ?{}( gi_t & this ) { (this.val){}; }33 void ?{}( gi_t * this ) { (&this->val){}; } 34 34 35 35 //Inline autogen case … … 43 43 }; 44 44 45 void ?{}( gs_t & this ) { (this.val){}; }45 void ?{}( gs_t * this ) { (&this->val){}; } 46 46 47 47 static gs_t gs; … … 56 56 //Static inline case 57 57 struct gsi_t; 58 void ?{}( gsi_t &this );58 void ?{}( gsi_t * this ); 59 59 60 60 static struct gsi_t { … … 62 62 } gsi; 63 63 64 void ?{}( gsi_t & this ) { (this.val){}; }64 void ?{}( gsi_t * this ) { (&this->val){}; } 65 65 66 66 //Static inline autogen case -
src/tests/init_once.c
r8217e8f rbd46af4 60 60 return -1; 61 61 } 62 void ?{}(array &arr) {63 memset(arr .elems, 0, sizeof(arr.elems));64 arr .length = 0;62 void ?{}(array * arr) { 63 memset(arr->elems, 0, sizeof(arr->elems)); 64 arr->length = 0; 65 65 } 66 66 array constructed; 67 67 array destructed; 68 68 69 void ?{}(init_once &x) {70 assert( find( &constructed, &x ) == -1 );71 remove( &destructed, &x );72 insert( &constructed, &x );69 void ?{}(init_once * x) { 70 assert( find( &constructed, x ) == -1 ); 71 remove( &destructed, x ); 72 insert( &constructed, x ); 73 73 74 x .x = malloc(sizeof(int));74 x->x = malloc(sizeof(int)); 75 75 } 76 76 77 void ?{}(init_once &x, init_once other) {77 void ?{}(init_once * x, init_once other) { 78 78 x{}; // reuse default ctor 79 79 } 80 80 81 void ^?{}(init_once &x) {82 assert( find( &destructed, &x ) == -1 );83 remove( &constructed, &x );84 insert( &destructed, &x );81 void ^?{}(init_once * x) { 82 assert( find( &destructed, x ) == -1 ); 83 remove( &constructed, x ); 84 insert( &destructed, x ); 85 85 86 free(x .x);86 free(x->x); 87 87 } 88 88 //*** end setup … … 125 125 init_once x; 126 126 init_once y = x; 127 x{}; // ensure this doesn't execute127 (&x) {}; // ensure this doesn't execute 128 128 break; 129 129 } -
src/tests/memberCtors.c
r8217e8f rbd46af4 3 3 }; 4 4 5 void ?{}(WrappedInt &this) {5 void ?{}(WrappedInt * this) { 6 6 printf("constructing int\n"); 7 this .x = 0;7 this->x = 0; 8 8 } 9 9 10 void ?{}(WrappedInt &this, WrappedInt other) {10 void ?{}(WrappedInt * this, WrappedInt other) { 11 11 printf("copy constructing int: %d\n", other.x); 12 this .x = other.x;12 this->x = other.x; 13 13 } 14 14 15 void ?{}(WrappedInt &this, int x) {15 void ?{}(WrappedInt * this, int x) { 16 16 printf("constructing int: %d\n", x); 17 this .x = x;17 this->x = x; 18 18 } 19 19 20 void ^?{}(WrappedInt &this) {21 printf("destructing int: %d\n", this .x);20 void ^?{}(WrappedInt * this) { 21 printf("destructing int: %d\n", this->x); 22 22 } 23 23 24 void ?=?(WrappedInt &this, int x) {25 printf("assigning int: %d %d\n", this .x, x);26 this .x = x;24 void ?=?(WrappedInt * this, int x) { 25 printf("assigning int: %d %d\n", this->x, x); 26 this->x = x; 27 27 } 28 28 … … 31 31 }; 32 32 33 void ?{}(A &a) {33 void ?{}(A * a) { 34 34 // currently must define default ctor, since there's no "= default" syntax 35 35 } 36 36 37 void ?{}(A &a, int x) {37 void ?{}(A * a, int x) { 38 38 printf("begin construct A\n"); 39 printf("construct a .x\n");40 ( a.x){ x+999 };41 printf("assign a .y\n");42 a .y = 0; // not a constructor - default constructor will be inserted39 printf("construct a->x\n"); 40 (&a->x){ x+999 }; 41 printf("assign a->y\n"); 42 a->y = 0; // not a constructor - default constructor will be inserted 43 43 printf("end construct A\n"); 44 44 } // z never constructed - will be automatically default constructed 45 45 46 void ?{}(A &this, A other) {46 void ?{}(A * this, A other) { 47 47 printf("begin copy construct A\n"); 48 printf("copy construct this .x\n");49 ( this.x){ other.x };50 printf("assign this .y\n");51 this .y = other.y; // not a constructor - copy constructor will be inserted48 printf("copy construct this->x\n"); 49 (&this->x){ other.x }; 50 printf("assign this->y\n"); 51 this->y = other.y; // not a constructor - copy constructor will be inserted 52 52 printf("end copy construct A\n"); 53 53 } // z never constructed - will be automatically copy constructed 54 54 55 A ?=?(A &this, A other) {55 A ?=?(A * this, A other) { 56 56 printf("begin ?=? A\n"); 57 this .x = other.x;58 this .y = other.y;59 this .z = other.z;57 this->x = other.x; 58 this->y = other.y; 59 this->z = other.z; 60 60 printf("end ?=? A\n"); 61 return this;61 return *this; 62 62 } 63 63 … … 66 66 }; 67 67 68 void ?{}(B &b) {68 void ?{}(B * b) { 69 69 printf("begin construct B\n"); 70 printf("assign b .a2\n");71 b .a2 = (A) { 2 };72 printf("construct b .a1\n");73 ( b.a1){ 1 };70 printf("assign b->a2\n"); 71 b->a2 = (A) { 2 }; 72 printf("construct b->a1\n"); 73 (&b->a1){ 1 }; 74 74 #ifdef ERR1 75 ( b.a2){ b.a3 }; // error, b->a2 was used previously but is explicitly constructed75 (&b->a2){ b->a3 }; // error, b->a2 was used previously but is explicitly constructed 76 76 #endif 77 77 printf("end construct B\n"); 78 78 } // a2, a3 never constructed - will be automatically default constructed 79 79 80 void ^?{}(B &b) {81 b .a2 = (A) { 0 };82 ^( b.a1){};80 void ^?{}(B * b) { 81 b->a2 = (A) { 0 }; 82 ^(&b->a1){}; 83 83 } // a2, a3 never destructed - will be automatically destructed 84 84 -
src/tests/monitor.c
r8217e8f rbd46af4 8 8 }; 9 9 10 void ?{}(global_t &this) {11 this .value = 0;10 void ?{}(global_t * this) { 11 this->value = 0; 12 12 } 13 13 14 14 static global_t global; 15 15 16 void increment3( global_t &mutex this ) {17 this .value += 1;16 void increment3( global_t * mutex this ) { 17 this->value += 1; 18 18 } 19 19 20 void increment2( global_t &mutex this ) {20 void increment2( global_t * mutex this ) { 21 21 increment3( this ); 22 22 } 23 23 24 void increment( global_t &mutex this ) {24 void increment( global_t * mutex this ) { 25 25 increment2( this ); 26 26 } … … 28 28 thread MyThread {}; 29 29 30 void main( MyThread &this ) {30 void main( MyThread* this ) { 31 31 for(int i = 0; i < 1_000_000; i++) { 32 increment( global );32 increment( &global ); 33 33 } 34 34 } -
src/tests/multi-monitor.c
r8217e8f rbd46af4 10 10 static monitor_t m1, m2, m3; 11 11 12 void increment( monitor_t & mutex p1, monitor_t & mutex p2, int &value ) {13 value += 1;12 void increment( monitor_t * mutex p1, monitor_t * mutex p2, int * value ) { 13 *value += 1; 14 14 } 15 15 16 thread MyThread { 16 struct MyThread { 17 thread_desc __thrd; 17 18 int target; 18 19 }; 19 20 20 void ?{}( MyThread & this, int target ) { 21 this.target = target; 21 DECL_THREAD(MyThread); 22 23 void ?{}( MyThread * this, int target ) { 24 this->target = target; 22 25 } 23 26 24 void ^?{}( MyThread &mutex this ) {}27 void ^?{}( MyThread * mutex this ) {} 25 28 26 void main( MyThread &this ) {29 void main( MyThread* this ) { 27 30 for(int i = 0; i < 1000000; i++) { 28 choose(this .target) {29 case 0: increment( m1, m2,global12 );30 case 1: increment( m2, m3,global23 );31 case 2: increment( m1, m3,global13 );31 choose(this->target) { 32 case 0: increment( &m1, &m2, &global12 ); 33 case 1: increment( &m2, &m3, &global23 ); 34 case 2: increment( &m1, &m3, &global13 ); 32 35 } 33 36 } 34 }35 36 forall(dtype T | sized(T) | { void ^?{}(T & mutex); })37 void delete_mutex(T * x) {38 ^(*x){};39 free(x);40 37 } 41 38 … … 43 40 processor p; 44 41 { 45 MyThread* f[6];42 scoped(MyThread) * f[6]; 46 43 for(int i = 0; i < 6; i++) { 47 f[i] = new(i % 3);44 f[i] = ((scoped(MyThread) *)malloc()){ i % 3 }; 48 45 } 49 46 50 47 for(int i = 0; i < 6; i++) { 51 delete _mutex( f[i] );48 delete( f[i] ); 52 49 } 53 50 } -
src/tests/multiDimension.c
r8217e8f rbd46af4 4 4 }; 5 5 6 void ?{}(X &this) {6 void ?{}(X * this) { 7 7 printf("default constructing\n"); 8 ( this.a){ 123 };9 this .ptr = malloc(sizeof(int));8 (&this->a){ 123 }; 9 this->ptr = malloc(sizeof(int)); 10 10 } 11 11 12 void ?{}(X &this, X other) {12 void ?{}(X * this, X other) { 13 13 printf("copy constructing\n"); 14 ( this.a){ other.a };15 this .ptr = malloc(sizeof(int));14 (&this->a){ other.a }; 15 this->ptr = malloc(sizeof(int)); 16 16 } 17 17 18 void ?{}(X &this, int a) {18 void ?{}(X * this, int a) { 19 19 printf("constructing with %d\n", a); 20 ( this.a){ a };21 this .ptr = malloc(sizeof(int));20 (&this->a){ a }; 21 this->ptr = malloc(sizeof(int)); 22 22 } 23 23 24 void ^?{}(X &this) {24 void ^?{}(X * this) { 25 25 printf("destructing\n"); 26 free(this .ptr);26 free(this->ptr); 27 27 } 28 28 29 X ?=?(X &this, X other) {30 this .a = other.a;31 return this;29 X ?=?(X * this, X other) { 30 this->a = other.a; 31 return *this; 32 32 } 33 33 -
src/tests/operators.c
r8217e8f rbd46af4 11 11 } 12 12 13 int ?=?( int &a, int b ) {13 int ?=?( int *a, int b ) { 14 14 return 0; 15 15 } -
src/tests/preempt.c
r8217e8f rbd46af4 16 16 }; 17 17 18 void ?{}( worker_t &this, int value ) {19 this .value = value;18 void ?{}( worker_t * this, int value ) { 19 this->value = value; 20 20 } 21 21 22 void main(worker_t &this) {22 void main(worker_t * this) { 23 23 while(counter < 1000) { 24 if( (counter % 7) == this .value ) {24 if( (counter % 7) == this->value ) { 25 25 int next = __atomic_add_fetch_4(&counter, 1, __ATOMIC_SEQ_CST); 26 26 if( (next % 100) == 0 ) printf("%d\n", next); -
src/tests/rational.c
r8217e8f rbd46af4 1 // 1 // 2 2 // Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo 3 3 // 4 4 // The contents of this file are covered under the licence agreement in the 5 5 // file "LICENCE" distributed with Cforall. 6 // 6 // 7 7 // rational.c -- test rational number package 8 // 8 // 9 9 // Author : Peter A. Buhr 10 10 // Created On : Mon Mar 28 08:43:12 2016 … … 12 12 // Last Modified On : Wed May 17 15:46:35 2017 13 13 // Update Count : 65 14 // 14 // 15 15 16 16 #include <rational> … … 20 20 21 21 // UNNECESSARY, FIX ME 22 void ?{}( int & this ) {this = 0; }23 void ?{}( int & this, zero_t ) {this = 0; }24 void ?{}( int & this, one_t ) {this = 1; }22 void ?{}( int * this ) { *this = 0; } 23 void ?{}( int * this, zero_t ) { *this = 0; } 24 void ?{}( int * this, one_t ) { *this = 1; } 25 25 double convert( int i ) { return (double)i; } 26 26 int convert( double d ) { return (int)d; } -
src/tests/sched-int-barge.c
r8217e8f rbd46af4 28 28 }; 29 29 30 void ?{} ( global_data_t &this ) {31 this .done = false;32 this .counter = 0;33 this .state = BARGE;30 void ?{} ( global_data_t * this ) { 31 this->done = false; 32 this->counter = 0; 33 this->state = BARGE; 34 34 35 this .do_signal = 6;36 this .do_wait1 = 1;37 this .do_wait2 = 3;35 this->do_signal = 6; 36 this->do_wait1 = 1; 37 this->do_wait2 = 3; 38 38 } 39 39 40 void ^?{} ( global_data_t &this ) {}40 void ^?{} ( global_data_t * this ) {} 41 41 42 42 global_t globalA; … … 48 48 thread Threads {}; 49 49 50 bool logicC( global_t & mutex a, global_t & mutex b, global_data_t &mutex c ) {51 c .counter++;50 bool logicC( global_t * mutex a, global_t * mutex b, global_data_t * mutex c ) { 51 c->counter++; 52 52 53 if( (c .counter % 1000) == 0 ) sout | c.counter | endl;53 if( (c->counter % 1000) == 0 ) sout | c->counter | endl; 54 54 55 int action = c .counter % 10;55 int action = c->counter % 10; 56 56 57 57 if( action == 0 ) { 58 c .do_signal = max( ((unsigned)rand48()) % 10, 1);59 c .do_wait1 = ((unsigned)rand48()) % (c.do_signal);60 c .do_wait2 = ((unsigned)rand48()) % (c.do_signal);58 c->do_signal = max( ((unsigned)rand48()) % 10, 1); 59 c->do_wait1 = ((unsigned)rand48()) % (c->do_signal); 60 c->do_wait2 = ((unsigned)rand48()) % (c->do_signal); 61 61 62 if(c .do_wait1 == c.do_wait2) sout | "Same" | endl;62 if(c->do_wait1 == c->do_wait2) sout | "Same" | endl; 63 63 } 64 64 65 if( action == c .do_wait1 || action == c.do_wait2 ) {66 c .state = WAIT;65 if( action == c->do_wait1 || action == c->do_wait2 ) { 66 c->state = WAIT; 67 67 wait( &cond ); 68 68 69 if(c .state != SIGNAL) {70 sout | "ERROR Barging detected" | c .counter | endl;69 if(c->state != SIGNAL) { 70 sout | "ERROR Barging detected" | c->counter | endl; 71 71 abort(); 72 72 } 73 73 } 74 else if( action == c .do_signal ) {75 c .state = SIGNAL;74 else if( action == c->do_signal ) { 75 c->state = SIGNAL; 76 76 77 77 signal( &cond ); … … 79 79 } 80 80 else { 81 c .state = BARGE;81 c->state = BARGE; 82 82 } 83 83 84 if( c .counter >= N ) c.done = true;85 return !c .done;84 if( c->counter >= N ) c->done = true; 85 return !c->done; 86 86 } 87 87 88 bool logicB( global_t & mutex a, global_t &mutex b ) {89 return logicC(a, b, globalC);88 bool logicB( global_t * mutex a, global_t * mutex b ) { 89 return logicC(a, b, &globalC); 90 90 } 91 91 92 bool logicA( global_t &mutex a ) {93 return logicB(a, globalB);92 bool logicA( global_t * mutex a ) { 93 return logicB(a, &globalB); 94 94 } 95 95 96 void main( Threads &this ) {97 while( logicA( globalA) ) { yield(); };96 void main( Threads* this ) { 97 while( logicA(&globalA) ) { yield(); }; 98 98 } 99 99 … … 101 101 102 102 int main(int argc, char* argv[]) { 103 rand48seed(0);104 processor p;105 {106 Threads t[17];107 the_threads = (thread_desc*)t;108 }103 rand48seed(0); 104 processor p; 105 { 106 Threads t[17]; 107 the_threads = (thread_desc*)t; 108 } 109 109 } -
src/tests/sched-int-block.c
r8217e8f rbd46af4 24 24 }; 25 25 26 void ?{} ( global_data_t &this ) {27 this .last_thread = NULL;28 this .last_signaller = NULL;26 void ?{} ( global_data_t * this ) { 27 this->last_thread = NULL; 28 this->last_signaller = NULL; 29 29 } 30 30 31 void ^?{} ( global_data_t &this ) {}31 void ^?{} ( global_data_t * this ) {} 32 32 33 33 global_data_t globalA, globalB; … … 38 38 39 39 //------------------------------------------------------------------------------ 40 void wait_op( global_data_t & mutex a, global_data_t &mutex b, unsigned i ) {40 void wait_op( global_data_t * mutex a, global_data_t * mutex b, unsigned i ) { 41 41 wait( &cond, (uintptr_t)this_thread ); 42 42 43 43 yield( ((unsigned)rand48()) % 10 ); 44 44 45 if(a .last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {46 sout | "ERROR Barging detected, expected" | a .last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread | endl;45 if(a->last_thread != a->last_signaller || b->last_thread != b->last_signaller ) { 46 sout | "ERROR Barging detected, expected" | a->last_signaller | b->last_signaller | "got" | a->last_thread | b->last_thread | endl; 47 47 abort(); 48 48 } 49 49 50 a .last_thread = b.last_thread = this_thread;50 a->last_thread = b->last_thread = this_thread; 51 51 52 52 yield( ((unsigned)rand48()) % 10 ); … … 54 54 55 55 thread Waiter {}; 56 void main( Waiter &this ) {56 void main( Waiter* this ) { 57 57 for( int i = 0; i < N; i++ ) { 58 wait_op( globalA,globalB, i );58 wait_op( &globalA, &globalB, i ); 59 59 } 60 60 } 61 61 62 62 //------------------------------------------------------------------------------ 63 void signal_op( global_data_t & mutex a, global_data_t &mutex b ) {63 void signal_op( global_data_t * mutex a, global_data_t * mutex b ) { 64 64 yield( ((unsigned)rand48()) % 10 ); 65 65 66 [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller]= this_thread;66 a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread; 67 67 68 68 if( !is_empty( &cond ) ) { … … 77 77 yield( ((unsigned)rand48()) % 10 ); 78 78 79 if(a .last_thread != next || b.last_thread != next) {80 sout | "ERROR Barging detected, expected" | next | "got" | a .last_thread | b.last_thread | endl;79 if(a->last_thread != next || b->last_thread != next) { 80 sout | "ERROR Barging detected, expected" | next | "got" | a->last_thread | b->last_thread | endl; 81 81 abort(); 82 82 } … … 86 86 87 87 thread Signaller {}; 88 void main( Signaller &this ) {88 void main( Signaller* this ) { 89 89 while( !done ) { 90 signal_op( globalA,globalB );90 signal_op( &globalA, &globalB ); 91 91 } 92 92 } 93 93 94 94 //------------------------------------------------------------------------------ 95 void barge_op( global_data_t &mutex a ) {96 a .last_thread = this_thread;95 void barge_op( global_data_t * mutex a ) { 96 a->last_thread = this_thread; 97 97 } 98 98 99 99 thread Barger {}; 100 void main( Barger &this ) {100 void main( Barger* this ) { 101 101 for( unsigned i = 0; !done; i++ ) { 102 102 //Choose some monitor to barge into with some irregular pattern 103 103 bool choose_a = (i % 13) > (i % 17); 104 if ( choose_a ) barge_op( globalA ); 105 else barge_op( globalB ); 104 barge_op( choose_a ? &globalA : &globalB ); 106 105 } 107 106 } -
src/tests/sched-int-disjoint.c
r8217e8f rbd46af4 20 20 21 21 monitor global_data_t; 22 void ?{}( global_data_t &this );23 void ^?{} ( global_data_t &this );22 void ?{}( global_data_t * this ); 23 void ^?{} ( global_data_t * this ); 24 24 25 25 monitor global_data_t { … … 32 32 volatile bool all_done; 33 33 34 void ?{}( global_data_t &this ) {35 this .counter == 0;36 this .state = BARGE;34 void ?{}( global_data_t * this ) { 35 this->counter == 0; 36 this->state = BARGE; 37 37 } 38 38 39 void ^?{} ( global_data_t &this ) {}39 void ^?{} ( global_data_t * this ) {} 40 40 41 41 //------------------------------------------------------------------------------ 42 42 // Barging logic 43 void barge( global_data_t &mutex d ) {44 d .state = BARGE;43 void barge( global_data_t * mutex d ) { 44 d->state = BARGE; 45 45 } 46 46 47 47 thread Barger {}; 48 48 49 void main( Barger &this ) {49 void main( Barger * this ) { 50 50 while( !all_done ) { 51 barge( data );51 barge( &data ); 52 52 yield(); 53 53 } … … 56 56 //------------------------------------------------------------------------------ 57 57 // Waiting logic 58 bool wait( global_t & mutex m, global_data_t &mutex d ) {58 bool wait( global_t * mutex m, global_data_t * mutex d ) { 59 59 wait( &cond ); 60 if( d .state != SIGNAL ) {60 if( d->state != SIGNAL ) { 61 61 sout | "ERROR barging!" | endl; 62 62 } 63 63 64 d .counter++;64 d->counter++; 65 65 66 if( (d .counter % 1000) == 0 ) sout | d.counter | endl;66 if( (d->counter % 1000) == 0 ) sout | d->counter | endl; 67 67 68 return d .counter < N;68 return d->counter < N; 69 69 } 70 70 71 71 thread Waiter {}; 72 72 73 void main( Waiter &this ) {74 while( wait( mut,data ) ) { yield(); }73 void main( Waiter * this ) { 74 while( wait( &mut, &data ) ) { yield(); } 75 75 } 76 76 … … 78 78 //------------------------------------------------------------------------------ 79 79 // Signalling logic 80 void signal( condition * cond, global_t & mutex a, global_data_t &mutex b ) {81 b .state = SIGNAL;80 void signal( condition * cond, global_t * mutex a, global_data_t * mutex b ) { 81 b->state = SIGNAL; 82 82 signal( cond ); 83 83 } 84 84 85 void logic( global_t &mutex a ) {86 signal( &cond, a, data );85 void logic( global_t * mutex a ) { 86 signal( &cond, a, &data ); 87 87 88 88 yield( (unsigned)rand48() % 10 ); … … 97 97 thread Signaller {}; 98 98 99 void main( Signaller &this ) {99 void main( Signaller * this ) { 100 100 while( !all_done ) { 101 logic( mut );101 logic( &mut ); 102 102 yield(); 103 103 } -
src/tests/sched-int-wait.c
r8217e8f rbd46af4 33 33 //---------------------------------------------------------------------------------------------------- 34 34 // Tools 35 void signal( condition * cond, global_t & mutex a, global_t &mutex b ) {35 void signal( condition * cond, global_t * mutex a, global_t * mutex b ) { 36 36 signal( cond ); 37 37 } 38 38 39 void signal( condition * cond, global_t & mutex a, global_t & mutex b, global_t &mutex c ) {39 void signal( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) { 40 40 signal( cond ); 41 41 } 42 42 43 void wait( condition * cond, global_t & mutex a, global_t &mutex b ) {43 void wait( condition * cond, global_t * mutex a, global_t * mutex b ) { 44 44 wait( cond ); 45 45 } 46 46 47 void wait( condition * cond, global_t & mutex a, global_t & mutex b, global_t &mutex c ) {47 void wait( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) { 48 48 wait( cond ); 49 49 } … … 51 51 //---------------------------------------------------------------------------------------------------- 52 52 // Signaler 53 void main( Signaler &this ) {53 void main( Signaler* this ) { 54 54 55 55 while( waiter_left != 0 ) { … … 57 57 switch( action ) { 58 58 case 0: 59 signal( &condABC, globalA, globalB,globalC );59 signal( &condABC, &globalA, &globalB, &globalC ); 60 60 break; 61 61 case 1: 62 signal( &condAB , globalA,globalB );62 signal( &condAB , &globalA, &globalB ); 63 63 break; 64 64 case 2: 65 signal( &condBC , globalB,globalC );65 signal( &condBC , &globalB, &globalC ); 66 66 break; 67 67 case 3: 68 signal( &condAC , globalA,globalC );68 signal( &condAC , &globalA, &globalC ); 69 69 break; 70 70 default: … … 78 78 //---------------------------------------------------------------------------------------------------- 79 79 // Waiter ABC 80 void main( WaiterABC &this ) {80 void main( WaiterABC* this ) { 81 81 for( int i = 0; i < N; i++ ) { 82 wait( &condABC, globalA, globalB,globalC );82 wait( &condABC, &globalA, &globalB, &globalC ); 83 83 } 84 84 … … 88 88 //---------------------------------------------------------------------------------------------------- 89 89 // Waiter AB 90 void main( WaiterAB &this ) {90 void main( WaiterAB* this ) { 91 91 for( int i = 0; i < N; i++ ) { 92 wait( &condAB , globalA,globalB );92 wait( &condAB , &globalA, &globalB ); 93 93 } 94 94 … … 98 98 //---------------------------------------------------------------------------------------------------- 99 99 // Waiter AC 100 void main( WaiterAC &this ) {100 void main( WaiterAC* this ) { 101 101 for( int i = 0; i < N; i++ ) { 102 wait( &condAC , globalA,globalC );102 wait( &condAC , &globalA, &globalC ); 103 103 } 104 104 … … 108 108 //---------------------------------------------------------------------------------------------------- 109 109 // Waiter BC 110 void main( WaiterBC &this ) {110 void main( WaiterBC* this ) { 111 111 for( int i = 0; i < N; i++ ) { 112 wait( &condBC , globalB,globalC );112 wait( &condBC , &globalB, &globalC ); 113 113 } 114 114 -
src/tests/test.py
r8217e8f rbd46af4 31 31 # parses the Makefile to find the machine type (32-bit / 64-bit) 32 32 def getMachineType(): 33 sh('echo "void ?{}(int &a,int b){}int main(){return 0;}" > .dummy.c')33 sh('echo "void ?{}(int*a,int b){}int main(){return 0;}" > .dummy.c') 34 34 ret, out = sh("make .dummy -s", print2stdout=True) 35 35 -
src/tests/thread.c
r8217e8f rbd46af4 7 7 thread Second { semaphore* lock; }; 8 8 9 void ?{}( First & this, semaphore & lock ) { this.lock = &lock; }10 void ?{}( Second & this, semaphore & lock ) { this.lock = &lock; }9 void ?{}( First * this, semaphore* lock ) { this->lock = lock; } 10 void ?{}( Second * this, semaphore* lock ) { this->lock = lock; } 11 11 12 void main(First &this) {12 void main(First* this) { 13 13 for(int i = 0; i < 10; i++) { 14 14 sout | "First : Suspend No." | i + 1 | endl; 15 15 yield(); 16 16 } 17 V(this .lock);17 V(this->lock); 18 18 } 19 19 20 void main(Second &this) {21 P(this .lock);20 void main(Second* this) { 21 P(this->lock); 22 22 for(int i = 0; i < 10; i++) { 23 23 sout | "Second : Suspend No." | i + 1 | endl; … … 33 33 processor p; 34 34 { 35 First f = { lock };36 Second s = { lock };35 First f = { &lock }; 36 Second s = { &lock }; 37 37 } 38 38 } -
src/tests/tupleAssign.c
r8217e8f rbd46af4 48 48 int z; 49 49 } x; 50 X ?=?(X &x, double d) {}50 X ?=?(X * x, double d) {} 51 51 [int, double, int] t; 52 52 -
src/tests/tupleMember.c
r8217e8f rbd46af4 34 34 } v; 35 35 36 V &h() {36 lvalue V h() { 37 37 static V local = { 111, { 222, 333 }, 444.5 }; 38 38 return local; -
src/tests/tupleVariadic.c
r8217e8f rbd46af4 29 29 } 30 30 31 forall( dtype T, ttype Params | sized(T) | { void ?{}(T &, Params); } )31 forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } ) 32 32 T * new(Params p); 33 33 … … 38 38 39 39 // xxx - eventually this will be collapsed...x 40 void ?{}(array &a) {41 a .size = 0;42 a .data = 0;40 void ?{}(array * a) { 41 a->size = 0; 42 a->data = 0; 43 43 printf("called ?{} with no a\n"); 44 44 } 45 45 46 void ?{}(array &a, int a0) {47 a .size = 1;48 a .data = (int*)malloc(sizeof(int)*a.size);49 a .data[0] = a0;46 void ?{}(array * a, int a0) { 47 a->size = 1; 48 a->data = (int*)malloc(sizeof(int)*a->size); 49 a->data[0] = a0; 50 50 printf("called ?{} with a: %d\n", a0); 51 51 } 52 52 53 void ?{}(array &a, int a0, int a1) {54 a .size = 2;55 a .data = (int*)malloc(sizeof(int)*a.size);56 a .data[0] = a0;57 a .data[1] = a1;53 void ?{}(array * a, int a0, int a1) { 54 a->size = 2; 55 a->data = (int*)malloc(sizeof(int)*a->size); 56 a->data[0] = a0; 57 a->data[1] = a1; 58 58 printf("called ?{} with a: %d %d\n", a0, a1); 59 59 } 60 60 61 void ?{}(array &a, int a0, int a1, int a2) {62 a .size = 3;63 a .data = (int*)malloc(sizeof(int)*a.size);64 a .data[0] = a0;65 a .data[1] = a1;66 a .data[2] = a2;61 void ?{}(array * a, int a0, int a1, int a2) { 62 a->size = 3; 63 a->data = (int*)malloc(sizeof(int)*a->size); 64 a->data[0] = a0; 65 a->data[1] = a1; 66 a->data[2] = a2; 67 67 printf("called ?{} with a: %d %d %d\n", a0, a1, a2); 68 68 } 69 69 70 70 // test use of a tuple argument 71 [void] ?{}(array &a, [int, int, int, int] args) {71 [void] ?{}(array * a, [int, int, int, int] args) { 72 72 int a0, a1, a2, a3; 73 73 [a0, a1, a2, a3] = args; 74 a .size = 4;75 a .data = malloc(sizeof(int)*a.size);76 a .data[0] = a0;77 a .data[1] = a1;78 a .data[2] = a2;79 a .data[3] = a3;74 a->size = 4; 75 a->data = malloc(sizeof(int)*a->size); 76 a->data[0] = a0; 77 a->data[1] = a1; 78 a->data[2] = a2; 79 a->data[3] = a3; 80 80 printf("called ?{} with a: %d %d %d %d\n", a0, a1, a2, a3); 81 81 } -
src/tests/vector/array.h
r8217e8f rbd46af4 21 21 // element has index 0. 22 22 trait array( otype array_type, otype elt_type ) { 23 elt_type &?[?]( array_type, int );23 lvalue elt_type ?[?]( array_type, int ); 24 24 }; 25 25 -
src/tests/vector/vector_int.c
r8217e8f rbd46af4 20 20 #define DEFAULT_CAPACITY 20 21 21 22 void ?{}( vector_int &vec ) {22 void ?{}( vector_int * vec ) { 23 23 vec { DEFAULT_CAPACITY }; 24 24 } 25 25 26 void ?{}( vector_int &vec, int reserve ) {27 vec .last = -1;28 vec .capacity = reserve;29 vec .data = malloc( sizeof( int ) * reserve );26 void ?{}( vector_int * vec, int reserve ) { 27 vec->last = -1; 28 vec->capacity = reserve; 29 vec->data = malloc( sizeof( int ) * reserve ); 30 30 } 31 31 32 void ?{}( vector_int &vec, vector_int other ) {33 vec .last = other.last;34 vec .capacity = other.capacity;35 vec .data = malloc( sizeof( int ) * other.capacity );36 for (int i = 0; i < vec .last; i++) {37 vec .data[i] = other.data[i];32 void ?{}( vector_int * vec, vector_int other ) { 33 vec->last = other.last; 34 vec->capacity = other.capacity; 35 vec->data = malloc( sizeof( int ) * other.capacity ); 36 for (int i = 0; i < vec->last; i++) { 37 vec->data[i] = other.data[i]; 38 38 } 39 39 } 40 40 41 void ^?{}( vector_int &vec ) {42 free( vec .data );41 void ^?{}( vector_int * vec ) { 42 free( vec->data ); 43 43 } 44 44 … … 61 61 // implement bounded_array 62 62 63 int &?[?]( vector_int * vec, int index ) {63 lvalue int ?[?]( vector_int * vec, int index ) { 64 64 return vec->data[ index ]; 65 65 } -
src/tests/vector/vector_int.h
r8217e8f rbd46af4 24 24 } vector_int; 25 25 26 void ?{}( vector_int &); // allocate vector with default capacity27 void ?{}( vector_int &, int reserve ); // allocate vector with specified capacity28 void ?{}( vector_int & vec, vector_int other );// copy constructor29 void ^?{}( vector_int & );// deallocate vector's storage26 void ?{}( vector_int * ); // allocate vector with default capacity 27 void ?{}( vector_int *, int reserve ); // allocate vector with specified capacity 28 void ?{}( vector_int * vec, vector_int other ); // copy constructor 29 void ^?{}( vector_int * ); // deallocate vector's storage 30 30 31 31 void reserve( vector_int *vec, int reserve ); // reserve more capacity … … 34 34 // implement bounded_array 35 35 36 int & ?[?]( vector_int * vec, int index );// access to arbitrary element (does not resize)37 int last( vector_int * vec ); // return last element36 lvalue int ?[?]( vector_int * vec, int index ); // access to arbitrary element (does not resize) 37 int last( vector_int * vec ); // return last element 38 38 39 39 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.