Changes in / [3d4b23fa:9a1e509]
- Location:
- src
- Files:
-
- 1 added
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r3d4b23fa r9a1e509 336 336 if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) { 337 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 argument348 *arg = addrExpr->get_arg();349 } else {350 // no address-of operator, so must be a pointer - add dereference351 // 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 application353 // 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 } // if361 break;362 }363 364 default:365 // do nothing366 ;367 } // switch368 369 338 switch ( opInfo.type ) { 370 339 case OT_INDEX: -
src/CodeGen/GenType.cc
r3d4b23fa r9a1e509 37 37 virtual void visit( PointerType *pointerType ); 38 38 virtual void visit( ArrayType *arrayType ); 39 virtual void visit( ReferenceType *refType ); 39 40 virtual void visit( StructInstType *structInst ); 40 41 virtual void visit( UnionInstType *unionInst ); … … 147 148 } 148 149 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 149 158 void GenType::visit( FunctionType *funcType ) { 150 159 std::ostringstream os; -
src/Common/PassVisitor.h
r3d4b23fa r9a1e509 113 113 virtual void visit( PointerType *pointerType ) override final; 114 114 virtual void visit( ArrayType *arrayType ) override final; 115 virtual void visit( ReferenceType *referenceType ) override final; 115 116 virtual void visit( FunctionType *functionType ) override final; 116 117 virtual void visit( StructInstType *aggregateUseType ) override final; … … 198 199 virtual Type* mutate( PointerType *pointerType ) override final; 199 200 virtual Type* mutate( ArrayType *arrayType ) override final; 201 virtual Type* mutate( ReferenceType *referenceType ) override final; 200 202 virtual Type* mutate( FunctionType *functionType ) override final; 201 203 virtual Type* mutate( StructInstType *aggregateUseType ) override final; -
src/Common/PassVisitor.impl.h
r3d4b23fa r9a1e509 786 786 787 787 template< typename pass_type > 788 void PassVisitor< pass_type >::visit( ReferenceType * node ) { 789 VISIT_BODY( node ); 790 } 791 792 template< typename pass_type > 788 793 void PassVisitor< pass_type >::visit( FunctionType * node ) { 789 794 VISIT_BODY( node ); … … 1118 1123 1119 1124 template< typename pass_type > 1125 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) { 1126 MUTATE_BODY( Type, node ); 1127 } 1128 1129 template< typename pass_type > 1120 1130 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 1121 1131 MUTATE_BODY( Type, node ); -
src/Concurrency/Keywords.cc
r3d4b23fa r9a1e509 524 524 525 525 DeclarationWithType * param = decl->get_functionType()->get_parameters().front(); 526 auto ptr = dynamic_cast< PointerType * >( param->get_type() ); 527 // if( ptr ) std::cerr << "FRED1" << std::endl; 528 auto type = dynamic_cast< StructInstType * >( ptr->get_base() ); 526 auto type = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) ); 529 527 // if( type ) std::cerr << "FRED2" << std::endl; 530 528 if( type && type->get_baseStruct()->is_thread() ) { -
src/GenPoly/Box.cc
r3d4b23fa r9a1e509 758 758 // if the argument's type is polymorphic, we don't need to box again! 759 759 return; 760 } else if ( arg->get_result()->get_lvalue() ) { 760 } else if ( arg->get_result()->get_lvalue() ) { // xxx - is this still right?? 761 // xxx - dynamic_cast<ReferenceType *>( arg->get_result() )?? 761 762 // VariableExpr and MemberExpr are lvalues; need to check this isn't coming from the second arg of a comma expression though (not an lvalue) 762 763 // xxx - need to test that this code is still reachable … … 1036 1037 assert( appExpr->has_result() ); 1037 1038 assert( ! appExpr->get_args().empty() ); 1038 if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) { 1039 if ( isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) { // dereference returns a reference type 1040 // remove dereference from polymorphic types since they are boxed. 1039 1041 Expression *ret = appExpr->get_args().front(); 1040 1042 delete ret->get_result(); -
src/GenPoly/Lvalue.cc
r3d4b23fa r9a1e509 32 32 #include "Common/UniqueName.h" 33 33 #include "Common/utility.h" 34 #include "InitTweak/InitTweak.h" 35 36 #include "Common/PassVisitor.h" 37 38 // need to be careful about polymorphic references... e.g. in *? (___operator_deref__A0_1_0_0__Fd0_Pd0_intrinsic___1) 39 // the variable is automatically dereferenced and this causes errors dereferencing void*. 34 40 35 41 namespace GenPoly { 36 42 namespace { 37 /// Replace uses of lvalue returns with appropriate pointers 38 class Pass1 : public Mutator { 39 public: 40 Pass1(); 41 42 virtual Expression *mutate( ApplicationExpr *appExpr ); 43 virtual Statement *mutate( ReturnStmt *appExpr ); 44 virtual DeclarationWithType *mutate( FunctionDecl *funDecl ); 45 private: 46 DeclarationWithType* retval; 47 }; 48 49 /// Replace declarations of lvalue returns with appropriate pointers 50 class Pass2 : public Visitor { 51 public: 52 virtual void visit( FunctionType *funType ); 53 private: 43 struct ReferenceConversions final { 44 Expression * postmutate( CastExpr * castExpr ); 45 }; 46 47 /// Intrinsic functions that take reference parameters don't REALLY take reference parameters -- their reference arguments must always be implicitly dereferenced. 48 struct FixIntrinsicArgs final { 49 Expression * postmutate( ApplicationExpr *appExpr ); 50 }; 51 52 53 /// Replace reference types with pointer types 54 struct ReferenceTypeElimination final { 55 Type * postmutate( ReferenceType * refType ); 54 56 }; 55 57 … … 57 59 /// https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Lvalues.html#Lvalues 58 60 /// Replaces &(a,b) with (a, &b), &(a ? b : c) with (a ? &b : &c) 59 class GeneralizedLvalue : public Mutator { 60 typedef Mutator Parent; 61 62 virtual Expression * mutate( AddressExpr * addressExpr ); 61 struct GeneralizedLvalue final { 62 Expression * postmutate( AddressExpr * addressExpr ); 63 63 }; 64 64 } // namespace 65 65 66 66 void convertLvalue( std::list< Declaration* >& translationUnit ) { 67 Pass1 p1; 68 Pass2 p2; 69 GeneralizedLvalue genLval; 70 mutateAll( translationUnit, p1 ); 71 acceptAll( translationUnit, p2 ); 67 std::cerr << "convertLvalue" << std::endl; 68 PassVisitor<ReferenceConversions> refCvt; 69 PassVisitor<ReferenceTypeElimination> elim; 70 PassVisitor<GeneralizedLvalue> genLval; 71 PassVisitor<FixIntrinsicArgs> fixer; 72 mutateAll( translationUnit, refCvt ); 73 mutateAll( translationUnit, fixer ); 74 mutateAll( translationUnit, elim ); 72 75 mutateAll( translationUnit, genLval ); 73 76 } … … 77 80 if ( function->get_returnVals().empty() ) return 0; 78 81 Type *ty = function->get_returnVals().front()->get_type(); 79 return ty->get_lvalue() ? ty : 0;82 return dynamic_cast< ReferenceType * >( ty ) ; 80 83 } 81 84 … … 88 91 } 89 92 90 Pass1::Pass1() { 91 } 92 93 DeclarationWithType * Pass1::mutate( FunctionDecl *funcDecl ) { 94 if ( funcDecl->get_statements() ) { 95 DeclarationWithType* oldRetval = retval; 96 retval = 0; 97 if ( ! LinkageSpec::isBuiltin( funcDecl->get_linkage() ) && isLvalueRet( funcDecl->get_functionType() ) ) { 98 retval = funcDecl->get_functionType()->get_returnVals().front(); 99 } 100 // fix expressions and return statements in this function 101 funcDecl->set_statements( funcDecl->get_statements()->acceptMutator( *this ) ); 102 retval = oldRetval; 103 } // if 104 return funcDecl; 105 } 106 107 Expression * Pass1::mutate( ApplicationExpr *appExpr ) { 108 appExpr->get_function()->acceptMutator( *this ); 109 mutateAll( appExpr->get_args(), *this ); 110 111 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() ); 112 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 113 114 Type *funType = isLvalueRet( function ); 115 if ( funType && ! isIntrinsicApp( appExpr ) ) { 116 Expression *expr = appExpr; 117 Type *appType = appExpr->get_result(); 118 if ( isPolyType( funType ) && ! isPolyType( appType ) ) { 119 // make sure cast for polymorphic type is inside dereference 120 expr = new CastExpr( appExpr, new PointerType( Type::Qualifiers(), appType->clone() ) ); 121 } 122 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) ); 123 deref->set_result( appType->clone() ); 124 appExpr->set_result( new PointerType( Type::Qualifiers(), appType ) ); 125 deref->get_args().push_back( expr ); 93 bool isDeref( Expression * expr ) { 94 if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( expr ) ) { 95 return InitTweak::getFunctionName( untyped ) == "*?"; 96 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) { 97 if ( DeclarationWithType * func = InitTweak::getFunction( appExpr ) ) { 98 return func->get_linkage() == LinkageSpec::Intrinsic && InitTweak::getFunctionName( appExpr ) == "*?"; 99 } 100 } 101 return false; 102 } 103 104 bool isIntrinsicReference( Expression * expr ) { 105 if ( isDeref( expr ) ) return true; 106 else if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( expr ) ) { 107 return InitTweak::getFunctionName( untyped ) == "?[?]"; 108 } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) { 109 if ( DeclarationWithType * func = InitTweak::getFunction( appExpr ) ) { 110 return func->get_linkage() == LinkageSpec::Intrinsic && InitTweak::getFunctionName( appExpr ) == "?[?]"; 111 } 112 } 113 return false; 114 } 115 116 void fixArg( Expression *& arg, Type * formal ) { 117 // if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( arg ) ) { 118 if ( dynamic_cast<ReferenceType*>( formal ) ) { // xxx - but might be deref, in which case result isn't REALLY a reference, at least not in the sense that we need to add another deref... 119 // doesn't work, for some reason left arg is skipped in assign 120 ReferenceType * refType = safe_dynamic_cast< ReferenceType * >( arg->get_result() ) ; 121 std::cerr << "appexpr arg is non-deref/index intrinsic call" << std::endl; 122 std::cerr << arg << std::endl; 123 PointerType * ptrType = new PointerType( Type::Qualifiers(), refType->get_base()->clone() ); 124 delete refType; 125 arg->set_result( ptrType ); 126 arg = UntypedExpr::createDeref( arg ); 127 } 128 129 // } 130 } 131 132 Expression * FixIntrinsicArgs::postmutate( ApplicationExpr * appExpr ) { 133 if ( DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) { 134 if ( function->get_linkage() == LinkageSpec::Intrinsic ) { // intrinsic functions that turn pointers into references 135 FunctionType * ftype = GenPoly::getFunctionType( function->get_type() ); 136 assertf( ftype, "Function declaration does not have function type." ); 137 for ( auto p : group_iterate( appExpr->get_args(), ftype->get_parameters() ) ) { 138 Expression *& arg = std::get<0>( p ); 139 DeclarationWithType * formal = std::get<1>( p ); 140 std::cerr << "pair<0>: " << arg << std::endl; 141 std::cerr << "pair<1>: " << formal->get_type() << std::endl; 142 if ( isIntrinsicReference( arg ) ) { 143 std::cerr << "skipping intrinsic reference" << std::endl; 144 continue; 145 } else { 146 fixArg( arg, formal->get_type() ); 147 } 148 } 149 } 150 } 151 return appExpr; 152 } 153 154 Expression * ReferenceConversions::postmutate( CastExpr * castExpr ) { 155 // conversion to reference type 156 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_result() ) ) { 157 (void)refType; 158 if ( ReferenceType * otherRef = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 159 // nothing to do if casting from reference to reference. 160 (void)otherRef; 161 std::cerr << "convert reference to reference -- nop" << std::endl; 162 if ( isIntrinsicReference( castExpr->get_arg() ) ) { 163 Expression * callExpr = castExpr->get_arg(); 164 Expression ** arg = nullptr; 165 Expression *& arg0 = InitTweak::getCallArg( callExpr, 0 ); 166 if ( dynamic_cast<PointerType *>( arg0->get_result() ) ) { 167 arg = &arg0; 168 } else { 169 arg = &InitTweak::getCallArg( callExpr, 1 ); 170 } 171 172 castExpr->set_arg( *arg ); 173 *arg = castExpr; 174 std::cerr << "but arg is deref -- &" << std::endl; 175 std::cerr << callExpr << std::endl; 176 // castExpr->set_arg( new AddressExpr( castExpr->get_arg() ) ); 177 178 // move environment out to new top-level 179 callExpr->set_env( castExpr->get_env() ); 180 castExpr->set_env( nullptr ); 181 return callExpr; 182 } 183 std::cerr << castExpr << std::endl; 184 return castExpr; 185 } else if ( castExpr->get_arg()->get_result()->get_lvalue() ) { 186 // conversion from lvalue to reference 187 // xxx - keep cast, but turn into pointer cast?? 188 // xxx - memory 189 std::cerr << "convert lvalue to reference -- &" << std::endl; 190 std::cerr << castExpr->get_arg() << std::endl; 191 castExpr->set_arg( new AddressExpr( castExpr->get_arg() ) ); 192 // return new AddressExpr( castExpr->get_arg() ); 193 return castExpr; 194 } else { 195 // rvalue to reference conversion -- introduce temporary 196 } 197 assertf( false, "Only conversions to reference from lvalue are currently supported: %s", toString( castExpr ).c_str() ); 198 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) { 199 // should be easy, just need to move deref code up here? 200 std::cerr << "convert reference to rvalue -- *" << std::endl; 201 if ( isIntrinsicReference( castExpr->get_arg() ) ) { 202 std::cerr << "but arg is intrinsic reference -- nop" << std::endl; 203 return castExpr; 204 } 205 std::cerr << castExpr << std::endl; 206 207 PointerType * ptrType = new PointerType( refType->get_qualifiers(), refType->get_base()->clone() ); 208 delete castExpr->get_result(); 209 castExpr->set_result( ptrType ); 210 Expression * deref = UntypedExpr::createDeref( castExpr ); 211 deref->set_env( castExpr->get_env() ); 212 castExpr->set_env( nullptr ); 126 213 return deref; 127 } else { 128 return appExpr; 129 } // if 130 } 131 132 Statement * Pass1::mutate(ReturnStmt *retStmt) { 133 if ( retval && retStmt->get_expr() ) { 134 if ( retStmt->get_expr()->get_result()->get_lvalue() ) { 135 // ***** Code Removal ***** because casts may be stripped already 136 137 // strip casts because not allowed to take address of cast 138 // while ( CastExpr *castExpr = dynamic_cast< CastExpr* >( retStmt->get_expr() ) ) { 139 // retStmt->set_expr( castExpr->get_arg() ); 140 // retStmt->get_expr()->set_env( castExpr->get_env() ); 141 // castExpr->set_env( 0 ); 142 // castExpr->set_arg( 0 ); 143 // delete castExpr; 144 // } // while 145 retStmt->set_expr( new AddressExpr( retStmt->get_expr()->acceptMutator( *this ) ) ); 146 } else { 147 throw SemanticError( "Attempt to return non-lvalue from an lvalue-qualified function" ); 148 } // if 149 } // if 150 return retStmt; 151 } 152 153 void Pass2::visit( FunctionType *funType ) { 154 std::string typeName; 155 if ( isLvalueRet( funType ) ) { 156 DeclarationWithType *retParm = funType->get_returnVals().front(); 157 158 // make a new parameter that is a pointer to the type of the old return value 159 retParm->set_type( new PointerType( Type::Qualifiers(), retParm->get_type() ) ); 160 } // if 161 162 Visitor::visit( funType ); 163 } 164 165 Expression * GeneralizedLvalue::mutate( AddressExpr * addrExpr ) { 166 addrExpr = safe_dynamic_cast< AddressExpr * >( Parent::mutate( addrExpr ) ); 214 // assertf( false, "Conversions from reference types are not currently supported." ); 215 } 216 return castExpr; 217 } 218 219 Type * ReferenceTypeElimination::postmutate( ReferenceType * refType ) { 220 Type * base = refType->get_base(); 221 refType->set_base( nullptr ); 222 delete refType; 223 return new PointerType( Type::Qualifiers(), base ); 224 } 225 226 Expression * GeneralizedLvalue::postmutate( AddressExpr * addrExpr ) { 167 227 if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( addrExpr->get_arg() ) ) { 168 228 Expression * arg1 = commaExpr->get_arg1()->clone(); -
src/InitTweak/FixInit.cc
r3d4b23fa r9a1e509 364 364 assert( ftype ); 365 365 if ( isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) { 366 Type * t1 = ftype->get_parameters().front()->get_type();366 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 367 367 Type * t2 = ftype->get_parameters().back()->get_type(); 368 PointerType * ptrType = safe_dynamic_cast< PointerType * >( t1 );369 370 if ( ResolvExpr::typesCompatible( ptrType->get_base(), t2, SymTab::Indexer() ) ) {368 assert( t1 ); 369 370 if ( ResolvExpr::typesCompatible( t1, t2, SymTab::Indexer() ) ) { 371 371 // optimization: don't need to copy construct in order to call a copy constructor 372 372 return appExpr; … … 401 401 402 402 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { 403 return dynamic_cast< VarArgsType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type );403 return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( 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 ( ! result->get_lvalue() ) {491 if ( ! dynamic_cast< ReferenceType * >( result ) ) { 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 ); … … 997 997 assert( ! type->get_parameters().empty() ); 998 998 thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() ); 999 PointerType * ptrType = safe_dynamic_cast< PointerType * >( thisParam->get_type() );1000 StructInstType * structType = dynamic_cast< StructInstType * >( ptrType->get_base());999 Type * thisType = getPointerBase( thisParam->get_type() ); 1000 StructInstType * structType = dynamic_cast< StructInstType * >( thisType ); 1001 1001 if ( structType ) { 1002 1002 structDecl = structType->get_baseStruct(); … … 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 1050 1048 Expression * arg2 = 0; 1051 1049 if ( isCopyConstructor( function ) ) { … … 1056 1054 } 1057 1055 InitExpander srcParam( arg2 ); 1058 SymTab::genImplicitCall( srcParam, new MemberExpr( field, deref), function->get_name(), back_inserter( stmt ), field, isCtor );1056 SymTab::genImplicitCall( srcParam, new MemberExpr( field, new VariableExpr( thisParam ) ), function->get_name(), back_inserter( stmt ), field, isCtor ); 1059 1057 1060 1058 assert( stmt.size() <= 1 ); -
src/InitTweak/GenInit.cc
r3d4b23fa r9a1e509 54 54 55 55 protected: 56 FunctionType * ftype ;56 FunctionType * ftype = nullptr; 57 57 std::string funcName; 58 58 }; … … 137 137 std::list< DeclarationWithType * > & returnVals = ftype->get_returnVals(); 138 138 assert( returnVals.size() == 0 || returnVals.size() == 1 ); 139 // hands off if the function returns a n lvalue - we don't want to allocate a temporary if a variable's address139 // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address 140 140 // is being returned 141 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! returnVals.front()->get_type()->get_lvalue() ) {141 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type() ) ) { 142 142 // explicitly construct the return value using the return expression and the retVal object 143 143 assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() ); 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)); 144 145 stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) ); 148 146 149 147 // return the retVal object … … 212 210 213 211 bool CtorDtor::isManaged( Type * type ) const { 212 // at least for now, references are never constructed 213 if ( dynamic_cast< ReferenceType * >( type ) ) return false; 214 214 // need to clear and reset qualifiers when determining if a type is managed 215 215 ValueGuard< Type::Qualifiers > qualifiers( type->get_qualifiers() ); … … 238 238 std::list< DeclarationWithType * > & params = GenPoly::getFunctionType( dwt->get_type() )->get_parameters(); 239 239 assert( ! params.empty() ); 240 PointerType * type = safe_dynamic_cast< PointerType * >( params.front()->get_type() ); 241 managedTypes.insert( SymTab::Mangler::mangle( type->get_base() ) ); 240 Type * type = InitTweak::getPointerBase( params.front()->get_type() ); 241 assert( type ); 242 managedTypes.insert( SymTab::Mangler::mangle( type ) ); 242 243 } 243 244 } -
src/InitTweak/InitTweak.cc
r3d4b23fa r9a1e509 380 380 template<typename CallExpr> 381 381 Expression *& callArg( CallExpr * callExpr, unsigned int pos ) { 382 if ( pos >= callExpr->get_args().size() ) assertf( false, " asking for argument that doesn't exist. Return NULL/throw exception?");382 if ( pos >= callExpr->get_args().size() ) assertf( false, "getCallArg for argument that doesn't exist: (%u); %s.", pos, toString( callExpr ).c_str() ); 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(); 460 462 } else { 461 463 return NULL; … … 543 545 if ( ftype->get_parameters().size() != 2 ) return 0; 544 546 545 Type * t1 = ftype->get_parameters().front()->get_type();547 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() ); 546 548 Type * t2 = ftype->get_parameters().back()->get_type(); 547 PointerType * ptrType = dynamic_cast< PointerType * > ( t1 ); 548 assert( ptrType ); 549 550 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( ptrType->get_base(), t2, SymTab::Indexer() ) ) { 549 assert( t1 ); 550 551 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, SymTab::Indexer() ) ) { 551 552 return function; 552 553 } else { -
src/Makefile.in
r3d4b23fa r9a1e509 221 221 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT) \ 222 222 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT) \ 223 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT) \ 223 224 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT) \ 224 225 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT) \ … … 517 518 SynTree/VoidType.cc SynTree/BasicType.cc \ 518 519 SynTree/PointerType.cc SynTree/ArrayType.cc \ 519 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ 520 SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \ 520 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ 521 SynTree/ReferenceToType.cc SynTree/TupleType.cc \ 522 SynTree/TypeofType.cc SynTree/AttrType.cc \ 521 523 SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \ 522 524 SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \ … … 864 866 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 865 867 SynTree/$(DEPDIR)/$(am__dirstamp) 868 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT): \ 869 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) 866 870 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT): \ 867 871 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) … … 1058 1062 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po@am__quote@ 1059 1063 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po@am__quote@ 1064 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po@am__quote@ 1060 1065 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po@am__quote@ 1061 1066 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po@am__quote@ … … 2154 2159 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2155 2160 @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` 2161 2162 SynTree/driver_cfa_cpp-ReferenceType.o: SynTree/ReferenceType.cc 2163 @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.cc 2164 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po 2165 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.o' libtool=no @AMDEPBACKSLASH@ 2166 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2167 @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.cc 2168 2169 SynTree/driver_cfa_cpp-ReferenceType.obj: SynTree/ReferenceType.cc 2170 @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` 2171 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po 2172 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.obj' libtool=no @AMDEPBACKSLASH@ 2173 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2174 @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` 2156 2175 2157 2176 SynTree/driver_cfa_cpp-FunctionType.o: SynTree/FunctionType.cc -
src/Parser/DeclarationNode.cc
r3d4b23fa r9a1e509 329 329 } // DeclarationNode::newTypeDecl 330 330 331 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {332 DeclarationNode * newnode = new DeclarationNode; 333 newnode->type = new TypeData( TypeData::Pointer);331 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers, OperKinds kind ) { 332 DeclarationNode * newnode = new DeclarationNode; 333 newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference ); 334 334 if ( qualifiers ) { 335 335 return newnode->addQualifiers( qualifiers ); … … 748 748 DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) { 749 749 if ( p ) { 750 assert( p->type->kind == TypeData::Pointer );750 assert( p->type->kind == TypeData::Pointer || TypeData::Reference ); 751 751 setBase( p->type ); 752 752 p->type = nullptr; -
src/Parser/ExpressionNode.cc
r3d4b23fa r9a1e509 296 296 Expression *build_unary_ptr( OperKinds op, ExpressionNode *expr_node ) { 297 297 std::list< Expression * > args; 298 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node) ) );298 args.push_back( maybeMoveBuild< Expression >(expr_node) ); // xxx 299 299 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); 300 300 } … … 307 307 Expression *build_binary_ptr( OperKinds op, ExpressionNode *expr_node1, ExpressionNode *expr_node2 ) { 308 308 std::list< Expression * > args; 309 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node1)) );309 args.push_back( maybeMoveBuild< Expression >(expr_node1) ); 310 310 args.push_back( maybeMoveBuild< Expression >(expr_node2) ); 311 311 return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args ); -
src/Parser/ParseNode.h
r3d4b23fa r9a1e509 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 );239 static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind ); 240 240 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); 241 241 static DeclarationNode * newVarArray( DeclarationNode * qualifiers ); -
src/Parser/TypeData.cc
r3d4b23fa r9a1e509 30 30 case Unknown: 31 31 case Pointer: 32 case Reference: 32 33 case EnumConstant: 33 34 // nothing else to initialize … … 99 100 case Unknown: 100 101 case Pointer: 102 case Reference: 101 103 case EnumConstant: 102 104 // nothing to destroy … … 165 167 case EnumConstant: 166 168 case Pointer: 169 case Reference: 167 170 // nothing else to copy 168 171 break; … … 398 401 // add dtor: void ^?{}(T *) 399 402 FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false ); 400 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 ) );403 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 ) ); 401 404 td->get_assertions().push_front( new FunctionDecl( "^?{}", Type::StorageClasses(), LinkageSpec::Cforall, dtorType, nullptr ) ); 402 405 403 406 // add copy ctor: void ?{}(T *, T) 404 407 FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false ); 405 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 ) );408 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 ) ); 406 409 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 407 410 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, copyCtorType, nullptr ) ); … … 409 412 // add default ctor: void ?{}(T *) 410 413 FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false ); 411 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 ) );414 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 ) ); 412 415 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, ctorType, nullptr ) ); 413 416 414 417 // add assignment operator: T * ?=?(T *, T) 415 418 FunctionType * assignType = new FunctionType( Type::Qualifiers(), false ); 416 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 ) );419 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 ) ); 417 420 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 418 421 assignType->get_returnVals().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); … … 434 437 case TypeData::Array: 435 438 return buildArray( td ); 439 case TypeData::Reference: 440 return buildReference( td ); 436 441 case TypeData::Function: 437 442 return buildFunction( td ); … … 612 617 buildForall( td->forall, at->get_forall() ); 613 618 return at; 614 } // buildPointer 619 } // buildArray 620 621 ReferenceType * buildReference( const TypeData * td ) { 622 ReferenceType * rt; 623 if ( td->base ) { 624 rt = new ReferenceType( buildQualifiers( td ), typebuild( td->base ) ); 625 } else { 626 rt = new ReferenceType( buildQualifiers( td ), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ); 627 } // if 628 buildForall( td->forall, rt->get_forall() ); 629 return rt; 630 } // buildReference 615 631 616 632 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { -
src/Parser/TypeData.h
r3d4b23fa r9a1e509 21 21 22 22 struct TypeData { 23 enum Kind { Basic, Pointer, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,23 enum Kind { Basic, Pointer, Array, Reference, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic, 24 24 SymbolicInst, Tuple, Typeof, Builtin, Unknown }; 25 25 … … 101 101 PointerType * buildPointer( const TypeData * ); 102 102 ArrayType * buildArray( const TypeData * ); 103 ReferenceType * buildReference( const TypeData * ); 103 104 AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > ); 104 105 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ); -
src/Parser/parser.yy
r3d4b23fa r9a1e509 666 666 conditional_expression 667 667 | unary_expression assignment_operator assignment_expression 668 { $$ = new ExpressionNode( build_binary_ ptr( $2, $1, $3 ) ); }668 { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); } 669 669 ; 670 670 … … 2401 2401 variable_ptr: 2402 2402 ptrref_operator variable_declarator 2403 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2403 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2404 2404 | ptrref_operator type_qualifier_list variable_declarator 2405 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2405 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2406 2406 | '(' variable_ptr ')' attribute_list_opt 2407 2407 { $$ = $2->addQualifiers( $4 ); } // redundant parenthesis … … 2449 2449 function_ptr: 2450 2450 ptrref_operator function_declarator 2451 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2451 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2452 2452 | ptrref_operator type_qualifier_list function_declarator 2453 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2453 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2454 2454 | '(' function_ptr ')' 2455 2455 { $$ = $2; } … … 2489 2489 KR_function_ptr: 2490 2490 ptrref_operator KR_function_declarator 2491 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2491 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2492 2492 | ptrref_operator type_qualifier_list KR_function_declarator 2493 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2493 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2494 2494 | '(' KR_function_ptr ')' 2495 2495 { $$ = $2; } … … 2533 2533 type_ptr: 2534 2534 ptrref_operator variable_type_redeclarator 2535 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2535 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2536 2536 | ptrref_operator type_qualifier_list variable_type_redeclarator 2537 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2537 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2538 2538 | '(' type_ptr ')' attribute_list_opt 2539 2539 { $$ = $2->addQualifiers( $4 ); } … … 2577 2577 identifier_parameter_ptr: 2578 2578 ptrref_operator identifier_parameter_declarator 2579 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2579 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2580 2580 | ptrref_operator type_qualifier_list identifier_parameter_declarator 2581 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2581 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2582 2582 | '(' identifier_parameter_ptr ')' attribute_list_opt 2583 2583 { $$ = $2->addQualifiers( $4 ); } … … 2637 2637 type_parameter_ptr: 2638 2638 ptrref_operator type_parameter_redeclarator 2639 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2639 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2640 2640 | ptrref_operator type_qualifier_list type_parameter_redeclarator 2641 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2641 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2642 2642 | '(' type_parameter_ptr ')' attribute_list_opt 2643 2643 { $$ = $2->addQualifiers( $4 ); } … … 2680 2680 abstract_ptr: 2681 2681 ptrref_operator 2682 { $$ = DeclarationNode::newPointer( 0 ); }2682 { $$ = DeclarationNode::newPointer( 0, $1 ); } 2683 2683 | ptrref_operator type_qualifier_list 2684 { $$ = DeclarationNode::newPointer( $2 ); }2684 { $$ = DeclarationNode::newPointer( $2, $1 ); } 2685 2685 | ptrref_operator abstract_declarator 2686 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2686 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2687 2687 | ptrref_operator type_qualifier_list abstract_declarator 2688 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2688 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2689 2689 | '(' abstract_ptr ')' attribute_list_opt 2690 2690 { $$ = $2->addQualifiers( $4 ); } … … 2769 2769 abstract_parameter_ptr: 2770 2770 ptrref_operator 2771 { $$ = DeclarationNode::newPointer( nullptr ); }2771 { $$ = DeclarationNode::newPointer( nullptr, $1 ); } 2772 2772 | ptrref_operator type_qualifier_list 2773 { $$ = DeclarationNode::newPointer( $2 ); }2773 { $$ = DeclarationNode::newPointer( $2, $1 ); } 2774 2774 | ptrref_operator abstract_parameter_declarator 2775 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr ) ); }2775 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); } 2776 2776 | ptrref_operator type_qualifier_list abstract_parameter_declarator 2777 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2777 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2778 2778 | '(' abstract_parameter_ptr ')' attribute_list_opt 2779 2779 { $$ = $2->addQualifiers( $4 ); } … … 2848 2848 variable_abstract_ptr: 2849 2849 ptrref_operator 2850 { $$ = DeclarationNode::newPointer( 0 ); }2850 { $$ = DeclarationNode::newPointer( 0, $1 ); } 2851 2851 | ptrref_operator type_qualifier_list 2852 { $$ = DeclarationNode::newPointer( $2 ); }2852 { $$ = DeclarationNode::newPointer( $2, $1 ); } 2853 2853 | ptrref_operator variable_abstract_declarator 2854 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }2854 { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2855 2855 | ptrref_operator type_qualifier_list variable_abstract_declarator 2856 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }2856 { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); } 2857 2857 | '(' variable_abstract_ptr ')' attribute_list_opt 2858 2858 { $$ = $2->addQualifiers( $4 ); } … … 2894 2894 // No SUE declaration in parameter list. 2895 2895 ptrref_operator type_specifier_nobody 2896 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2896 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2897 2897 | type_qualifier_list ptrref_operator type_specifier_nobody 2898 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2898 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2899 2899 | ptrref_operator cfa_abstract_function 2900 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2900 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2901 2901 | type_qualifier_list ptrref_operator cfa_abstract_function 2902 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2902 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2903 2903 | ptrref_operator cfa_identifier_parameter_declarator_tuple 2904 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2904 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2905 2905 | type_qualifier_list ptrref_operator cfa_identifier_parameter_declarator_tuple 2906 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2906 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2907 2907 ; 2908 2908 … … 2982 2982 cfa_abstract_ptr: // CFA 2983 2983 ptrref_operator type_specifier 2984 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2984 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2985 2985 | type_qualifier_list ptrref_operator type_specifier 2986 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2986 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2987 2987 | ptrref_operator cfa_abstract_function 2988 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2988 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2989 2989 | type_qualifier_list ptrref_operator cfa_abstract_function 2990 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2990 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2991 2991 | ptrref_operator cfa_abstract_declarator_tuple 2992 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }2992 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); } 2993 2993 | type_qualifier_list ptrref_operator cfa_abstract_declarator_tuple 2994 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }2994 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); } 2995 2995 ; 2996 2996 -
src/ResolvExpr/AlternativeFinder.cc
r3d4b23fa r9a1e509 305 305 std::cerr << std::endl << " to "; 306 306 formalType->print( std::cerr, 8 ); 307 std::cerr << std::endl << "environment is: "; 308 alt.env.print( std::cerr, 8 ); 309 std::cerr << std::endl; 307 310 ) 308 311 Cost newCost = conversionCost( actualType, formalType, indexer, alt.env ); … … 400 403 Expression * actual = actualIt->expr; 401 404 Type * actualType = actual->get_result(); 405 402 406 PRINT( 403 407 std::cerr << "formal type is "; … … 643 647 makeExprList( instantiatedActuals, appExpr->get_args() ); 644 648 PRINT( 649 std::cerr << "instantiate function success: " << appExpr << std::endl; 645 650 std::cerr << "need assertions:" << std::endl; 646 651 printAssertionSet( resultNeed, std::cerr, 8 ); … … 753 758 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() ); 754 759 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 755 std::cerr << "Case +++++++++++++ "<< std::endl;760 std::cerr << "Case +++++++++++++ " << appExpr->get_function() << std::endl; 756 761 std::cerr << "formals are:" << std::endl; 757 762 printAll( function->get_parameters(), std::cerr, 8 ); … … 796 801 bool isLvalue( Expression *expr ) { 797 802 // xxx - recurse into tuples? 798 return expr->has_result() && expr->get_result()->get_lvalue();803 return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) ); 799 804 } 800 805 … … 882 887 funcFinder.findWithAdjustment( memberExpr->get_aggregate() ); 883 888 for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) { 884 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_result() ) ) { 885 addAggMembers( structInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() ); 886 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_result() ) ) { 887 addAggMembers( unionInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() ); 888 } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( agg->expr->get_result() ) ) { 889 addTupleMembers( tupleType, agg->expr, agg->cost, agg->env, memberExpr->get_member() ); 889 // 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 890 std::unique_ptr<Expression> aggrExpr( agg->expr->clone() ); 891 Type * aggrType = aggrExpr->get_result(); 892 if ( dynamic_cast< ReferenceType * >( aggrType ) ) { 893 aggrType = aggrType->stripReferences(); 894 aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) ); 895 } 896 897 // find member of the given type 898 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) { 899 addAggMembers( structInst, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() ); 900 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) { 901 addAggMembers( unionInst, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() ); 902 } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( aggrExpr->get_result() ) ) { 903 addTupleMembers( tupleType, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() ); 890 904 } // if 891 905 } // for -
src/ResolvExpr/CastCost.cc
r3d4b23fa r9a1e509 54 54 } else if ( dynamic_cast< VoidType* >( dest ) ) { 55 55 return Cost( 0, 0, 1 ); 56 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 57 return convertToReferenceCost( src, refType, indexer, env ); 56 58 } else { 57 59 CastCost converter( dest, indexer, env ); … … 76 78 cost = Cost( 1, 0, 0 ); 77 79 } else { 78 ConversionCost::visit( basicType);80 cost = conversionCost( basicType, dest, indexer, env ); 79 81 } // if 80 82 } -
src/ResolvExpr/CommonType.cc
r3d4b23fa r9a1e509 17 17 #include "SynTree/Type.h" 18 18 #include "Unify.h" 19 20 19 21 20 /// #define DEBUG … … 31 30 virtual void visit( PointerType *pointerType ); 32 31 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 void getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ); 44 template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ); 45 template< typename RefType > void handleRefType( RefType *inst, Type *other ); 45 46 46 47 Type *result; … … 52 53 }; 53 54 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 variables 60 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 54 80 Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) { 55 81 CommonType visitor( type2, widenFirst, widenSecond, indexer, env, openVars ); 82 83 ReferenceType * refType1 = dynamic_cast< ReferenceType * >( type1 ); 84 ReferenceType * refType2 = dynamic_cast< ReferenceType * >( type2 ); 85 if ( (refType1 || refType2) && (! refType1 || ! refType2) ) { 86 // handle the case where exactly one of the types is a reference type specially 87 if ( refType1 ) { 88 return handleReference( refType1, type2, widenFirst, widenSecond, indexer, env, openVars ); 89 } else if ( refType2 ) { 90 return handleReference( refType2, type1, widenSecond, widenFirst, indexer, env, openVars ); 91 } 92 } 93 56 94 type1->accept( visitor ); 57 95 Type *result = visitor.get_result(); … … 142 180 } 143 181 144 void CommonType::getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ) { 182 template< typename Pointer > 183 void CommonType::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) { 145 184 if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) { 146 185 OpenVarSet::const_iterator entry = openVars.find( var->get_name() ); … … 188 227 189 228 void CommonType::visit( __attribute((unused)) ArrayType *arrayType ) {} 229 230 void CommonType::visit( ReferenceType *refType ) { 231 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { 232 if ( widenFirst && dynamic_cast< VoidType* >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) { 233 getCommonWithVoidPointer( otherRef, refType ); 234 } else if ( widenSecond && dynamic_cast< VoidType* >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) { 235 getCommonWithVoidPointer( refType, otherRef ); 236 } else if ( ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst ) 237 && ( refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond ) ) { 238 Type::Qualifiers tq1 = refType->get_base()->get_qualifiers(), tq2 = otherRef->get_base()->get_qualifiers(); 239 refType->get_base()->get_qualifiers() = Type::Qualifiers(); 240 otherRef->get_base()->get_qualifiers() = Type::Qualifiers(); 241 AssertionSet have, need; 242 OpenVarSet newOpen( openVars ); 243 if ( unifyExact( refType->get_base(), otherRef->get_base(), env, have, need, newOpen, indexer ) ) { 244 if ( tq1 < tq2 ) { 245 result = refType->clone(); 246 } else { 247 result = otherRef->clone(); 248 } // if 249 result->get_qualifiers() = tq1 | tq2; 250 } else { 251 /// std::cout << "place for ptr-to-type" << std::endl; 252 } // if 253 refType->get_base()->get_qualifiers() = tq1; 254 otherRef->get_base()->get_qualifiers() = tq2; 255 } // if 256 } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) { 257 result = refType->clone(); 258 result->get_qualifiers() |= type2->get_qualifiers(); 259 } // if 260 } 261 190 262 void CommonType::visit( __attribute((unused)) FunctionType *functionType ) {} 191 263 void CommonType::visit( __attribute((unused)) StructInstType *aggregateUseType ) {} … … 195 267 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 196 268 // reuse BasicType, EnumInstType code by swapping type2 with enumInstType 197 Type * temp = type2;269 ValueGuard< Type * > temp( type2 ); 198 270 type2 = enumInstType; 199 temp->accept( *this ); 200 type2 = temp; 271 temp.old->accept( *this ); 201 272 } // if 202 273 } -
src/ResolvExpr/ConversionCost.cc
r3d4b23fa r9a1e509 57 57 } else if ( dynamic_cast< VoidType* >( dest ) ) { 58 58 return Cost( 0, 0, 1 ); 59 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) { 60 // std::cerr << "conversionCost: dest is reference" << std::endl; 61 return convertToReferenceCost( src, refType, indexer, env ); 59 62 } else { 60 63 ConversionCost converter( dest, indexer, env ); … … 66 69 } // if 67 70 } // if 71 } 72 73 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ) { 74 // std::cerr << "convert to reference cost..." << std::endl; 75 if ( ReferenceType *srcAsRef = dynamic_cast< ReferenceType * >( src ) ) { // pointer-like conversions between references 76 // std::cerr << "converting between references" << std::endl; 77 if ( srcAsRef->get_base()->get_qualifiers() <= dest->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( srcAsRef->get_base(), dest->get_base(), indexer, env ) ) { 78 return Cost( 0, 0, 1 ); 79 } else { // xxx - this discards reference qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 80 int assignResult = ptrsAssignable( srcAsRef->get_base(), dest->get_base(), env ); 81 if ( assignResult < 0 ) { 82 return Cost( 0, 0, 1 ); 83 } else if ( assignResult > 0 ) { 84 return Cost( 1, 0, 0 ); 85 } // if 86 } // if 87 } else if ( typesCompatibleIgnoreQualifiers( src, dest->get_base(), indexer, env ) ) { 88 // std::cerr << "converting compatible base type" << std::endl; 89 if ( src->get_lvalue() ) { 90 // std::cerr << "lvalue to reference conversion" << std::endl; 91 // lvalue-to-reference conversion: cv lvalue T => cv T & 92 if ( src->get_qualifiers() == dest->get_base()->get_qualifiers() ) { 93 return Cost( 0, 0, 1 ); // cost needs to be non-zero to add cast 94 } if ( src->get_qualifiers() < dest->get_base()->get_qualifiers() ) { 95 return Cost( 0, 0, 2 ); // cost needs to be higher than previous cast to differentiate adding qualifiers vs. keeping same 96 } else { 97 return Cost( 1, 0, 0 ); 98 } 99 } else if ( dest->get_base()->get_const() ) { 100 // std::cerr << "rvalue to const ref conversion" << std::endl; 101 // rvalue-to-const-reference conversion: T => const T & 102 return Cost( 0, 0, 1 ); 103 } else { 104 // std::cerr << "rvalue to non-const reference conversion" << std::endl; 105 // rvalue-to-reference conversion: T => T & 106 return Cost( 1, 0, 0 ); 107 } 108 } else { 109 // std::cerr << "attempting to convert from incompatible base type -- fail" << std::endl; 110 } 111 return Cost::infinity; 68 112 } 69 113 … … 173 217 if ( pointerType->get_base()->get_qualifiers() <= destAsPtr->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 174 218 cost = Cost( 0, 0, 1 ); 175 } else { 219 } else { // xxx - this discards pointer qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right? 176 220 int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env ); 177 221 if ( assignResult < 0 ) { … … 187 231 188 232 void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {} 233 234 void ConversionCost::visit(ReferenceType *refType) { 235 // Note: dest can never be a reference, since it would have been caught in an earlier check 236 assert( ! dynamic_cast< ReferenceType * >( dest ) ); 237 // convert reference to rvalue: cv T1 & => T2 238 // recursively compute conversion cost from T1 to T2. 239 // cv can be safely dropped because of 'implicit dereference' behavior. 240 refType->get_base()->accept( *this ); 241 } 242 189 243 void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {} 190 244 … … 208 262 static Type::Qualifiers q; 209 263 static BasicType integer( q, BasicType::SignedInt ); 210 integer.accept( *this ); 264 integer.accept( *this ); // safe if dest >= int 211 265 if ( cost < Cost( 1, 0, 0 ) ) { 212 266 cost.incSafe(); -
src/ResolvExpr/ConversionCost.h
r3d4b23fa r9a1e509 5 5 // file "LICENCE" distributed with Cforall. 6 6 // 7 // ConversionCost.h -- 7 // ConversionCost.h -- 8 8 // 9 9 // Author : Richard C. Bilson … … 26 26 public: 27 27 ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ); 28 28 29 29 Cost get_cost() const { return cost; } 30 30 … … 33 33 virtual void visit(PointerType *pointerType); 34 34 virtual void visit(ArrayType *arrayType); 35 virtual void visit(ReferenceType *refType); 35 36 virtual void visit(FunctionType *functionType); 36 37 virtual void visit(StructInstType *aggregateUseType); … … 49 50 const TypeEnvironment &env; 50 51 }; 52 53 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ); 51 54 } // namespace ResolvExpr 52 55 -
src/ResolvExpr/Unify.cc
r3d4b23fa r9a1e509 42 42 virtual void visit(PointerType *pointerType); 43 43 virtual void visit(ArrayType *arrayType); 44 virtual void visit(ReferenceType *refType); 44 45 virtual void visit(FunctionType *functionType); 45 46 virtual void visit(StructInstType *aggregateUseType); … … 428 429 } 429 430 431 void Unify::visit(ReferenceType *refType) { 432 if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) { 433 result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer ); 434 markAssertions( haveAssertions, needAssertions, refType ); 435 markAssertions( haveAssertions, needAssertions, otherRef ); 436 } // if 437 } 438 430 439 void Unify::visit(ArrayType *arrayType) { 431 440 ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 ); -
src/SymTab/Autogen.cc
r3d4b23fa r9a1e509 125 125 FunctionType * genDefaultType( Type * paramType ) { 126 126 FunctionType *ftype = new FunctionType( Type::Qualifiers(), false ); 127 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr );127 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr ); 128 128 ftype->get_parameters().push_back( dstParam ); 129 129 … … 176 176 FunctionType * ftype = funcDecl->get_functionType(); 177 177 assert( ! ftype->get_parameters().empty() ); 178 Type * t = safe_dynamic_cast< PointerType * >( ftype->get_parameters().front()->get_type() )->get_base(); 178 Type * t = InitTweak::getPointerBase( ftype->get_parameters().front()->get_type() ); 179 assert( t ); 179 180 map.insert( Mangler::mangleType( t ), true ); 180 181 } … … 297 298 /// generates a single struct member operation (constructor call, destructor call, assignment call) 298 299 void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool isDynamicLayout, bool forward = true ) { 299 ObjectDecl * returnVal = NULL;300 if ( ! func->get_functionType()->get_returnVals().empty() ) {301 returnVal = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_returnVals().front() );302 }303 304 300 InitTweak::InitExpander srcParam( src ); 305 301 306 // assign to destination (and return value if generic) 307 UntypedExpr *derefExpr = UntypedExpr::createDeref( new VariableExpr( dstParam ) ); 308 Expression *dstselect = new MemberExpr( field, derefExpr ); 302 // assign to destination 303 Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), safe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) ); 309 304 genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward ); 310 311 if ( isDynamicLayout && returnVal ) {312 // xxx - there used to be a dereference on returnVal, but this seems to have been wrong?313 Expression *retselect = new MemberExpr( field, new VariableExpr( returnVal ) );314 genImplicitCall( srcParam, retselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );315 } // if316 305 } 317 306 … … 467 456 // our inheritance model. I think the correct way to handle this is to 468 457 // cast the structure to the type of the member and let the resolver 469 // figure out whether it's valid and have a pass afterwards that fixes 470 // the assignment to use pointer arithmetic with the offset of the 471 // member, much like how generic type members are handled. 458 // figure out whether it's valid/choose the correct unnamed member 472 459 continue; 473 460 } … … 485 472 void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) { 486 473 UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) ); 487 copy->get_args().push_back( new VariableExpr( dstParam) );474 copy->get_args().push_back( new AddressExpr( new VariableExpr( dstParam ) ) ); 488 475 copy->get_args().push_back( new AddressExpr( new VariableExpr( srcParam ) ) ); 489 476 copy->get_args().push_back( new SizeofExpr( srcParam->get_type()->clone() ) ); … … 497 484 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 498 485 ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() ); 499 ObjectDecl * returnVal = nullptr;500 if ( ! ftype->get_returnVals().empty() ) {501 returnVal = safe_dynamic_cast< ObjectDecl * >( ftype->get_returnVals().front() );502 }503 486 504 487 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); 505 if ( returnVal ) { 488 if ( InitTweak::isAssignment( funcDecl->get_name() ) ) { 489 // also generate return statement in assignment 506 490 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 507 491 } … … 512 496 // Make function polymorphic in same parameters as generic union, if applicable 513 497 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 514 498 515 499 // default ctor/dtor need only first parameter 516 500 // void ?{}(T *); void ^?{}(T *); -
src/SymTab/Autogen.h
r3d4b23fa r9a1e509 43 43 template< typename OutputIterator > 44 44 Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) { 45 // want to be able to generate assignment, ctor, and dtor generically,46 // so fname is either ?=?, ?{}, or ^?{}47 UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );45 // want to be able to generate assignment, ctor, and dtor generically, 46 // so fname is either ?=?, ?{}, or ^?{} 47 UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) ); 48 48 49 // do something special for unnamed members 50 dstParam = new AddressExpr( dstParam ); 51 if ( addCast ) { 52 // cast to T* with qualifiers removed, so that qualified objects can be constructed 53 // and destructed with the same functions as non-qualified objects. 54 // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument 55 // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever 56 // remove lvalue as a qualifier, this can change to 57 // type->get_qualifiers() = Type::Qualifiers(); 58 assert( type ); 59 Type * castType = type->clone(); 60 castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 61 castType->set_lvalue( true ); // xxx - might not need this 62 dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) ); 63 } 64 fExpr->get_args().push_back( dstParam ); 49 if ( addCast ) { 50 // cast to T& with qualifiers removed, so that qualified objects can be constructed 51 // and destructed with the same functions as non-qualified objects. 52 // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument 53 // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever 54 // remove lvalue as a qualifier, this can change to 55 // type->get_qualifiers() = Type::Qualifiers(); 56 assert( type ); 57 Type * castType = type->clone(); 58 castType->get_qualifiers() -= Type::Qualifiers( Type::Lvalue | Type::Const | Type::Volatile | Type::Restrict | Type::Atomic ); 59 // castType->set_lvalue( true ); // xxx - might not need this 60 dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) ); 61 } 62 fExpr->get_args().push_back( dstParam ); 65 63 66 Statement * listInit = srcParam.buildListInit( fExpr );64 Statement * listInit = srcParam.buildListInit( fExpr ); 67 65 68 std::list< Expression * > args = *++srcParam;69 fExpr->get_args().splice( fExpr->get_args().end(), args );66 std::list< Expression * > args = *++srcParam; 67 fExpr->get_args().splice( fExpr->get_args().end(), args ); 70 68 71 *out++ = new ExprStmt( noLabels, fExpr );69 *out++ = new ExprStmt( noLabels, fExpr ); 72 70 73 srcParam.clearArrayIndices();71 srcParam.clearArrayIndices(); 74 72 75 return listInit;73 return listInit; 76 74 } 77 75 … … 109 107 110 108 UntypedExpr *inc = new UntypedExpr( update ); 111 inc->get_args().push_back( new AddressExpr( new VariableExpr( index )) );109 inc->get_args().push_back( new VariableExpr( index ) ); 112 110 113 111 UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) ); -
src/SymTab/Indexer.cc
r3d4b23fa r9a1e509 158 158 assert( ! params.empty() ); 159 159 // use base type of pointer, so that qualifiers on the pointer type aren't considered. 160 Type * base = safe_dynamic_cast< PointerType * >( params.front()->get_type() )->get_base(); 160 Type * base = InitTweak::getPointerBase( params.front()->get_type() ); 161 assert( base ); 161 162 funcMap[ Mangler::mangle( base ) ] += function; 162 163 } else { -
src/SymTab/Validate.cc
r3d4b23fa r9a1e509 823 823 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl ); 824 824 } 825 PointerType * ptrType = dynamic_cast< PointerType * >( params.front()->get_type() );826 if ( ! ptrType || ptrType->is_array()) {827 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer", funcDecl );825 ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() ); 826 if ( ! refType ) { 827 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference ", funcDecl ); 828 828 } 829 829 if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { -
src/SynTree/AddressExpr.cc
r3d4b23fa r9a1e509 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 becomes 28 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 20 39 AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) { 21 40 if ( arg->has_result() ) { 22 set_result( new PointerType( Type::Qualifiers(), arg->get_result()->clone() ) ); 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 ); 23 51 } 24 52 } -
src/SynTree/Expression.cc
r3d4b23fa r9a1e509 335 335 namespace { 336 336 TypeSubstitution makeSub( Type * t ) { 337 if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 337 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) { 338 return makeSub( refType->get_base() ); 339 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 338 340 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->get_parameters().begin() ); 339 341 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) { … … 400 402 if ( Type * type = expr->get_result() ) { 401 403 Type * base = InitTweak::getPointerBase( type ); 402 if ( ! base ) { 403 std::cerr << type << std::endl; 404 } 405 assertf( base, "expected pointer type in dereference\n" ); 406 ret->set_result( maybeClone( base ) ); 404 assertf( base, "expected pointer type in dereference (type was %s)", toString( type ).c_str() ); 405 ret->set_result( new ReferenceType( Type::Qualifiers(), base->clone() ) ); 407 406 } 408 407 return ret; -
src/SynTree/Mutator.cc
r3d4b23fa r9a1e509 473 473 } 474 474 475 Type *Mutator::mutate( ReferenceType *refType ) { 476 mutateAll( refType->get_forall(), *this ); 477 refType->set_base( maybeMutate( refType->get_base(), *this ) ); 478 return refType; 479 } 480 475 481 Type *Mutator::mutate( FunctionType *functionType ) { 476 482 mutateAll( functionType->get_forall(), *this ); -
src/SynTree/Mutator.h
r3d4b23fa r9a1e509 92 92 virtual Type* mutate( PointerType *pointerType ); 93 93 virtual Type* mutate( ArrayType *arrayType ); 94 virtual Type* mutate( ReferenceType *refType ); 94 95 virtual Type* mutate( FunctionType *functionType ); 95 96 virtual Type* mutate( StructInstType *aggregateUseType ); -
src/SynTree/SynTree.h
r3d4b23fa r9a1e509 101 101 class PointerType; 102 102 class ArrayType; 103 class ReferenceType; 103 104 class FunctionType; 104 105 class ReferenceToType; -
src/SynTree/Type.cc
r3d4b23fa r9a1e509 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 ) ) { 70 70 type = at; 71 } 72 return type; 73 } 74 75 Type * Type::stripReferences() { 76 Type * type = this; 77 while ( ReferenceType * ref = dynamic_cast<ReferenceType *>( type ) ) { 78 type = ref->get_base(); 71 79 } 72 80 return type; -
src/SynTree/Type.h
r3d4b23fa r9a1e509 158 158 159 159 /// return type without outer pointers and arrays 160 Type *stripDeclarator(); 160 Type * stripDeclarator(); 161 162 /// return type without outer references 163 Type * stripReferences(); 161 164 162 165 virtual bool isComplete() const { return true; } … … 249 252 bool is_array() const { return isStatic || isVarLen || dimension; } 250 253 254 virtual bool isComplete() const { return ! isVarLen; } 255 251 256 virtual PointerType *clone() const { return new PointerType( *this ); } 252 257 virtual void accept( Visitor & v ) { v.visit( this ); } … … 290 295 }; 291 296 297 class ReferenceType : public Type { 298 public: 299 ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() ); 300 ReferenceType( const ReferenceType & ); 301 virtual ~ReferenceType(); 302 303 Type *get_base() { return base; } 304 void set_base( Type *newValue ) { base = newValue; } 305 306 virtual ReferenceType *clone() const { return new ReferenceType( *this ); } 307 virtual void accept( Visitor & v ) { v.visit( this ); } 308 virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); } 309 virtual void print( std::ostream & os, int indent = 0 ) const; 310 private: 311 Type *base; 312 }; 313 292 314 class FunctionType : public Type { 293 315 public: -
src/SynTree/Visitor.cc
r3d4b23fa r9a1e509 363 363 void Visitor::visit( PointerType *pointerType ) { 364 364 acceptAll( pointerType->get_forall(), *this ); 365 // xxx - should PointerType visit/mutate dimension? 365 366 maybeAccept( pointerType->get_base(), *this ); 366 367 } … … 370 371 maybeAccept( arrayType->get_dimension(), *this ); 371 372 maybeAccept( arrayType->get_base(), *this ); 373 } 374 375 void Visitor::visit( ReferenceType *refType ) { 376 acceptAll( refType->get_forall(), *this ); 377 maybeAccept( refType->get_base(), *this ); 372 378 } 373 379 -
src/SynTree/Visitor.h
r3d4b23fa r9a1e509 95 95 virtual void visit( PointerType *pointerType ); 96 96 virtual void visit( ArrayType *arrayType ); 97 virtual void visit( ReferenceType *refType ); 97 98 virtual void visit( FunctionType *functionType ); 98 99 virtual void visit( StructInstType *aggregateUseType ); -
src/SynTree/module.mk
r3d4b23fa r9a1e509 20 20 SynTree/PointerType.cc \ 21 21 SynTree/ArrayType.cc \ 22 SynTree/ReferenceType.cc \ 22 23 SynTree/FunctionType.cc \ 23 24 SynTree/ReferenceToType.cc \ -
src/libcfa/containers/maybe
r3d4b23fa r9a1e509 29 29 30 30 forall(otype T) 31 void ?{}(maybe(T) *this);31 void ?{}(maybe(T) & this); 32 32 33 33 forall(otype T) 34 void ?{}(maybe(T) *this, T value);34 void ?{}(maybe(T) & this, T value); 35 35 36 36 forall(otype T) 37 void ?{}(maybe(T) *this, maybe(T) other);37 void ?{}(maybe(T) & this, maybe(T) other); 38 38 39 39 forall(otype T) 40 void ^?{}(maybe(T) *this);40 void ^?{}(maybe(T) & this); 41 41 42 42 forall(otype T) 43 maybe(T) ?=?(maybe(T) *this, maybe(T) other);43 maybe(T) ?=?(maybe(T) & this, maybe(T) other); 44 44 45 45 forall(otype T) -
src/libcfa/containers/maybe.c
r3d4b23fa r9a1e509 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; 50 51 } 51 52 52 53 forall(otype T) 53 void ^?{}(maybe(T) *this) {54 if (this ->has_value) {55 ^( &this->value){};54 void ^?{}(maybe(T) & this) { 55 if (this.has_value) { 56 ^(this.value){}; 56 57 } 57 58 } … … 89 90 } else { 90 91 this->has_value = true; 91 ( &this->value){value};92 (this->value){value}; 92 93 } 93 94 } … … 97 98 if (this->has_value) { 98 99 this->has_value = false; 99 ^( &this->value){};100 ^(this->value){}; 100 101 } 101 102 } -
src/libcfa/containers/vector
r3d4b23fa r9a1e509 31 31 32 32 forall(otype T) 33 void ?{}(heap_allocator(T) *this);33 void ?{}(heap_allocator(T)& this); 34 34 35 35 forall(otype T) 36 void ?{}(heap_allocator(T) *this, heap_allocator(T) rhs);36 void ?{}(heap_allocator(T)& this, heap_allocator(T) rhs); 37 37 38 38 forall(otype T) 39 heap_allocator(T) ?=?(heap_allocator(T) *this, heap_allocator(T) rhs);39 heap_allocator(T) ?=?(heap_allocator(T)& this, heap_allocator(T) rhs); 40 40 41 41 forall(otype T) 42 void ^?{}(heap_allocator(T) *this);42 void ^?{}(heap_allocator(T)& this); 43 43 44 44 forall(otype T) … … 65 65 //Initialization 66 66 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 67 void ?{}(vector(T, allocator_t) *this);67 void ?{}(vector(T, allocator_t)& this); 68 68 69 69 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 70 void ?{}(vector(T, allocator_t) *this, vector(T, allocator_t) rhs);70 void ?{}(vector(T, allocator_t)& this, vector(T, allocator_t) rhs); 71 71 72 72 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 73 vector(T, allocator_t) ?=?(vector(T, allocator_t) *this, vector(T, allocator_t) rhs);73 vector(T, allocator_t) ?=?(vector(T, allocator_t)& this, vector(T, allocator_t) rhs); 74 74 75 75 forall(otype T, otype allocator_t | allocator_c(T, allocator_t)) 76 void ^?{}(vector(T, allocator_t) *this);76 void ^?{}(vector(T, allocator_t)& this); 77 77 78 78 forall(otype T, otype allocator_t = heap_allocator(T) | allocator_c(T, allocator_t)) -
src/libcfa/containers/vector.c
r3d4b23fa r9a1e509 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/interpose.c
r3d4b23fa r9a1e509 10 10 // Author : Thierry Delisle 11 11 // Created On : Wed Mar 29 16:10:31 2017 12 // Last Modified By : 13 // Last Modified On : 12 // Last Modified By : 13 // Last Modified On : 14 14 // Update Count : 0 15 15 // … … 50 50 51 51 union { generic_fptr_t fptr; void* ptr; } originalFunc; 52 52 53 53 #if defined( _GNU_SOURCE ) 54 54 if ( version ) { … … 60 60 originalFunc.ptr = dlsym( library, symbol ); 61 61 #endif // _GNU_SOURCE 62 62 63 63 error = dlerror(); 64 if ( error ) abortf( "interpose_symbol : internal error, %s\n", error ); 64 if ( error ) abortf( "interpose_symbol : internal error, %s\n", error ); 65 65 66 66 return originalFunc.fptr; … … 75 75 forall(dtype T) 76 76 static inline void assign_ptr( T** symbol_ptr, const char * symbol_name, const char * version) { 77 union { 77 union { 78 78 generic_fptr_t gp; 79 T* tp; 79 T* tp; 80 80 } u; 81 81 -
src/libcfa/stdlib
r3d4b23fa r9a1e509 134 134 135 135 // allocation/deallocation and constructor/destructor, non-array types 136 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) T * new( Params p );137 forall( dtype T | { void ^?{}( T *); } ) void delete( T * ptr );138 forall( dtype T, ttype Params | { void ^?{}( T *); void delete( Params ); } ) void delete( T * ptr, Params rest );136 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * new( Params p ); 137 forall( dtype T | { void ^?{}( T & ); } ) void delete( T * ptr ); 138 forall( dtype T, ttype Params | { void ^?{}( T & ); void delete( Params ); } ) void delete( T * ptr, Params rest ); 139 139 140 140 // allocation/deallocation and constructor/destructor, array types 141 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) T * anew( size_t dim, Params p );142 forall( dtype T | sized(T) | { void ^?{}( T *); } ) void adelete( size_t dim, T arr[] );143 forall( dtype T | sized(T) | { void ^?{}( T *); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest );141 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * anew( size_t dim, Params p ); 142 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( size_t dim, T arr[] ); 143 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest ); 144 144 145 145 //--------------------------------------- … … 200 200 double abs( double _Complex ); 201 201 long double abs( long double _Complex ); 202 forall( otype T | { void ?{}( T *, zero_t ); int ?<?( T, T ); T -?( T ); } )202 forall( otype T | { void ?{}( T &, zero_t ); int ?<?( T, T ); T -?( T ); } ) 203 203 T abs( T ); 204 204 -
src/libcfa/stdlib.c
r3d4b23fa r9a1e509 34 34 if ( nlen > olen ) { // larger ? 35 35 memset( nptr + olen, (int)fill, nlen - olen ); // initialize added storage 36 } // 36 } // 37 37 return (T *)nptr; 38 38 } // alloc 39 39 40 40 // allocation/deallocation and constructor/destructor, non-array types 41 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } )41 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) 42 42 T * new( Params p ) { 43 43 return (malloc()){ p }; // run constructor 44 44 } // new 45 45 46 forall( dtype T | { void ^?{}( T *); } )46 forall( dtype T | { void ^?{}( T & ); } ) 47 47 void delete( T * ptr ) { 48 48 if ( ptr ) { // ignore null … … 52 52 } // delete 53 53 54 forall( dtype T, ttype Params | { void ^?{}( T *); void delete( Params ); } )54 forall( dtype T, ttype Params | { void ^?{}( T & ); void delete( Params ); } ) 55 55 void delete( T * ptr, Params rest ) { 56 56 if ( ptr ) { // ignore null … … 63 63 64 64 // allocation/deallocation and constructor/destructor, array types 65 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } )65 forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) 66 66 T * anew( size_t dim, Params p ) { 67 67 T *arr = alloc( dim ); … … 72 72 } // anew 73 73 74 forall( dtype T | sized(T) | { void ^?{}( T *); } )74 forall( dtype T | sized(T) | { void ^?{}( T & ); } ) 75 75 void adelete( size_t dim, T arr[] ) { 76 76 if ( arr ) { // ignore null … … 82 82 } // adelete 83 83 84 forall( dtype T | sized(T) | { void ^?{}( T *); }, ttype Params | { void adelete( Params ); } )84 forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) 85 85 void adelete( size_t dim, T arr[], Params rest ) { 86 86 if ( arr ) { // ignore null -
src/prelude/prelude.cf
r3d4b23fa r9a1e509 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) ) 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 * );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 * ); 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) ) 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 * );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 * ); 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 *,);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 );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 * &, forall( dtype DT2 ) const DT2 * ); 450 //forall( dtype DT ) DT * ?=?( DT * volatile &, forall( dtype DT2 ) const DT2 * ); 451 forall( dtype DT ) const DT * ?=?( const DT * &, forall( dtype DT2 ) const DT2 * ); 452 forall( dtype DT ) const DT * ?=?( const DT * volatile &, forall( dtype DT2 ) const DT2 * ); 453 //forall( dtype DT ) volatile DT * ?=?( volatile DT * &, forall( dtype DT2 ) const DT2 * ); 454 //forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, forall( dtype DT2 ) const DT2 * ); 455 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, forall( dtype DT2 ) const DT2 * ); 456 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, forall( dtype DT2 ) const DT2 * ); 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 ); 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 * *, zero_t);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 * &, forall( dtype DT2 ) const DT2 * ); 802 //forall( dtype DT ) void ?{}( DT * volatile &, forall( dtype DT2 ) const DT2 * ); 803 forall( dtype DT ) void ?{}( const DT * &, forall( dtype DT2 ) const DT2 * ); 804 //forall( dtype DT ) void ?{}( volatile DT * &, forall( dtype DT2 ) const DT2 * ); 805 //forall( dtype DT ) void ?{}( volatile DT * volatile &, forall( dtype DT2 ) const DT2 * ); 806 forall( dtype DT ) void ?{}( const volatile DT * &, forall( dtype DT2 ) const DT2 * ); 807 808 forall( ftype FT ) void ?{}( FT * &, forall( ftype FT2 ) FT2 * ); 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: //
Note: See TracChangeset
for help on using the changeset viewer.