Changes in / [9a1e509:3d4b23fa]
- Location:
- src
- Files:
-
- 1 deleted
- 45 edited
Legend:
- Unmodified
- Added
- Removed
-
src/CodeGen/CodeGenerator.cc
r9a1e509 r3d4b23fa 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 argument 348 *arg = addrExpr->get_arg(); 349 } else { 350 // no address-of operator, so must be a pointer - add dereference 351 // NOTE: if the assertion starts to trigger, check that the application expr isn't being shared. 352 // Since its arguments are modified here, this assertion most commonly triggers when the application 353 // is visited multiple times. 354 UntypedExpr * newExpr = new UntypedExpr( new NameExpr( "*?" ) ); 355 newExpr->get_args().push_back( *arg ); 356 Type * type = InitTweak::getPointerBase( (*arg)->get_result() ); 357 assertf( type, "First argument to a derefence must be a pointer. Ensure that expressions are not being shared." ); 358 newExpr->set_result( type->clone() ); 359 *arg = newExpr; 360 } // if 361 break; 362 } 363 364 default: 365 // do nothing 366 ; 367 } // switch 368 338 369 switch ( opInfo.type ) { 339 370 case OT_INDEX: -
src/CodeGen/GenType.cc
r9a1e509 r3d4b23fa 37 37 virtual void visit( PointerType *pointerType ); 38 38 virtual void visit( ArrayType *arrayType ); 39 virtual void visit( ReferenceType *refType );40 39 virtual void visit( StructInstType *structInst ); 41 40 virtual void visit( UnionInstType *unionInst ); … … 148 147 } 149 148 150 void GenType::visit( ReferenceType *refType ) {151 assert( refType->get_base() != 0);152 assertf( ! genC, "Reference types should not reach code generation." );153 handleQualifiers( refType );154 typeString = "&" + typeString;155 refType->get_base()->accept( *this );156 }157 158 149 void GenType::visit( FunctionType *funcType ) { 159 150 std::ostringstream os; -
src/Common/PassVisitor.h
r9a1e509 r3d4b23fa 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;116 115 virtual void visit( FunctionType *functionType ) override final; 117 116 virtual void visit( StructInstType *aggregateUseType ) override final; … … 199 198 virtual Type* mutate( PointerType *pointerType ) override final; 200 199 virtual Type* mutate( ArrayType *arrayType ) override final; 201 virtual Type* mutate( ReferenceType *referenceType ) override final;202 200 virtual Type* mutate( FunctionType *functionType ) override final; 203 201 virtual Type* mutate( StructInstType *aggregateUseType ) override final; -
src/Common/PassVisitor.impl.h
r9a1e509 r3d4b23fa 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 >793 788 void PassVisitor< pass_type >::visit( FunctionType * node ) { 794 789 VISIT_BODY( node ); … … 1123 1118 1124 1119 template< typename pass_type > 1125 Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {1126 MUTATE_BODY( Type, node );1127 }1128 1129 template< typename pass_type >1130 1120 Type * PassVisitor< pass_type >::mutate( FunctionType * node ) { 1131 1121 MUTATE_BODY( Type, node ); -
src/Concurrency/Keywords.cc
r9a1e509 r3d4b23fa 524 524 525 525 DeclarationWithType * param = decl->get_functionType()->get_parameters().front(); 526 auto type = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) ); 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() ); 527 529 // if( type ) std::cerr << "FRED2" << std::endl; 528 530 if( type && type->get_baseStruct()->is_thread() ) { -
src/GenPoly/Box.cc
r9a1e509 r3d4b23fa 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() ) { // xxx - is this still right?? 761 // xxx - dynamic_cast<ReferenceType *>( arg->get_result() )?? 760 } else if ( arg->get_result()->get_lvalue() ) { 762 761 // VariableExpr and MemberExpr are lvalues; need to check this isn't coming from the second arg of a comma expression though (not an lvalue) 763 762 // xxx - need to test that this code is still reachable … … 1037 1036 assert( appExpr->has_result() ); 1038 1037 assert( ! appExpr->get_args().empty() ); 1039 if ( isPolyPtr( appExpr->get_result(), scopeTyVars, env ) ) { // dereference returns a reference type 1040 // remove dereference from polymorphic types since they are boxed. 1038 if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) { 1041 1039 Expression *ret = appExpr->get_args().front(); 1042 1040 delete ret->get_result(); -
src/GenPoly/Lvalue.cc
r9a1e509 r3d4b23fa 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*.40 34 41 35 namespace GenPoly { 42 36 namespace { 43 struct ReferenceConversions final { 44 Expression * postmutate( CastExpr * castExpr ); 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; 45 47 }; 46 48 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 ); 49 /// Replace declarations of lvalue returns with appropriate pointers 50 class Pass2 : public Visitor { 51 public: 52 virtual void visit( FunctionType *funType ); 53 private: 56 54 }; 57 55 … … 59 57 /// https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Lvalues.html#Lvalues 60 58 /// Replaces &(a,b) with (a, &b), &(a ? b : c) with (a ? &b : &c) 61 struct GeneralizedLvalue final { 62 Expression * postmutate( AddressExpr * addressExpr ); 59 class GeneralizedLvalue : public Mutator { 60 typedef Mutator Parent; 61 62 virtual Expression * mutate( AddressExpr * addressExpr ); 63 63 }; 64 64 } // namespace 65 65 66 66 void convertLvalue( std::list< Declaration* >& translationUnit ) { 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 ); 67 Pass1 p1; 68 Pass2 p2; 69 GeneralizedLvalue genLval; 70 mutateAll( translationUnit, p1 ); 71 acceptAll( translationUnit, p2 ); 75 72 mutateAll( translationUnit, genLval ); 76 73 } … … 80 77 if ( function->get_returnVals().empty() ) return 0; 81 78 Type *ty = function->get_returnVals().front()->get_type(); 82 return dynamic_cast< ReferenceType * >( ty );79 return ty->get_lvalue() ? ty : 0; 83 80 } 84 81 … … 91 88 } 92 89 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; 90 Pass1::Pass1() { 102 91 } 103 92 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 ) == "?[?]"; 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(); 111 99 } 112 } 113 return false; 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; 114 105 } 115 106 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 ); 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() ) ); 127 121 } 128 129 // } 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 ); 126 return deref; 127 } else { 128 return appExpr; 129 } // if 130 130 } 131 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; 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; 152 151 } 153 152 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 } 153 void Pass2::visit( FunctionType *funType ) { 154 std::string typeName; 155 if ( isLvalueRet( funType ) ) { 156 DeclarationWithType *retParm = funType->get_returnVals().front(); 171 157 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() ) ); 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 177 161 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 ); 213 return deref; 214 // assertf( false, "Conversions from reference types are not currently supported." ); 215 } 216 return castExpr; 162 Visitor::visit( funType ); 217 163 } 218 164 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 ) { 165 Expression * GeneralizedLvalue::mutate( AddressExpr * addrExpr ) { 166 addrExpr = safe_dynamic_cast< AddressExpr * >( Parent::mutate( addrExpr ) ); 227 167 if ( CommaExpr * commaExpr = dynamic_cast< CommaExpr * >( addrExpr->get_arg() ) ) { 228 168 Expression * arg1 = commaExpr->get_arg1()->clone(); -
src/InitTweak/FixInit.cc
r9a1e509 r3d4b23fa 364 364 assert( ftype ); 365 365 if ( isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) { 366 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type());366 Type * t1 = ftype->get_parameters().front()->get_type(); 367 367 Type * t2 = ftype->get_parameters().back()->get_type(); 368 assert( t1 );369 370 if ( ResolvExpr::typesCompatible( t1, t2, SymTab::Indexer() ) ) {368 PointerType * ptrType = safe_dynamic_cast< PointerType * > ( t1 ); 369 370 if ( ResolvExpr::typesCompatible( ptrType->get_base(), t2, SymTab::Indexer() ) ) { 371 371 // optimization: don't need to copy construct in order to call a copy constructor 372 372 return appExpr; … … 401 401 402 402 bool ResolveCopyCtors::skipCopyConstruct( Type * type ) { 403 return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( type ) ||GenPoly::getFunctionType( type ) || Tuples::isTtype( type );403 return dynamic_cast< VarArgsType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type ); 404 404 } 405 405 … … 489 489 impCpCtorExpr->get_returnDecls().push_back( ret ); 490 490 CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; ) 491 if ( ! dynamic_cast< ReferenceType * >( result) ) {491 if ( ! result->get_lvalue() ) { 492 492 // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary 493 493 destructRet( ret, impCpCtorExpr ); … … 997 997 assert( ! type->get_parameters().empty() ); 998 998 thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() ); 999 Type * thisType = getPointerBase( thisParam->get_type() );1000 StructInstType * structType = dynamic_cast< StructInstType * >( thisType);999 PointerType * ptrType = safe_dynamic_cast< PointerType * > ( thisParam->get_type() ); 1000 StructInstType * structType = dynamic_cast< StructInstType * >( ptrType->get_base() ); 1001 1001 if ( structType ) { 1002 1002 structDecl = structType->get_baseStruct(); … … 1046 1046 // insert and resolve default/copy constructor call for each field that's unhandled 1047 1047 std::list< Statement * > stmt; 1048 UntypedExpr * deref = UntypedExpr::createDeref( new VariableExpr( thisParam ) ); 1049 1048 1050 Expression * arg2 = 0; 1049 1051 if ( isCopyConstructor( function ) ) { … … 1054 1056 } 1055 1057 InitExpander srcParam( arg2 ); 1056 SymTab::genImplicitCall( srcParam, new MemberExpr( field, new VariableExpr( thisParam )), function->get_name(), back_inserter( stmt ), field, isCtor );1058 SymTab::genImplicitCall( srcParam, new MemberExpr( field, deref ), function->get_name(), back_inserter( stmt ), field, isCtor ); 1057 1059 1058 1060 assert( stmt.size() <= 1 ); -
src/InitTweak/GenInit.cc
r9a1e509 r3d4b23fa 54 54 55 55 protected: 56 FunctionType * ftype = nullptr;56 FunctionType * ftype; 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 reference - we don't want to allocate a temporary if a variable's address139 // hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address 140 140 // is being returned 141 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type()) ) {141 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! returnVals.front()->get_type()->get_lvalue() ) { 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 145 stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) ); 144 UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) ); 145 construct->get_args().push_back( new AddressExpr( new VariableExpr( returnVals.front() ) ) ); 146 construct->get_args().push_back( returnStmt->get_expr() ); 147 stmtsToAddBefore.push_back(new ExprStmt(noLabels, construct)); 146 148 147 149 // return the retVal object … … 210 212 211 213 bool CtorDtor::isManaged( Type * type ) const { 212 // at least for now, references are never constructed213 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 Type * type = InitTweak::getPointerBase( params.front()->get_type() ); 241 assert( type ); 242 managedTypes.insert( SymTab::Mangler::mangle( type ) ); 240 PointerType * type = safe_dynamic_cast< PointerType * >( params.front()->get_type() ); 241 managedTypes.insert( SymTab::Mangler::mangle( type->get_base() ) ); 243 242 } 244 243 } -
src/InitTweak/InitTweak.cc
r9a1e509 r3d4b23fa 380 380 template<typename CallExpr> 381 381 Expression *& callArg( CallExpr * callExpr, unsigned int pos ) { 382 if ( pos >= callExpr->get_args().size() ) assertf( false, " getCallArg for argument that doesn't exist: (%u); %s.", pos, toString( callExpr ).c_str());382 if ( pos >= callExpr->get_args().size() ) assertf( false, "asking for argument that doesn't exist. Return NULL/throw exception?" ); 383 383 for ( Expression *& arg : callExpr->get_args() ) { 384 384 if ( pos == 0 ) return arg; … … 458 458 } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) { 459 459 return arrayType->get_base(); 460 } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) {461 return refType->get_base();462 460 } else { 463 461 return NULL; … … 545 543 if ( ftype->get_parameters().size() != 2 ) return 0; 546 544 547 Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type());545 Type * t1 = ftype->get_parameters().front()->get_type(); 548 546 Type * t2 = ftype->get_parameters().back()->get_type(); 549 assert( t1 ); 550 551 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, SymTab::Indexer() ) ) { 547 PointerType * ptrType = dynamic_cast< PointerType * > ( t1 ); 548 assert( ptrType ); 549 550 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( ptrType->get_base(), t2, SymTab::Indexer() ) ) { 552 551 return function; 553 552 } else { -
src/Makefile.in
r9a1e509 r3d4b23fa 221 221 SynTree/driver_cfa_cpp-PointerType.$(OBJEXT) \ 222 222 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT) \ 223 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT) \224 223 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT) \ 225 224 SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT) \ … … 518 517 SynTree/VoidType.cc SynTree/BasicType.cc \ 519 518 SynTree/PointerType.cc SynTree/ArrayType.cc \ 520 SynTree/ReferenceType.cc SynTree/FunctionType.cc \ 521 SynTree/ReferenceToType.cc SynTree/TupleType.cc \ 522 SynTree/TypeofType.cc SynTree/AttrType.cc \ 519 SynTree/FunctionType.cc SynTree/ReferenceToType.cc \ 520 SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \ 523 521 SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \ 524 522 SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \ … … 866 864 SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \ 867 865 SynTree/$(DEPDIR)/$(am__dirstamp) 868 SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT): \869 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)870 866 SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT): \ 871 867 SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp) … … 1062 1058 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po@am__quote@ 1063 1059 @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@1065 1060 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po@am__quote@ 1066 1061 @AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po@am__quote@ … … 2159 2154 @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ 2160 2155 @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.cc2163 @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.cc2164 @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po2165 @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.cc2168 2169 SynTree/driver_cfa_cpp-ReferenceType.obj: SynTree/ReferenceType.cc2170 @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.Po2172 @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`2175 2156 2176 2157 SynTree/driver_cfa_cpp-FunctionType.o: SynTree/FunctionType.cc -
src/Parser/DeclarationNode.cc
r9a1e509 r3d4b23fa 329 329 } // DeclarationNode::newTypeDecl 330 330 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);331 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) { 332 DeclarationNode * newnode = new DeclarationNode; 333 newnode->type = new TypeData( TypeData::Pointer ); 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 || TypeData::Reference);750 assert( p->type->kind == TypeData::Pointer ); 751 751 setBase( p->type ); 752 752 p->type = nullptr; -
src/Parser/ExpressionNode.cc
r9a1e509 r3d4b23fa 296 296 Expression *build_unary_ptr( OperKinds op, ExpressionNode *expr_node ) { 297 297 std::list< Expression * > args; 298 args.push_back( maybeMoveBuild< Expression >(expr_node) ); // xxx298 args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node) ) ); 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( maybeMoveBuild< Expression >(expr_node1) );309 args.push_back( new AddressExpr( 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
r9a1e509 r3d4b23fa 237 237 static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params ); 238 238 static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams ); 239 static DeclarationNode * newPointer( DeclarationNode * qualifiers , OperKinds kind);239 static DeclarationNode * newPointer( DeclarationNode * qualifiers ); 240 240 static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic ); 241 241 static DeclarationNode * newVarArray( DeclarationNode * qualifiers ); -
src/Parser/TypeData.cc
r9a1e509 r3d4b23fa 30 30 case Unknown: 31 31 case Pointer: 32 case Reference:33 32 case EnumConstant: 34 33 // nothing else to initialize … … 100 99 case Unknown: 101 100 case Pointer: 102 case Reference:103 101 case EnumConstant: 104 102 // nothing to destroy … … 167 165 case EnumConstant: 168 166 case Pointer: 169 case Reference:170 167 // nothing else to copy 171 168 break; … … 401 398 // add dtor: void ^?{}(T *) 402 399 FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false ); 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 ) );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 ) ); 404 401 td->get_assertions().push_front( new FunctionDecl( "^?{}", Type::StorageClasses(), LinkageSpec::Cforall, dtorType, nullptr ) ); 405 402 406 403 // add copy ctor: void ?{}(T *, T) 407 404 FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false ); 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 ) );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 ) ); 409 406 copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 410 407 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, copyCtorType, nullptr ) ); … … 412 409 // add default ctor: void ?{}(T *) 413 410 FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false ); 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 ) );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 ) ); 415 412 td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, ctorType, nullptr ) ); 416 413 417 414 // add assignment operator: T * ?=?(T *, T) 418 415 FunctionType * assignType = new FunctionType( Type::Qualifiers(), false ); 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 ) );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 ) ); 420 417 assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); 421 418 assignType->get_returnVals().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) ); … … 437 434 case TypeData::Array: 438 435 return buildArray( td ); 439 case TypeData::Reference:440 return buildReference( td );441 436 case TypeData::Function: 442 437 return buildFunction( td ); … … 617 612 buildForall( td->forall, at->get_forall() ); 618 613 return at; 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 614 } // buildPointer 631 615 632 616 AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) { -
src/Parser/TypeData.h
r9a1e509 r3d4b23fa 21 21 22 22 struct TypeData { 23 enum Kind { Basic, Pointer, Array, Reference,Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,23 enum Kind { Basic, Pointer, Array, 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 * );104 103 AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > ); 105 104 ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ); -
src/Parser/parser.yy
r9a1e509 r3d4b23fa 666 666 conditional_expression 667 667 | unary_expression assignment_operator assignment_expression 668 { $$ = new ExpressionNode( build_binary_ val( $2, $1, $3 ) ); }668 { $$ = new ExpressionNode( build_binary_ptr( $2, $1, $3 ) ); } 669 669 ; 670 670 … … 2401 2401 variable_ptr: 2402 2402 ptrref_operator variable_declarator 2403 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2403 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2404 2404 | ptrref_operator type_qualifier_list variable_declarator 2405 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2405 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1) ); }2451 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2452 2452 | ptrref_operator type_qualifier_list function_declarator 2453 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2453 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1) ); }2491 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2492 2492 | ptrref_operator type_qualifier_list KR_function_declarator 2493 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2493 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1) ); }2535 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2536 2536 | ptrref_operator type_qualifier_list variable_type_redeclarator 2537 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2537 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1) ); }2579 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2580 2580 | ptrref_operator type_qualifier_list identifier_parameter_declarator 2581 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2581 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1) ); }2639 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2640 2640 | ptrref_operator type_qualifier_list type_parameter_redeclarator 2641 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2641 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1); }2682 { $$ = DeclarationNode::newPointer( 0 ); } 2683 2683 | ptrref_operator type_qualifier_list 2684 { $$ = DeclarationNode::newPointer( $2 , $1); }2684 { $$ = DeclarationNode::newPointer( $2 ); } 2685 2685 | ptrref_operator abstract_declarator 2686 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2686 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2687 2687 | ptrref_operator type_qualifier_list abstract_declarator 2688 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2688 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1); }2771 { $$ = DeclarationNode::newPointer( nullptr ); } 2772 2772 | ptrref_operator type_qualifier_list 2773 { $$ = DeclarationNode::newPointer( $2 , $1); }2773 { $$ = DeclarationNode::newPointer( $2 ); } 2774 2774 | ptrref_operator abstract_parameter_declarator 2775 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr , $1) ); }2775 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr ) ); } 2776 2776 | ptrref_operator type_qualifier_list abstract_parameter_declarator 2777 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2777 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1); }2850 { $$ = DeclarationNode::newPointer( 0 ); } 2851 2851 | ptrref_operator type_qualifier_list 2852 { $$ = DeclarationNode::newPointer( $2 , $1); }2852 { $$ = DeclarationNode::newPointer( $2 ); } 2853 2853 | ptrref_operator variable_abstract_declarator 2854 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 , $1) ); }2854 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); } 2855 2855 | ptrref_operator type_qualifier_list variable_abstract_declarator 2856 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 , $1) ); }2856 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); } 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 , $1) ); }2896 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2897 2897 | type_qualifier_list ptrref_operator type_specifier_nobody 2898 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2898 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2899 2899 | ptrref_operator cfa_abstract_function 2900 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2900 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2901 2901 | type_qualifier_list ptrref_operator cfa_abstract_function 2902 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2902 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2903 2903 | ptrref_operator cfa_identifier_parameter_declarator_tuple 2904 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2904 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2905 2905 | type_qualifier_list ptrref_operator cfa_identifier_parameter_declarator_tuple 2906 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2906 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2907 2907 ; 2908 2908 … … 2982 2982 cfa_abstract_ptr: // CFA 2983 2983 ptrref_operator type_specifier 2984 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2984 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2985 2985 | type_qualifier_list ptrref_operator type_specifier 2986 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2986 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2987 2987 | ptrref_operator cfa_abstract_function 2988 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2988 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2989 2989 | type_qualifier_list ptrref_operator cfa_abstract_function 2990 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2990 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2991 2991 | ptrref_operator cfa_abstract_declarator_tuple 2992 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 , $1) ); }2992 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); } 2993 2993 | type_qualifier_list ptrref_operator cfa_abstract_declarator_tuple 2994 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 , $2) ); }2994 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); } 2995 2995 ; 2996 2996 -
src/ResolvExpr/AlternativeFinder.cc
r9a1e509 r3d4b23fa 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;310 307 ) 311 308 Cost newCost = conversionCost( actualType, formalType, indexer, alt.env ); … … 403 400 Expression * actual = actualIt->expr; 404 401 Type * actualType = actual->get_result(); 405 406 402 PRINT( 407 403 std::cerr << "formal type is "; … … 647 643 makeExprList( instantiatedActuals, appExpr->get_args() ); 648 644 PRINT( 649 std::cerr << "instantiate function success: " << appExpr << std::endl;650 645 std::cerr << "need assertions:" << std::endl; 651 646 printAssertionSet( resultNeed, std::cerr, 8 ); … … 758 753 PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() ); 759 754 FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() ); 760 std::cerr << "Case +++++++++++++ " << appExpr->get_function()<< std::endl;755 std::cerr << "Case +++++++++++++" << std::endl; 761 756 std::cerr << "formals are:" << std::endl; 762 757 printAll( function->get_parameters(), std::cerr, 8 ); … … 801 796 bool isLvalue( Expression *expr ) { 802 797 // xxx - recurse into tuples? 803 return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ));798 return expr->has_result() && expr->get_result()->get_lvalue(); 804 799 } 805 800 … … 887 882 funcFinder.findWithAdjustment( memberExpr->get_aggregate() ); 888 883 for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) { 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() ); 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() ); 904 890 } // if 905 891 } // for -
src/ResolvExpr/CastCost.cc
r9a1e509 r3d4b23fa 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 );58 56 } else { 59 57 CastCost converter( dest, indexer, env ); … … 78 76 cost = Cost( 1, 0, 0 ); 79 77 } else { 80 cost = conversionCost( basicType, dest, indexer, env);78 ConversionCost::visit( basicType ); 81 79 } // if 82 80 } -
src/ResolvExpr/CommonType.cc
r9a1e509 r3d4b23fa 17 17 #include "SynTree/Type.h" 18 18 #include "Unify.h" 19 19 20 20 21 /// #define DEBUG … … 30 31 virtual void visit( PointerType *pointerType ); 31 32 virtual void visit( ArrayType *arrayType ); 32 virtual void visit( ReferenceType *refType );33 33 virtual void visit( FunctionType *functionType ); 34 34 virtual void visit( StructInstType *aggregateUseType ); … … 42 42 virtual void visit( OneType *oneType ); 43 43 44 template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ); 45 template< typename RefType > void handleRefType( RefType *inst, Type *other ); 44 void getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ); 46 45 47 46 Type *result; … … 53 52 }; 54 53 55 Type * handleReference( ReferenceType * refType, Type * other, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) {56 Type * result = nullptr, * common = nullptr;57 AssertionSet have, need;58 OpenVarSet newOpen( openVars );59 // need unify to bind type variables60 if ( unify( refType->get_base(), other, env, have, need, newOpen, indexer, common ) ) {61 // std::cerr << "unify success" << std::endl;62 if ( widenSecond ) {63 if ( widenFirst || other->get_qualifiers() <= refType->get_qualifiers() ) {64 result = new ReferenceType( refType->get_qualifiers(), common ); // refType->clone();65 result->get_qualifiers() |= other->get_qualifiers();66 }67 } else if ( widenFirst ) {68 if ( widenSecond || refType->get_qualifiers() <= other->get_qualifiers() ) {69 result = common;70 result->get_qualifiers() |= refType->get_qualifiers();71 }72 }73 } else {74 // std::cerr << "exact unify failed: " << refType << " " << other << std::endl;75 }76 // std::cerr << "common type of reference [" << refType << "] and non-reference [" << other << "] is [" << result << "]" << std::endl;77 return result;78 }79 80 54 Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) { 81 55 CommonType visitor( type2, widenFirst, widenSecond, indexer, env, openVars ); 82 83 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 specially87 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 94 56 type1->accept( visitor ); 95 57 Type *result = visitor.get_result(); … … 180 142 } 181 143 182 template< typename Pointer > 183 void CommonType::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) { 144 void CommonType::getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ) { 184 145 if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) { 185 146 OpenVarSet::const_iterator entry = openVars.find( var->get_name() ); … … 227 188 228 189 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 } // if249 result->get_qualifiers() = tq1 | tq2;250 } else {251 /// std::cout << "place for ptr-to-type" << std::endl;252 } // if253 refType->get_base()->get_qualifiers() = tq1;254 otherRef->get_base()->get_qualifiers() = tq2;255 } // if256 } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {257 result = refType->clone();258 result->get_qualifiers() |= type2->get_qualifiers();259 } // if260 }261 262 190 void CommonType::visit( __attribute((unused)) FunctionType *functionType ) {} 263 191 void CommonType::visit( __attribute((unused)) StructInstType *aggregateUseType ) {} … … 267 195 if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) { 268 196 // reuse BasicType, EnumInstType code by swapping type2 with enumInstType 269 ValueGuard< Type * > temp( type2 );197 Type * temp = type2; 270 198 type2 = enumInstType; 271 temp.old->accept( *this ); 199 temp->accept( *this ); 200 type2 = temp; 272 201 } // if 273 202 } -
src/ResolvExpr/ConversionCost.cc
r9a1e509 r3d4b23fa 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 );62 59 } else { 63 60 ConversionCost converter( dest, indexer, env ); … … 69 66 } // if 70 67 } // 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 references76 // 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 } // if86 } // if87 } 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 cast94 } 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 same96 } 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;112 68 } 113 69 … … 217 173 if ( pointerType->get_base()->get_qualifiers() <= destAsPtr->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) { 218 174 cost = Cost( 0, 0, 1 ); 219 } else { // xxx - this discards pointer qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?175 } else { 220 176 int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env ); 221 177 if ( assignResult < 0 ) { … … 231 187 232 188 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 check236 assert( ! dynamic_cast< ReferenceType * >( dest ) );237 // convert reference to rvalue: cv T1 & => T2238 // 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 243 189 void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {} 244 190 … … 262 208 static Type::Qualifiers q; 263 209 static BasicType integer( q, BasicType::SignedInt ); 264 integer.accept( *this ); // safe if dest >= int210 integer.accept( *this ); 265 211 if ( cost < Cost( 1, 0, 0 ) ) { 266 212 cost.incSafe(); -
src/ResolvExpr/ConversionCost.h
r9a1e509 r3d4b23fa 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);36 35 virtual void visit(FunctionType *functionType); 37 36 virtual void visit(StructInstType *aggregateUseType); … … 50 49 const TypeEnvironment &env; 51 50 }; 52 53 Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env );54 51 } // namespace ResolvExpr 55 52 -
src/ResolvExpr/Unify.cc
r9a1e509 r3d4b23fa 42 42 virtual void visit(PointerType *pointerType); 43 43 virtual void visit(ArrayType *arrayType); 44 virtual void visit(ReferenceType *refType);45 44 virtual void visit(FunctionType *functionType); 46 45 virtual void visit(StructInstType *aggregateUseType); … … 429 428 } 430 429 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 } // if437 }438 439 430 void Unify::visit(ArrayType *arrayType) { 440 431 ArrayType *otherArray = dynamic_cast< ArrayType* >( type2 ); -
src/SymTab/Autogen.cc
r9a1e509 r3d4b23fa 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 ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr );127 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( 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 = InitTweak::getPointerBase( ftype->get_parameters().front()->get_type() ); 179 assert( t ); 178 Type * t = safe_dynamic_cast< PointerType * >( ftype->get_parameters().front()->get_type() )->get_base(); 180 179 map.insert( Mangler::mangleType( t ), true ); 181 180 } … … 298 297 /// generates a single struct member operation (constructor call, destructor call, assignment call) 299 298 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 300 304 InitTweak::InitExpander srcParam( src ); 301 305 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() ) ); 306 // assign to destination (and return value if generic) 307 UntypedExpr *derefExpr = UntypedExpr::createDeref( new VariableExpr( dstParam ) ); 308 Expression *dstselect = new MemberExpr( field, derefExpr ); 304 309 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 } // if 305 316 } 306 317 … … 456 467 // our inheritance model. I think the correct way to handle this is to 457 468 // cast the structure to the type of the member and let the resolver 458 // figure out whether it's valid/choose the correct unnamed member 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. 459 472 continue; 460 473 } … … 472 485 void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) { 473 486 UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) ); 474 copy->get_args().push_back( new AddressExpr( new VariableExpr( dstParam )) );487 copy->get_args().push_back( new VariableExpr( dstParam ) ); 475 488 copy->get_args().push_back( new AddressExpr( new VariableExpr( srcParam ) ) ); 476 489 copy->get_args().push_back( new SizeofExpr( srcParam->get_type()->clone() ) ); … … 484 497 ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() ); 485 498 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 } 486 503 487 504 makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) ); 488 if ( InitTweak::isAssignment( funcDecl->get_name() ) ) { 489 // also generate return statement in assignment 505 if ( returnVal ) { 490 506 funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) ); 491 507 } … … 496 512 // Make function polymorphic in same parameters as generic union, if applicable 497 513 const std::list< TypeDecl* > & typeParams = aggregateDecl->get_parameters(); // List of type variables to be placed on the generated functions 498 514 499 515 // default ctor/dtor need only first parameter 500 516 // void ?{}(T *); void ^?{}(T *); -
src/SymTab/Autogen.h
r9a1e509 r3d4b23fa 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 46 47 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 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 ); 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 ); 63 65 64 66 Statement * listInit = srcParam.buildListInit( fExpr ); 65 67 66 67 68 std::list< Expression * > args = *++srcParam; 69 fExpr->get_args().splice( fExpr->get_args().end(), args ); 68 70 69 71 *out++ = new ExprStmt( noLabels, fExpr ); 70 72 71 73 srcParam.clearArrayIndices(); 72 74 73 75 return listInit; 74 76 } 75 77 … … 107 109 108 110 UntypedExpr *inc = new UntypedExpr( update ); 109 inc->get_args().push_back( new VariableExpr( index) );111 inc->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) ); 110 112 111 113 UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) ); -
src/SymTab/Indexer.cc
r9a1e509 r3d4b23fa 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 = InitTweak::getPointerBase( params.front()->get_type() ); 161 assert( base ); 160 Type * base = safe_dynamic_cast< PointerType * >( params.front()->get_type() )->get_base(); 162 161 funcMap[ Mangler::mangle( base ) ] += function; 163 162 } else { -
src/SymTab/Validate.cc
r9a1e509 r3d4b23fa 823 823 throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl ); 824 824 } 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 );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 ); 828 828 } 829 829 if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) { -
src/SynTree/AddressExpr.cc
r9a1e509 r3d4b23fa 18 18 #include "Common/utility.h" 19 19 20 // Address expressions are typed based on the following inference rules:21 // E : lvalue T &..& (n references)22 // &E : T *&..& (n references)23 //24 // E : T &..& (m references)25 // &E : T *&..& (m-1 references)26 //27 // That is, lvalues becomes28 29 namespace {30 Type * addrType( Type * type ) {31 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) {32 return new ReferenceType( refType->get_qualifiers(), addrType( refType->get_base() ) );33 } else {34 return new PointerType( Type::Qualifiers(), type->clone() );35 }36 }37 }38 39 20 AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) { 40 21 if ( arg->has_result() ) { 41 if ( arg->get_result()->get_lvalue() ) { 42 // lvalue, retains all layers of reference and gains a pointer inside the references 43 set_result( addrType( arg->get_result() ) ); 44 } else { 45 // taking address of non-lvalue -- must be a reference, loses one layer of reference 46 ReferenceType * refType = safe_dynamic_cast< ReferenceType * >( arg->get_result() ); 47 set_result( addrType( refType->get_base() ) ); 48 } 49 // result of & is never an lvalue 50 get_result()->set_lvalue( false ); 22 set_result( new PointerType( Type::Qualifiers(), arg->get_result()->clone() ) ); 51 23 } 52 24 } -
src/SynTree/Expression.cc
r9a1e509 r3d4b23fa 335 335 namespace { 336 336 TypeSubstitution makeSub( Type * t ) { 337 if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) { 338 return makeSub( refType->get_base() ); 339 } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 337 if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) { 340 338 return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->get_parameters().begin() ); 341 339 } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) { … … 402 400 if ( Type * type = expr->get_result() ) { 403 401 Type * base = InitTweak::getPointerBase( type ); 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() ) ); 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 ) ); 406 407 } 407 408 return ret; -
src/SynTree/Mutator.cc
r9a1e509 r3d4b23fa 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 481 475 Type *Mutator::mutate( FunctionType *functionType ) { 482 476 mutateAll( functionType->get_forall(), *this ); -
src/SynTree/Mutator.h
r9a1e509 r3d4b23fa 92 92 virtual Type* mutate( PointerType *pointerType ); 93 93 virtual Type* mutate( ArrayType *arrayType ); 94 virtual Type* mutate( ReferenceType *refType );95 94 virtual Type* mutate( FunctionType *functionType ); 96 95 virtual Type* mutate( StructInstType *aggregateUseType ); -
src/SynTree/SynTree.h
r9a1e509 r3d4b23fa 101 101 class PointerType; 102 102 class ArrayType; 103 class ReferenceType;104 103 class FunctionType; 105 104 class ReferenceToType; -
src/SynTree/Type.cc
r9a1e509 r3d4b23fa 65 65 const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" }; 66 66 67 Type * 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();79 71 } 80 72 return type; -
src/SynTree/Type.h
r9a1e509 r3d4b23fa 158 158 159 159 /// return type without outer pointers and arrays 160 Type * stripDeclarator(); 161 162 /// return type without outer references 163 Type * stripReferences(); 160 Type *stripDeclarator(); 164 161 165 162 virtual bool isComplete() const { return true; } … … 252 249 bool is_array() const { return isStatic || isVarLen || dimension; } 253 250 254 virtual bool isComplete() const { return ! isVarLen; }255 256 251 virtual PointerType *clone() const { return new PointerType( *this ); } 257 252 virtual void accept( Visitor & v ) { v.visit( this ); } … … 295 290 }; 296 291 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 314 292 class FunctionType : public Type { 315 293 public: -
src/SynTree/Visitor.cc
r9a1e509 r3d4b23fa 363 363 void Visitor::visit( PointerType *pointerType ) { 364 364 acceptAll( pointerType->get_forall(), *this ); 365 // xxx - should PointerType visit/mutate dimension?366 365 maybeAccept( pointerType->get_base(), *this ); 367 366 } … … 371 370 maybeAccept( arrayType->get_dimension(), *this ); 372 371 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 );378 372 } 379 373 -
src/SynTree/Visitor.h
r9a1e509 r3d4b23fa 95 95 virtual void visit( PointerType *pointerType ); 96 96 virtual void visit( ArrayType *arrayType ); 97 virtual void visit( ReferenceType *refType );98 97 virtual void visit( FunctionType *functionType ); 99 98 virtual void visit( StructInstType *aggregateUseType ); -
src/SynTree/module.mk
r9a1e509 r3d4b23fa 20 20 SynTree/PointerType.cc \ 21 21 SynTree/ArrayType.cc \ 22 SynTree/ReferenceType.cc \23 22 SynTree/FunctionType.cc \ 24 23 SynTree/ReferenceToType.cc \ -
src/libcfa/containers/maybe
r9a1e509 r3d4b23fa 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
r9a1e509 r3d4b23fa 19 19 20 20 forall(otype T) 21 void ?{}(maybe(T) &this) {22 this .has_value = false;21 void ?{}(maybe(T) * this) { 22 this->has_value = false; 23 23 } 24 24 25 25 forall(otype T) 26 void ?{}(maybe(T) &this, T value) {27 this .has_value = true;28 ( this.value){value};26 void ?{}(maybe(T) * this, T value) { 27 this->has_value = true; 28 (&this->value){value}; 29 29 } 30 30 31 31 forall(otype T) 32 void ?{}(maybe(T) &this, maybe(T) other) {33 this .has_value = other.has_value;32 void ?{}(maybe(T) * this, maybe(T) other) { 33 this->has_value = other.has_value; 34 34 if (other.has_value) { 35 ( this.value){other.value};35 (&this->value){other.value}; 36 36 } 37 37 } 38 38 39 39 forall(otype T) 40 maybe(T) ?=?(maybe(T) &this, maybe(T) that) {41 if (this .has_value & that.has_value) {42 this .value = that.value;43 } else if (this .has_value) {44 ^( this.value){};45 this .has_value = false;40 maybe(T) ?=?(maybe(T) * this, maybe(T) that) { 41 if (this->has_value & that.has_value) { 42 this->value = that.value; 43 } else if (this->has_value) { 44 ^(&this->value){}; 45 this->has_value = false; 46 46 } else if (that.has_value) { 47 this .has_value = true;48 ( this.value){that.value};47 this->has_value = true; 48 (&this->value){that.value}; 49 49 } 50 return this;51 50 } 52 51 53 52 forall(otype T) 54 void ^?{}(maybe(T) &this) {55 if (this .has_value) {56 ^( this.value){};53 void ^?{}(maybe(T) * this) { 54 if (this->has_value) { 55 ^(&this->value){}; 57 56 } 58 57 } … … 90 89 } else { 91 90 this->has_value = true; 92 ( this->value){value};91 (&this->value){value}; 93 92 } 94 93 } … … 98 97 if (this->has_value) { 99 98 this->has_value = false; 100 ^( this->value){};99 ^(&this->value){}; 101 100 } 102 101 } -
src/libcfa/containers/vector
r9a1e509 r3d4b23fa 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
r9a1e509 r3d4b23fa 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
r9a1e509 r3d4b23fa 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
r9a1e509 r3d4b23fa 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
r9a1e509 r3d4b23fa 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
r9a1e509 r3d4b23fa 30 30 // ------------------------------------------------------------ 31 31 32 _Bool ?++( _Bool & ), ?++( volatile _Bool &);33 _Bool ?--( _Bool & ), ?--( volatile _Bool &);34 unsigned char ?++( unsigned char & ), ?++( volatile unsigned char &);35 signed int ?++( signed int & ), ?++( volatile signed int &);36 signed int ?--( signed int & ), ?--( volatile signed int &);37 unsigned int ?++( unsigned int & ), ?++( volatile unsigned int &);38 unsigned int ?--( unsigned int & ), ?--( volatile unsigned int &);39 signed long int ?++( signed long int & ), ?++( volatile signed long int &);40 signed long int ?--( signed long int & ), ?--( volatile signed long int &);41 unsigned long int ?++( unsigned long int & ), ?++( volatile unsigned long int &);42 unsigned long int ?--( unsigned long int & ), ?--( volatile unsigned long int &);43 signed long long int ?++( signed long long int & ), ?++( volatile signed long long int &);44 signed long long int ?--( signed long long int & ), ?--( volatile signed long long int &);45 unsigned long long int ?++( unsigned long long int & ), ?++( volatile unsigned long long int &);46 unsigned long long int ?--( unsigned long long int & ), ?--( volatile unsigned long long int &);47 float ?++( float & ), ?++( volatile float &);48 float ?--( float & ), ?--( volatile float &);49 double ?++( double & ), ?++( volatile double &);50 double ?--( double & ), ?--( volatile double &);51 long double ?++( long double & ), ?++( volatile long double &);52 long double ?--( long double & ), ?--( volatile long double &);53 float _Complex ?++( float _Complex & ), ?++( volatile float _Complex &);54 float _Complex ?--( float _Complex & ), ?--( volatile float _Complex &);55 double _Complex ?++( double _Complex & ), ?++( volatile double _Complex &);56 double _Complex ?--( double _Complex & ), ?--( volatile double _Complex &);57 long double _Complex ?++( long double _Complex & ), ?++( volatile long double _Complex &);58 long double _Complex ?--( long double _Complex & ), ?--( volatile long double _Complex &);59 60 forall( dtype T | sized(T) ) T * ?++( T * &);61 forall( dtype T | sized(T) ) const T * ?++( const T * &);62 forall( dtype T | sized(T) ) volatile T * ?++( volatile T * &);63 forall( dtype T | sized(T) ) const volatile T * ?++( const volatile T * &);64 forall( dtype T | sized(T) ) T * ?--( T * &);65 forall( dtype T | sized(T) ) const T * ?--( const T * &);66 forall( dtype T | sized(T) ) volatile T * ?--( volatile T * &);67 forall( dtype T | sized(T) ) const volatile T * ?--( const volatile T * &);68 69 forall( dtype T | sized(T) ) T &?[?]( T *, ptrdiff_t );70 forall( dtype T | sized(T) ) const T &?[?]( const T *, ptrdiff_t );71 forall( dtype T | sized(T) ) volatile T &?[?]( volatile T *, ptrdiff_t );72 forall( dtype T | sized(T) ) const volatile T &?[?]( const volatile T *, ptrdiff_t );73 forall( dtype T | sized(T) ) T &?[?]( ptrdiff_t, T * );74 forall( dtype T | sized(T) ) const T &?[?]( ptrdiff_t, const T * );75 forall( dtype T | sized(T) ) volatile T &?[?]( ptrdiff_t, volatile T * );76 forall( dtype T | sized(T) ) const volatile T &?[?]( ptrdiff_t, const volatile T * );32 _Bool ?++( _Bool * ), ?++( volatile _Bool * ); 33 _Bool ?--( _Bool * ), ?--( volatile _Bool * ); 34 unsigned char ?++( unsigned char * ), ?++( volatile unsigned char * ); 35 signed int ?++( signed int * ), ?++( volatile signed int * ); 36 signed int ?--( signed int * ), ?--( volatile signed int * ); 37 unsigned int ?++( unsigned int * ), ?++( volatile unsigned int * ); 38 unsigned int ?--( unsigned int * ), ?--( volatile unsigned int * ); 39 signed long int ?++( signed long int * ), ?++( volatile signed long int * ); 40 signed long int ?--( signed long int * ), ?--( volatile signed long int * ); 41 unsigned long int ?++( unsigned long int * ), ?++( volatile unsigned long int * ); 42 unsigned long int ?--( unsigned long int * ), ?--( volatile unsigned long int * ); 43 signed long long int ?++( signed long long int * ), ?++( volatile signed long long int * ); 44 signed long long int ?--( signed long long int * ), ?--( volatile signed long long int * ); 45 unsigned long long int ?++( unsigned long long int * ), ?++( volatile unsigned long long int * ); 46 unsigned long long int ?--( unsigned long long int * ), ?--( volatile unsigned long long int * ); 47 float ?++( float * ), ?++( volatile float * ); 48 float ?--( float * ), ?--( volatile float * ); 49 double ?++( double * ), ?++( volatile double * ); 50 double ?--( double * ), ?--( volatile double * ); 51 long double ?++( long double * ), ?++( volatile long double * ); 52 long double ?--( long double * ), ?--( volatile long double * ); 53 float _Complex ?++( float _Complex * ), ?++( volatile float _Complex * ); 54 float _Complex ?--( float _Complex * ), ?--( volatile float _Complex * ); 55 double _Complex ?++( double _Complex * ), ?++( volatile double _Complex * ); 56 double _Complex ?--( double _Complex * ), ?--( volatile double _Complex * ); 57 long double _Complex ?++( long double _Complex * ), ?++( volatile long double _Complex * ); 58 long double _Complex ?--( long double _Complex * ), ?--( volatile long double _Complex * ); 59 60 forall( dtype T | sized(T) ) T * ?++( T ** ); 61 forall( dtype T | sized(T) ) const T * ?++( const T ** ); 62 forall( dtype T | sized(T) ) volatile T * ?++( volatile T ** ); 63 forall( dtype T | sized(T) ) const volatile T * ?++( const volatile T ** ); 64 forall( dtype T | sized(T) ) T * ?--( T ** ); 65 forall( dtype T | sized(T) ) const T * ?--( const T ** ); 66 forall( dtype T | sized(T) ) volatile T * ?--( volatile T ** ); 67 forall( dtype T | sized(T) ) const volatile T * ?--( const volatile T ** ); 68 69 forall( dtype T | sized(T) ) lvalue T ?[?]( T *, ptrdiff_t ); 70 forall( dtype T | sized(T) ) const lvalue T ?[?]( const T *, ptrdiff_t ); 71 forall( dtype T | sized(T) ) volatile lvalue T ?[?]( volatile T *, ptrdiff_t ); 72 forall( dtype T | sized(T) ) const volatile lvalue T ?[?]( const volatile T *, ptrdiff_t ); 73 forall( dtype T | sized(T) ) lvalue T ?[?]( ptrdiff_t, T * ); 74 forall( dtype T | sized(T) ) const lvalue T ?[?]( ptrdiff_t, const T * ); 75 forall( dtype T | sized(T) ) volatile lvalue T ?[?]( ptrdiff_t, volatile T * ); 76 forall( dtype T | sized(T) ) const volatile lvalue T ?[?]( ptrdiff_t, const volatile T * ); 77 77 78 78 // ------------------------------------------------------------ … … 82 82 // ------------------------------------------------------------ 83 83 84 _Bool ++?( _Bool & ), --?( _Bool &);85 signed int ++?( signed int & ), --?( signed int &);86 unsigned int ++?( unsigned int & ), --?( unsigned int &);87 signed long int ++?( signed long int & ), --?( signed long int &);88 unsigned long int ++?( unsigned long int & ), --?( unsigned long int &);89 signed long long int ++?( signed long long int & ), --?( signed long long int &);90 unsigned long long int ++?( unsigned long long int & ), --?( unsigned long long int &);91 float ++?( float & ), --?( float &);92 double ++?( double & ), --?( double &);93 long double ++?( long double & ), --?( long double &);94 float _Complex ++?( float _Complex & ), --?( float _Complex &);95 double _Complex ++?( double _Complex & ), --?( double _Complex &);96 long double _Complex ++?( long double _Complex & ), --?( long double _Complex &);97 98 forall( dtype T | sized(T) ) T * ++?( T * &);99 forall( dtype T | sized(T) ) const T * ++?( const T * &);100 forall( dtype T | sized(T) ) volatile T * ++?( volatile T * &);101 forall( dtype T | sized(T) ) const volatile T * ++?( const volatile T * &);102 forall( dtype T | sized(T) ) T * --?( T * &);103 forall( dtype T | sized(T) ) const T * --?( const T * &);104 forall( dtype T | sized(T) ) volatile T * --?( volatile T * &);105 forall( dtype T | sized(T) ) const volatile T * --?( const volatile T * &);106 107 forall( dtype T | sized(T) ) T &*?( T * );108 forall( dtype T | sized(T) ) const T &*?( const T * );109 forall( dtype T | sized(T) ) volatile T &*?( volatile T * );110 forall( dtype T | sized(T) ) const volatile T &*?( const volatile T * );111 forall( ftype FT ) FT &*?( FT * );84 _Bool ++?( _Bool * ), --?( _Bool * ); 85 signed int ++?( signed int * ), --?( signed int * ); 86 unsigned int ++?( unsigned int * ), --?( unsigned int * ); 87 signed long int ++?( signed long int * ), --?( signed long int * ); 88 unsigned long int ++?( unsigned long int * ), --?( unsigned long int * ); 89 signed long long int ++?( signed long long int * ), --?( signed long long int * ); 90 unsigned long long int ++?( unsigned long long int * ), --?( unsigned long long int * ); 91 float ++?( float * ), --?( float * ); 92 double ++?( double * ), --?( double * ); 93 long double ++?( long double * ), --?( long double * ); 94 float _Complex ++?( float _Complex * ), --?( float _Complex * ); 95 double _Complex ++?( double _Complex * ), --?( double _Complex * ); 96 long double _Complex ++?( long double _Complex * ), --?( long double _Complex * ); 97 98 forall( dtype T | sized(T) ) T * ++?( T ** ); 99 forall( dtype T | sized(T) ) const T * ++?( const T ** ); 100 forall( dtype T | sized(T) ) volatile T * ++?( volatile T ** ); 101 forall( dtype T | sized(T) ) const volatile T * ++?( const volatile T ** ); 102 forall( dtype T | sized(T) ) T * --?( T ** ); 103 forall( dtype T | sized(T) ) const T * --?( const T ** ); 104 forall( dtype T | sized(T) ) volatile T * --?( volatile T ** ); 105 forall( dtype T | sized(T) ) const volatile T * --?( const volatile T ** ); 106 107 forall( dtype T | sized(T) ) lvalue T *?( T * ); 108 forall( dtype T | sized(T) ) const lvalue T *?( const T * ); 109 forall( dtype T | sized(T) ) volatile lvalue T *?( volatile T * ); 110 forall( dtype T | sized(T) ) const volatile lvalue T *?( const volatile T * ); 111 forall( ftype FT ) lvalue FT *?( FT * ); 112 112 113 113 _Bool +?( _Bool ), -?( _Bool ), ~?( _Bool ); … … 366 366 // ------------------------------------------------------------ 367 367 368 forall( ftype FT ) FT * ?=?( FT * &, FT * );369 forall( ftype FT ) FT * ?=?( FT * volatile &, FT * );370 371 forall( dtype DT ) DT * ?=?( DT * &, DT * );372 forall( dtype DT ) DT * ?=?( DT * volatile &, DT * );373 forall( dtype DT ) const DT * ?=?( const DT * &, DT * );374 forall( dtype DT ) const DT * ?=?( const DT * volatile &, DT * );375 forall( dtype DT ) const DT * ?=?( const DT * &, const DT * );376 forall( dtype DT ) const DT * ?=?( const DT * volatile &, const DT * );377 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, DT * );378 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, DT * );379 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, volatile DT * );380 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, volatile DT * );381 382 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, DT * );383 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, DT * );384 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const DT * );385 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const DT * );386 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, volatile DT * );387 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, volatile DT * );388 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const volatile DT * );389 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const volatile DT * );390 391 forall( dtype DT ) DT * ?=?( DT * &, void * );392 forall( dtype DT ) DT * ?=?( DT * volatile &, void * );393 forall( dtype DT ) const DT * ?=?( const DT * &, void * );394 forall( dtype DT ) const DT * ?=?( const DT * volatile &, void * );395 forall( dtype DT ) const DT * ?=?( const DT * &, const void * );396 forall( dtype DT ) const DT * ?=?( const DT * volatile &, const void * );397 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, void * );398 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, void * );399 forall( dtype DT ) volatile DT * ?=?( volatile DT * &, volatile void * );400 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile &, volatile void * );401 402 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, void * );403 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, void * );404 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const void * );405 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const void * );406 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, volatile void * );407 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, volatile void * );408 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * &, const volatile void * );409 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile &, const volatile void * );410 411 forall( dtype DT ) void * ?=?( void * &, DT * );412 forall( dtype DT ) void * ?=?( void * volatile &, DT * );413 forall( dtype DT ) const void * ?=?( const void * &, DT * );414 forall( dtype DT ) const void * ?=?( const void * volatile &, DT * );415 forall( dtype DT ) const void * ?=?( const void * &, const DT * );416 forall( dtype DT ) const void * ?=?( const void * volatile &, const DT * );417 forall( dtype DT ) volatile void * ?=?( volatile void * &, DT * );418 forall( dtype DT ) volatile void * ?=?( volatile void * volatile &, DT * );419 forall( dtype DT ) volatile void * ?=?( volatile void * &, volatile DT * );420 forall( dtype DT ) volatile void * ?=?( volatile void * volatile &, volatile DT * );421 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, DT * );422 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, DT * );423 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, const DT * );424 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, const DT * );425 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, volatile DT * );426 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, volatile DT * );427 forall( dtype DT ) const volatile void * ?=?( const volatile void * &, const volatile DT * );428 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, const volatile DT * );429 430 void * ?=?( void * &, void * );431 void * ?=?( void * volatile &, void * );432 const void * ?=?( const void * &, void * );433 const void * ?=?( const void * volatile &, void * );434 const void * ?=?( const void * &, const void * );435 const void * ?=?( const void * volatile &, const void * );436 volatile void * ?=?( volatile void * &, void * );437 volatile void * ?=?( volatile void * volatile &, void * );438 volatile void * ?=?( volatile void * &, volatile void * );439 volatile void * ?=?( volatile void * volatile &, volatile void * );440 const volatile void * ?=?( const volatile void * &, void * );441 const volatile void * ?=?( const volatile void * volatile &, void * );442 const volatile void * ?=?( const volatile void * &, const void * );443 const volatile void * ?=?( const volatile void * volatile &, const void * );444 const volatile void * ?=?( const volatile void * &, volatile void * );445 const volatile void * ?=?( const volatile void * volatile &, volatile void * );446 const volatile void * ?=?( const volatile void * &, const volatile void * );447 const volatile void * ?=?( const volatile void * volatile &, const volatile void * );448 449 // forall( dtype DT ) DT * ?=?( DT * &, 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 );368 forall( ftype FT ) FT * ?=?( FT **, FT * ); 369 forall( ftype FT ) FT * ?=?( FT * volatile *, FT * ); 370 371 forall( dtype DT ) DT * ?=?( DT * *, DT * ); 372 forall( dtype DT ) DT * ?=?( DT * volatile *, DT * ); 373 forall( dtype DT ) const DT * ?=?( const DT * *, DT * ); 374 forall( dtype DT ) const DT * ?=?( const DT * volatile *, DT * ); 375 forall( dtype DT ) const DT * ?=?( const DT * *, const DT * ); 376 forall( dtype DT ) const DT * ?=?( const DT * volatile *, const DT * ); 377 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, DT * ); 378 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, DT * ); 379 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, volatile DT * ); 380 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, volatile DT * ); 381 382 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, DT * ); 383 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, DT * ); 384 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const DT * ); 385 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const DT * ); 386 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, volatile DT * ); 387 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, volatile DT * ); 388 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const volatile DT * ); 389 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const volatile DT * ); 390 391 forall( dtype DT ) DT * ?=?( DT * *, void * ); 392 forall( dtype DT ) DT * ?=?( DT * volatile *, void * ); 393 forall( dtype DT ) const DT * ?=?( const DT * *, void * ); 394 forall( dtype DT ) const DT * ?=?( const DT * volatile *, void * ); 395 forall( dtype DT ) const DT * ?=?( const DT * *, const void * ); 396 forall( dtype DT ) const DT * ?=?( const DT * volatile *, const void * ); 397 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, void * ); 398 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, void * ); 399 forall( dtype DT ) volatile DT * ?=?( volatile DT * *, volatile void * ); 400 forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, volatile void * ); 401 402 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, void * ); 403 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, void * ); 404 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const void * ); 405 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const void * ); 406 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, volatile void * ); 407 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, volatile void * ); 408 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, const volatile void * ); 409 forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, const volatile void * ); 410 411 forall( dtype DT ) void * ?=?( void * *, DT * ); 412 forall( dtype DT ) void * ?=?( void * volatile *, DT * ); 413 forall( dtype DT ) const void * ?=?( const void * *, DT * ); 414 forall( dtype DT ) const void * ?=?( const void * volatile *, DT * ); 415 forall( dtype DT ) const void * ?=?( const void * *, const DT * ); 416 forall( dtype DT ) const void * ?=?( const void * volatile *, const DT * ); 417 forall( dtype DT ) volatile void * ?=?( volatile void * *, DT * ); 418 forall( dtype DT ) volatile void * ?=?( volatile void * volatile *, DT * ); 419 forall( dtype DT ) volatile void * ?=?( volatile void * *, volatile DT * ); 420 forall( dtype DT ) volatile void * ?=?( volatile void * volatile *, volatile DT * ); 421 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, DT * ); 422 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, DT * ); 423 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, const DT * ); 424 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, const DT * ); 425 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, volatile DT * ); 426 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, volatile DT * ); 427 forall( dtype DT ) const volatile void * ?=?( const volatile void * *, const volatile DT * ); 428 forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile *, const volatile DT * ); 429 430 void * ?=?( void * *, void * ); 431 void * ?=?( void * volatile *, void * ); 432 const void * ?=?( const void * *, void * ); 433 const void * ?=?( const void * volatile *, void * ); 434 const void * ?=?( const void * *, const void * ); 435 const void * ?=?( const void * volatile *, const void * ); 436 volatile void * ?=?( volatile void * *, void * ); 437 volatile void * ?=?( volatile void * volatile *, void * ); 438 volatile void * ?=?( volatile void * *, volatile void * ); 439 volatile void * ?=?( volatile void * volatile *, volatile void * ); 440 const volatile void * ?=?( const volatile void * *, void * ); 441 const volatile void * ?=?( const volatile void * volatile *, void * ); 442 const volatile void * ?=?( const volatile void * *, const void * ); 443 const volatile void * ?=?( const volatile void * volatile *, const void * ); 444 const volatile void * ?=?( const volatile void * *, volatile void * ); 445 const volatile void * ?=?( const volatile void * volatile *, volatile void * ); 446 const volatile void * ?=?( const volatile void * *, const volatile void * ); 447 const volatile void * ?=?( const volatile void * volatile *, const volatile void * ); 448 449 // //forall( dtype DT ) DT * ?=?( DT * *, zero_t ); 450 // //forall( dtype DT ) DT * ?=?( DT * volatile *, zero_t ); 451 // forall( dtype DT ) const DT * ?=?( const DT * *, zero_t ); 452 // forall( dtype DT ) const DT * ?=?( const DT * volatile *, zero_t ); 453 // //forall( dtype DT ) volatile DT * ?=?( volatile DT * *, zero_t ); 454 // //forall( dtype DT ) volatile DT * ?=?( volatile DT * volatile *, ); 455 // forall( dtype DT ) const volatile DT * ?=?( const volatile DT * *, zero_t ); 456 // forall( dtype DT ) const volatile DT * ?=?( const volatile DT * volatile *, zero_t ); 457 458 // forall( ftype FT ) FT * ?=?( FT * *, zero_t ); 459 // forall( ftype FT ) FT * ?=?( FT * volatile *, zero_t ); 460 461 forall( dtype T | sized(T) ) T * ?+=?( T * *, ptrdiff_t ); 462 forall( dtype T | sized(T) ) T * ?+=?( T * volatile *, ptrdiff_t ); 463 forall( dtype T | sized(T) ) const T * ?+=?( const T * *, ptrdiff_t ); 464 forall( dtype T | sized(T) ) const T * ?+=?( const T * volatile *, ptrdiff_t ); 465 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * *, ptrdiff_t ); 466 forall( dtype T | sized(T) ) volatile T * ?+=?( volatile T * volatile *, ptrdiff_t ); 467 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * *, ptrdiff_t ); 468 forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile *, ptrdiff_t ); 469 forall( dtype T | sized(T) ) T * ?-=?( T * *, ptrdiff_t ); 470 forall( dtype T | sized(T) ) T * ?-=?( T * volatile *, ptrdiff_t ); 471 forall( dtype T | sized(T) ) const T * ?-=?( const T * *, ptrdiff_t ); 472 forall( dtype T | sized(T) ) const T * ?-=?( const T * volatile *, ptrdiff_t ); 473 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * *, ptrdiff_t ); 474 forall( dtype T | sized(T) ) volatile T * ?-=?( volatile T * volatile *, ptrdiff_t ); 475 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * *, ptrdiff_t ); 476 forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile *, ptrdiff_t ); 477 478 _Bool ?=?( _Bool *, _Bool ), ?=?( volatile _Bool *, _Bool ); 479 char ?=?( char *, char ), ?=?( volatile char *, char ); 480 char signed ?=?( char signed *, char signed ), ?=?( volatile char signed *, char signed ); 481 char unsigned ?=?( char unsigned *, char unsigned ), ?=?( volatile char unsigned *, char unsigned ); 482 int short ?=?( int short *, int short ), ?=?( volatile int short *, int short ); 483 int short unsigned ?=?( int short unsigned *, int short unsigned ), ?=?( volatile int short unsigned *, int short unsigned ); 484 signed int ?=?( signed int *, signed int ), ?=?( volatile signed int *, signed int ); 485 unsigned int ?=?( unsigned *, unsigned ), ?=?( volatile unsigned *, unsigned ); 486 signed long int ?=?( signed long int *, signed long int ), ?=?( volatile signed long int *, signed long int ); 487 unsigned long int ?=?( unsigned long int *, unsigned long int ), ?=?( volatile unsigned long int *, unsigned long int ); 488 signed long long int ?=?( signed long long int *, signed long long int ), ?=?( volatile signed long long int *, signed long long int ); 489 unsigned long long int ?=?( unsigned long long int *, unsigned long long int ), ?=?( volatile unsigned long long int *, unsigned long long int ); 490 zero_t ?=?( zero_t *, zero_t ); 491 one_t ?=?( one_t *, one_t ); 492 493 494 _Bool ?*=?( _Bool *, _Bool ), ?*=?( volatile _Bool *, _Bool ); 495 char ?*=?( char *, char ), ?*=?( volatile char *, char ); 496 char signed ?*=?( char signed *, char signed ), ?*=?( volatile char signed *, char signed ); 497 char unsigned ?*=?( char unsigned *, char unsigned ), ?*=?( volatile char unsigned *, char unsigned ); 498 int short ?*=?( int short *, int short ), ?*=?( volatile int short *, int short ); 499 int short unsigned ?*=?( int short unsigned *, int short unsigned ), ?*=?( volatile int short unsigned *, int short unsigned ); 500 signed int ?*=?( signed int *, signed int ), ?*=?( volatile signed int *, signed int ); 501 unsigned int ?*=?( unsigned *, unsigned ), ?*=?( volatile unsigned *, unsigned ); 502 signed long int ?*=?( signed long int *, signed long int ), ?*=?( volatile signed long int *, signed long int ); 503 unsigned long int ?*=?( unsigned long int *, unsigned long int ), ?*=?( volatile unsigned long int *, unsigned long int ); 504 signed long long int ?*=?( signed long long int *, signed long long int ), ?*=?( volatile signed long long int *, signed long long int ); 505 unsigned long long int ?*=?( unsigned long long int *, unsigned long long int ), ?*=?( volatile unsigned long long int *, unsigned long long int ); 506 507 _Bool ?/=?( _Bool *, _Bool ), ?/=?( volatile _Bool *, _Bool ); 508 char ?/=?( char *, char ), ?/=?( volatile char *, char ); 509 char signed ?/=?( char signed *, char signed ), ?/=?( volatile char signed *, char signed ); 510 char unsigned ?/=?( char unsigned *, char unsigned ), ?/=?( volatile char unsigned *, char unsigned ); 511 int short ?/=?( int short *, int short ), ?/=?( volatile int short *, int short ); 512 int short unsigned ?/=?( int short unsigned *, int short unsigned ), ?/=?( volatile int short unsigned *, int short unsigned ); 513 signed int ?/=?( signed int *, signed int ), ?/=?( volatile signed int *, signed int ); 514 unsigned int ?/=?( unsigned *, unsigned ), ?/=?( volatile unsigned *, unsigned ); 515 signed long int ?/=?( signed long int *, signed long int ), ?/=?( volatile signed long int *, signed long int ); 516 unsigned long int ?/=?( unsigned long int *, unsigned long int ), ?/=?( volatile unsigned long int *, unsigned long int ); 517 signed long long int ?/=?( signed long long int *, signed long long int ), ?/=?( volatile signed long long int *, signed long long int ); 518 unsigned long long int ?/=?( unsigned long long int *, unsigned long long int ), ?/=?( volatile unsigned long long int *, unsigned long long int ); 519 520 _Bool ?%=?( _Bool *, _Bool ), ?%=?( volatile _Bool *, _Bool ); 521 char ?%=?( char *, char ), ?%=?( volatile char *, char ); 522 char signed ?%=?( char signed *, char signed ), ?%=?( volatile char signed *, char signed ); 523 char unsigned ?%=?( char unsigned *, char unsigned ), ?%=?( volatile char unsigned *, char unsigned ); 524 int short ?%=?( int short *, int short ), ?%=?( volatile int short *, int short ); 525 int short unsigned ?%=?( int short unsigned *, int short unsigned ), ?%=?( volatile int short unsigned *, int short unsigned ); 526 signed int ?%=?( signed int *, signed int ), ?%=?( volatile signed int *, signed int ); 527 unsigned int ?%=?( unsigned *, unsigned ), ?%=?( volatile unsigned *, unsigned ); 528 signed long int ?%=?( signed long int *, signed long int ), ?%=?( volatile signed long int *, signed long int ); 529 unsigned long int ?%=?( unsigned long int *, unsigned long int ), ?%=?( volatile unsigned long int *, unsigned long int ); 530 signed long long int ?%=?( signed long long int *, signed long long int ), ?%=?( volatile signed long long int *, signed long long int ); 531 unsigned long long int ?%=?( unsigned long long int *, unsigned long long int ), ?%=?( volatile unsigned long long int *, unsigned long long int ); 532 533 _Bool ?+=?( _Bool *, _Bool ), ?+=?( volatile _Bool *, _Bool ); 534 char ?+=?( char *, char ), ?+=?( volatile char *, char ); 535 char signed ?+=?( char signed *, char signed ), ?+=?( volatile char signed *, char signed ); 536 char unsigned ?+=?( char unsigned *, char unsigned ), ?+=?( volatile char unsigned *, char unsigned ); 537 int short ?+=?( int short *, int short ), ?+=?( volatile int short *, int short ); 538 int short unsigned ?+=?( int short unsigned *, int short unsigned ), ?+=?( volatile int short unsigned *, int short unsigned ); 539 signed int ?+=?( signed int *, signed int ), ?+=?( volatile signed int *, signed int ); 540 unsigned int ?+=?( unsigned *, unsigned ), ?+=?( volatile unsigned *, unsigned ); 541 signed long int ?+=?( signed long int *, signed long int ), ?+=?( volatile signed long int *, signed long int ); 542 unsigned long int ?+=?( unsigned long int *, unsigned long int ), ?+=?( volatile unsigned long int *, unsigned long int ); 543 signed long long int ?+=?( signed long long int *, signed long long int ), ?+=?( volatile signed long long int *, signed long long int ); 544 unsigned long long int ?+=?( unsigned long long int *, unsigned long long int ), ?+=?( volatile unsigned long long int *, unsigned long long int ); 545 546 _Bool ?-=?( _Bool *, _Bool ), ?-=?( volatile _Bool *, _Bool ); 547 char ?-=?( char *, char ), ?-=?( volatile char *, char ); 548 char signed ?-=?( char signed *, char signed ), ?-=?( volatile char signed *, char signed ); 549 char unsigned ?-=?( char unsigned *, char unsigned ), ?-=?( volatile char unsigned *, char unsigned ); 550 int short ?-=?( int short *, int short ), ?-=?( volatile int short *, int short ); 551 int short unsigned ?-=?( int short unsigned *, int short unsigned ), ?-=?( volatile int short unsigned *, int short unsigned ); 552 signed int ?-=?( signed int *, signed int ), ?-=?( volatile signed int *, signed int ); 553 unsigned int ?-=?( unsigned *, unsigned ), ?-=?( volatile unsigned *, unsigned ); 554 signed long int ?-=?( signed long int *, signed long int ), ?-=?( volatile signed long int *, signed long int ); 555 unsigned long int ?-=?( unsigned long int *, unsigned long int ), ?-=?( volatile unsigned long int *, unsigned long int ); 556 signed long long int ?-=?( signed long long int *, signed long long int ), ?-=?( volatile signed long long int *, signed long long int ); 557 unsigned long long int ?-=?( unsigned long long int *, unsigned long long int ), ?-=?( volatile unsigned long long int *, unsigned long long int ); 558 559 _Bool ?<<=?( _Bool *, _Bool ), ?<<=?( volatile _Bool *, _Bool ); 560 char ?<<=?( char *, char ), ?<<=?( volatile char *, char ); 561 char signed ?<<=?( char signed *, char signed ), ?<<=?( volatile char signed *, char signed ); 562 char unsigned ?<<=?( char unsigned *, char unsigned ), ?<<=?( volatile char unsigned *, char unsigned ); 563 int short ?<<=?( int short *, int short ), ?<<=?( volatile int short *, int short ); 564 int short unsigned ?<<=?( int short unsigned *, int short unsigned ), ?<<=?( volatile int short unsigned *, int short unsigned ); 565 signed int ?<<=?( signed int *, signed int ), ?<<=?( volatile signed int *, signed int ); 566 unsigned int ?<<=?( unsigned *, unsigned ), ?<<=?( volatile unsigned *, unsigned ); 567 signed long int ?<<=?( signed long int *, signed long int ), ?<<=?( volatile signed long int *, signed long int ); 568 unsigned long int ?<<=?( unsigned long int *, unsigned long int ), ?<<=?( volatile unsigned long int *, unsigned long int ); 569 signed long long int ?<<=?( signed long long int *, signed long long int ), ?<<=?( volatile signed long long int *, signed long long int ); 570 unsigned long long int ?<<=?( unsigned long long int *, unsigned long long int ), ?<<=?( volatile unsigned long long int *, unsigned long long int ); 571 572 _Bool ?>>=?( _Bool *, _Bool ), ?>>=?( volatile _Bool *, _Bool ); 573 char ?>>=?( char *, char ), ?>>=?( volatile char *, char ); 574 char signed ?>>=?( char signed *, char signed ), ?>>=?( volatile char signed *, char signed ); 575 char unsigned ?>>=?( char unsigned *, char unsigned ), ?>>=?( volatile char unsigned *, char unsigned ); 576 int short ?>>=?( int short *, int short ), ?>>=?( volatile int short *, int short ); 577 int short unsigned ?>>=?( int short unsigned *, int short unsigned ), ?>>=?( volatile int short unsigned *, int short unsigned ); 578 signed int ?>>=?( signed int *, signed int ), ?>>=?( volatile signed int *, signed int ); 579 unsigned int ?>>=?( unsigned *, unsigned ), ?>>=?( volatile unsigned *, unsigned ); 580 signed long int ?>>=?( signed long int *, signed long int ), ?>>=?( volatile signed long int *, signed long int ); 581 unsigned long int ?>>=?( unsigned long int *, unsigned long int ), ?>>=?( volatile unsigned long int *, unsigned long int ); 582 signed long long int ?>>=?( signed long long int *, signed long long int ), ?>>=?( volatile signed long long int *, signed long long int ); 583 unsigned long long int ?>>=?( unsigned long long int *, unsigned long long int ), ?>>=?( volatile unsigned long long int *, unsigned long long int ); 584 585 _Bool ?&=?( _Bool *, _Bool ), ?&=?( volatile _Bool *, _Bool ); 586 char ?&=?( char *, char ), ?&=?( volatile char *, char ); 587 char signed ?&=?( char signed *, char signed ), ?&=?( volatile char signed *, char signed ); 588 char unsigned ?&=?( char unsigned *, char unsigned ), ?&=?( volatile char unsigned *, char unsigned ); 589 int short ?&=?( int short *, int short ), ?&=?( volatile int short *, int short ); 590 int short unsigned ?&=?( int short unsigned *, int short unsigned ), ?&=?( volatile int short unsigned *, int short unsigned ); 591 signed int ?&=?( signed int *, signed int ), ?&=?( volatile signed int *, signed int ); 592 unsigned int ?&=?( unsigned *, unsigned ), ?&=?( volatile unsigned *, unsigned ); 593 signed long int ?&=?( signed long int *, signed long int ), ?&=?( volatile signed long int *, signed long int ); 594 unsigned long int ?&=?( unsigned long int *, unsigned long int ), ?&=?( volatile unsigned long int *, unsigned long int ); 595 signed long long int ?&=?( signed long long int *, signed long long int ), ?&=?( volatile signed long long int *, signed long long int ); 596 unsigned long long int ?&=?( unsigned long long int *, unsigned long long int ), ?&=?( volatile unsigned long long int *, unsigned long long int ); 597 598 _Bool ?|=?( _Bool *, _Bool ), ?|=?( volatile _Bool *, _Bool ); 599 char ?|=?( char *, char ), ?|=?( volatile char *, char ); 600 char signed ?|=?( char signed *, char signed ), ?|=?( volatile char signed *, char signed ); 601 char unsigned ?|=?( char unsigned *, char unsigned ), ?|=?( volatile char unsigned *, char unsigned ); 602 int short ?|=?( int short *, int short ), ?|=?( volatile int short *, int short ); 603 int short unsigned ?|=?( int short unsigned *, int short unsigned ), ?|=?( volatile int short unsigned *, int short unsigned ); 604 signed int ?|=?( signed int *, signed int ), ?|=?( volatile signed int *, signed int ); 605 unsigned int ?|=?( unsigned *, unsigned ), ?|=?( volatile unsigned *, unsigned ); 606 signed long int ?|=?( signed long int *, signed long int ), ?|=?( volatile signed long int *, signed long int ); 607 unsigned long int ?|=?( unsigned long int *, unsigned long int ), ?|=?( volatile unsigned long int *, unsigned long int ); 608 signed long long int ?|=?( signed long long int *, signed long long int ), ?|=?( volatile signed long long int *, signed long long int ); 609 unsigned long long int ?|=?( unsigned long long int *, unsigned long long int ), ?|=?( volatile unsigned long long int *, unsigned long long int ); 610 611 _Bool ?^=?( _Bool *, _Bool ), ?^=?( volatile _Bool *, _Bool ); 612 char ?^=?( char *, char ), ?^=?( volatile char *, char ); 613 char signed ?^=?( char signed *, char signed ), ?^=?( volatile char signed *, char signed ); 614 char unsigned ?^=?( char unsigned *, char unsigned ), ?^=?( volatile char unsigned *, char unsigned ); 615 int short ?^=?( int short *, int short ), ?^=?( volatile int short *, int short ); 616 int short unsigned ?^=?( int short unsigned *, int short unsigned ), ?^=?( volatile int short unsigned *, int short unsigned ); 617 signed int ?^=?( signed int *, signed int ), ?^=?( volatile signed int *, signed int ); 618 unsigned int ?^=?( unsigned *, unsigned ), ?^=?( volatile unsigned *, unsigned ); 619 signed long int ?^=?( signed long int *, signed long int ), ?^=?( volatile signed long int *, signed long int ); 620 unsigned long int ?^=?( unsigned long int *, unsigned long int ), ?^=?( volatile unsigned long int *, unsigned long int ); 621 signed long long int ?^=?( signed long long int *, signed long long int ), ?^=?( volatile signed long long int *, signed long long int ); 622 unsigned long long int ?^=?( unsigned long long int *, unsigned long long int ), ?^=?( volatile unsigned long long int *, unsigned long long int ); 623 624 float ?=?( float *, float ), ?=?( volatile float *, float ), 625 ?*=?( float *, float ), ?*=?( volatile float *, float ), 626 ?/=?( float *, float ), ?/=?( volatile float *, float ), 627 ?+=?( float *, float ), ?+=?( volatile float *, float ), 628 ?-=?( float *, float ), ?-=?( volatile float *, float ); 629 630 double ?=?( double *, double ), ?=?( volatile double *, double ), 631 ?*=?( double *, double ), ?*=?( volatile double *, double ), 632 ?/=?( double *, double ), ?/=?( volatile double *, double ), 633 ?+=?( double *, double ), ?+=?( volatile double *, double ), 634 ?-=?( double *, double ), ?-=?( volatile double *, double ); 635 636 long double ?=?( long double *, long double ), ?=?( volatile long double *, long double ), 637 ?*=?( long double *, long double ), ?*=?( volatile long double *, long double ), 638 ?/=?( long double *, long double ), ?/=?( volatile long double *, long double ), 639 ?+=?( long double *, long double ), ?+=?( volatile long double *, long double ), 640 ?-=?( long double *, long double ), ?-=?( volatile long double *, long double ); 641 642 float _Complex ?=?( float _Complex *, float _Complex ), ?=?( volatile float _Complex *, float _Complex ), 643 ?*=?( float _Complex *, float _Complex ), ?*=?( volatile float _Complex *, float _Complex ), 644 ?/=?( float _Complex *, float _Complex ), ?/=?( volatile float _Complex *, float _Complex ), 645 ?+=?( float _Complex *, float _Complex ), ?+=?( volatile float _Complex *, float _Complex ), 646 ?-=?( float _Complex *, float _Complex ), ?-=?( volatile float _Complex *, float _Complex ); 647 648 double _Complex ?=?( double _Complex *, double _Complex ), ?=?( volatile double _Complex *, double _Complex ), 649 ?*=?( double _Complex *, double _Complex ), ?*=?( volatile double _Complex *, double _Complex ), 650 ?/=?( double _Complex *, double _Complex ), ?/=?( volatile double _Complex *, double _Complex ), 651 ?+=?( double _Complex *, double _Complex ), ?+=?( volatile double _Complex *, double _Complex ), 652 ?-=?( double _Complex *, double _Complex ), ?-=?( volatile double _Complex *, double _Complex ); 653 654 long double _Complex ?=?( long double _Complex *, long double _Complex ), ?=?( volatile long double _Complex *, long double _Complex ), 655 ?*=?( long double _Complex *, long double _Complex ), ?*=?( volatile long double _Complex *, long double _Complex ), 656 ?/=?( long double _Complex *, long double _Complex ), ?/=?( volatile long double _Complex *, long double _Complex ), 657 ?+=?( long double _Complex *, long double _Complex ), ?+=?( volatile long double _Complex *, long double _Complex ), 658 ?-=?( long double _Complex *, long double _Complex ), ?-=?( volatile long double _Complex *, long double _Complex ); 659 659 660 660 … … 669 669 670 670 // default ctor 671 void ?{}( _Bool &);672 void ?{}( char &);673 void ?{}( unsigned char &);674 void ?{}( char signed &);675 void ?{}( int short &);676 void ?{}( int short unsigned &);677 void ?{}( signed int &);678 void ?{}( unsigned int &);679 void ?{}( signed long int &);680 void ?{}( unsigned long int &);681 void ?{}( signed long long int &);682 void ?{}( unsigned long long int &);683 void ?{}( float &);684 void ?{}( double &);685 void ?{}( long double &);686 void ?{}( float _Complex &);687 void ?{}( double _Complex &);688 void ?{}( long double _Complex &);689 void ?{}( zero_t &);690 void ?{}( one_t &);671 void ?{}( _Bool * ); 672 void ?{}( char * ); 673 void ?{}( unsigned char * ); 674 void ?{}( char signed * ); 675 void ?{}( int short * ); 676 void ?{}( int short unsigned * ); 677 void ?{}( signed int * ); 678 void ?{}( unsigned int * ); 679 void ?{}( signed long int * ); 680 void ?{}( unsigned long int * ); 681 void ?{}( signed long long int * ); 682 void ?{}( unsigned long long int * ); 683 void ?{}( float * ); 684 void ?{}( double * ); 685 void ?{}( long double * ); 686 void ?{}( float _Complex * ); 687 void ?{}( double _Complex * ); 688 void ?{}( long double _Complex * ); 689 void ?{}( zero_t * ); 690 void ?{}( one_t * ); 691 691 692 692 // copy ctor 693 void ?{}( _Bool &, _Bool );694 void ?{}( char &, char );695 void ?{}( unsigned char &, unsigned char );696 void ?{}( char signed &, char signed );697 void ?{}( int short &, int short );698 void ?{}( int short unsigned &, int short unsigned );699 void ?{}( signed int &, signed int);700 void ?{}( unsigned int &, unsigned int);701 void ?{}( signed long int &, signed long int);702 void ?{}( unsigned long int &, unsigned long int);703 void ?{}( signed long long int &, signed long long int);704 void ?{}( unsigned long long int &, unsigned long long int);705 void ?{}( float &, float);706 void ?{}( double &, double);707 void ?{}( long double &, long double);708 void ?{}( float _Complex &, float _Complex);709 void ?{}( double _Complex &, double _Complex);710 void ?{}( long double _Complex &, long double _Complex);711 void ?{}( zero_t &, zero_t );712 void ?{}( one_t &, one_t );693 void ?{}( _Bool *, _Bool ); 694 void ?{}( char *, char ); 695 void ?{}( unsigned char *, unsigned char ); 696 void ?{}( char signed *, char signed ); 697 void ?{}( int short *, int short ); 698 void ?{}( int short unsigned *, int short unsigned ); 699 void ?{}( signed int *, signed int); 700 void ?{}( unsigned int *, unsigned int); 701 void ?{}( signed long int *, signed long int); 702 void ?{}( unsigned long int *, unsigned long int); 703 void ?{}( signed long long int *, signed long long int); 704 void ?{}( unsigned long long int *, unsigned long long int); 705 void ?{}( float *, float); 706 void ?{}( double *, double); 707 void ?{}( long double *, long double); 708 void ?{}( float _Complex *, float _Complex); 709 void ?{}( double _Complex *, double _Complex); 710 void ?{}( long double _Complex *, long double _Complex); 711 void ?{}( zero_t *, zero_t ); 712 void ?{}( one_t *, one_t ); 713 713 714 714 // dtor 715 void ^?{}( _Bool &);716 void ^?{}( char &);717 void ^?{}( char unsigned &);718 void ^?{}( char signed &);719 void ^?{}( int short &);720 void ^?{}( int short unsigned &);721 void ^?{}( signed int &);722 void ^?{}( unsigned int &);723 void ^?{}( signed long int &);724 void ^?{}( unsigned long int &);725 void ^?{}( signed long long int &);726 void ^?{}( unsigned long long int &);727 void ^?{}( float &);728 void ^?{}( double &);729 void ^?{}( long double &);730 void ^?{}( float _Complex &);731 void ^?{}( double _Complex &);732 void ^?{}( long double _Complex &);733 void ^?{}( zero_t &);734 void ^?{}( one_t &);715 void ^?{}( _Bool * ); 716 void ^?{}( char * ); 717 void ^?{}( char unsigned * ); 718 void ^?{}( char signed * ); 719 void ^?{}( int short * ); 720 void ^?{}( int short unsigned * ); 721 void ^?{}( signed int * ); 722 void ^?{}( unsigned int * ); 723 void ^?{}( signed long int * ); 724 void ^?{}( unsigned long int * ); 725 void ^?{}( signed long long int * ); 726 void ^?{}( unsigned long long int * ); 727 void ^?{}( float * ); 728 void ^?{}( double * ); 729 void ^?{}( long double * ); 730 void ^?{}( float _Complex * ); 731 void ^?{}( double _Complex * ); 732 void ^?{}( long double _Complex * ); 733 void ^?{}( zero_t * ); 734 void ^?{}( one_t * ); 735 735 736 736 // // default ctor … … 754 754 // copied from assignment section 755 755 // copy constructors 756 forall( ftype FT ) void ?{}( FT * &, FT * );757 forall( ftype FT ) void ?{}( FT * volatile &, FT * );758 759 forall( dtype DT ) void ?{}( DT * &, DT * );760 forall( dtype DT ) void ?{}( const DT * &, DT * );761 forall( dtype DT ) void ?{}( const DT * &, const DT * );762 forall( dtype DT ) void ?{}( volatile DT * &, DT * );763 forall( dtype DT ) void ?{}( volatile DT * &, volatile DT * );764 765 forall( dtype DT ) void ?{}( const volatile DT * &, DT * );766 forall( dtype DT ) void ?{}( const volatile DT * &, const DT * );767 forall( dtype DT ) void ?{}( const volatile DT * &, volatile DT * );768 forall( dtype DT ) void ?{}( const volatile DT * &, const volatile DT * );769 770 forall( dtype DT ) void ?{}( DT * &, void * );771 forall( dtype DT ) void ?{}( const DT * &, void * );772 forall( dtype DT ) void ?{}( const DT * &, const void * );773 forall( dtype DT ) void ?{}( volatile DT * &, void * );774 forall( dtype DT ) void ?{}( volatile DT * &, volatile void * );775 776 forall( dtype DT ) void ?{}( const volatile DT * &, void * );777 forall( dtype DT ) void ?{}( const volatile DT * &, const void * );778 forall( dtype DT ) void ?{}( const volatile DT * &, volatile void * );779 forall( dtype DT ) void ?{}( const volatile DT * &, const volatile void * );780 781 forall( dtype DT ) void ?{}( void * &, DT * );782 forall( dtype DT ) void ?{}( const void * &, DT * );783 forall( dtype DT ) void ?{}( const void * &, const DT * );784 forall( dtype DT ) void ?{}( volatile void * &, DT * );785 forall( dtype DT ) void ?{}( volatile void * &, volatile DT * );786 forall( dtype DT ) void ?{}( const volatile void * &, DT * );787 forall( dtype DT ) void ?{}( const volatile void * &, const DT * );788 forall( dtype DT ) void ?{}( const volatile void * &, volatile DT * );789 forall( dtype DT ) void ?{}( const volatile void * &, const volatile DT * );790 791 void ?{}( void * &, void * );792 void ?{}( const void * &, void * );793 void ?{}( const void * &, const void * );794 void ?{}( volatile void * &, void * );795 void ?{}( volatile void * &, volatile void * );796 void ?{}( const volatile void * &, void * );797 void ?{}( const volatile void * &, const void * );798 void ?{}( const volatile void * &, volatile void * );799 void ?{}( const volatile void * &, const volatile void * );800 801 // forall( dtype DT ) void ?{}( DT * &, 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 *);756 forall( ftype FT ) void ?{}( FT **, FT * ); 757 forall( ftype FT ) void ?{}( FT * volatile *, FT * ); 758 759 forall( dtype DT ) void ?{}( DT * *, DT * ); 760 forall( dtype DT ) void ?{}( const DT * *, DT * ); 761 forall( dtype DT ) void ?{}( const DT * *, const DT * ); 762 forall( dtype DT ) void ?{}( volatile DT * *, DT * ); 763 forall( dtype DT ) void ?{}( volatile DT * *, volatile DT * ); 764 765 forall( dtype DT ) void ?{}( const volatile DT * *, DT * ); 766 forall( dtype DT ) void ?{}( const volatile DT * *, const DT * ); 767 forall( dtype DT ) void ?{}( const volatile DT * *, volatile DT * ); 768 forall( dtype DT ) void ?{}( const volatile DT * *, const volatile DT * ); 769 770 forall( dtype DT ) void ?{}( DT * *, void * ); 771 forall( dtype DT ) void ?{}( const DT * *, void * ); 772 forall( dtype DT ) void ?{}( const DT * *, const void * ); 773 forall( dtype DT ) void ?{}( volatile DT * *, void * ); 774 forall( dtype DT ) void ?{}( volatile DT * *, volatile void * ); 775 776 forall( dtype DT ) void ?{}( const volatile DT * *, void * ); 777 forall( dtype DT ) void ?{}( const volatile DT * *, const void * ); 778 forall( dtype DT ) void ?{}( const volatile DT * *, volatile void * ); 779 forall( dtype DT ) void ?{}( const volatile DT * *, const volatile void * ); 780 781 forall( dtype DT ) void ?{}( void * *, DT * ); 782 forall( dtype DT ) void ?{}( const void * *, DT * ); 783 forall( dtype DT ) void ?{}( const void * *, const DT * ); 784 forall( dtype DT ) void ?{}( volatile void * *, DT * ); 785 forall( dtype DT ) void ?{}( volatile void * *, volatile DT * ); 786 forall( dtype DT ) void ?{}( const volatile void * *, DT * ); 787 forall( dtype DT ) void ?{}( const volatile void * *, const DT * ); 788 forall( dtype DT ) void ?{}( const volatile void * *, volatile DT * ); 789 forall( dtype DT ) void ?{}( const volatile void * *, const volatile DT * ); 790 791 void ?{}( void * *, void * ); 792 void ?{}( const void * *, void * ); 793 void ?{}( const void * *, const void * ); 794 void ?{}( volatile void * *, void * ); 795 void ?{}( volatile void * *, volatile void * ); 796 void ?{}( const volatile void * *, void * ); 797 void ?{}( const volatile void * *, const void * ); 798 void ?{}( const volatile void * *, volatile void * ); 799 void ?{}( const volatile void * *, const volatile void * ); 800 801 // //forall( dtype DT ) void ?{}( DT * *, zero_t ); 802 // //forall( dtype DT ) void ?{}( DT * volatile *, zero_t ); 803 // forall( dtype DT ) void ?{}( const DT * *, zero_t ); 804 // //forall( dtype DT ) void ?{}( volatile DT * *, zero_t ); 805 // //forall( dtype DT ) void ?{}( volatile DT * volatile *, zero_t ); 806 // forall( dtype DT ) void ?{}( const volatile DT * *, zero_t ); 807 808 // forall( ftype FT ) void ?{}( FT * *, zero_t ); 809 809 810 810 // default ctors 811 forall( ftype FT ) void ?{}( FT * &);812 813 forall( dtype DT ) void ?{}( DT * &);814 forall( dtype DT ) void ?{}( const DT * &);815 forall( dtype DT ) void ?{}( volatile DT * &);816 forall( dtype DT ) void ?{}( const volatile DT * &);817 818 void ?{}( void * &);819 void ?{}( const void * &);820 void ?{}( volatile void * &);821 void ?{}( const volatile void * &);811 forall( ftype FT ) void ?{}( FT * * ); 812 813 forall( dtype DT ) void ?{}( DT * *); 814 forall( dtype DT ) void ?{}( const DT * *); 815 forall( dtype DT ) void ?{}( volatile DT * *); 816 forall( dtype DT ) void ?{}( const volatile DT * *); 817 818 void ?{}( void * *); 819 void ?{}( const void * *); 820 void ?{}( volatile void * *); 821 void ?{}( const volatile void * *); 822 822 823 823 // dtors 824 forall( ftype FT ) void ^?{}( FT * &);825 826 forall( dtype DT ) void ^?{}( DT * &);827 forall( dtype DT ) void ^?{}( const DT * &);828 forall( dtype DT ) void ^?{}( volatile DT * &);829 forall( dtype DT ) void ^?{}( const volatile DT * &);830 831 void ^?{}( void * &);832 void ^?{}( const void * &);833 void ^?{}( volatile void * &);834 void ^?{}( const volatile void * &);824 forall( ftype FT ) void ^?{}( FT * * ); 825 826 forall( dtype DT ) void ^?{}( DT * *); 827 forall( dtype DT ) void ^?{}( const DT * *); 828 forall( dtype DT ) void ^?{}( volatile DT * *); 829 forall( dtype DT ) void ^?{}( const volatile DT * *); 830 831 void ^?{}( void * *); 832 void ^?{}( const void * *); 833 void ^?{}( volatile void * *); 834 void ^?{}( const volatile void * *); 835 835 836 836 // Local Variables: //
Note:
See TracChangeset
for help on using the changeset viewer.