Changes in / [54cd58b0:9236060]


Ignore:
Location:
src
Files:
1 added
120 edited

Legend:

Unmodified
Added
Removed
  • src/CodeGen/CodeGenerator.cc

    r54cd58b0 r9236060  
    182182                        genCommaList( aggDecl->get_parameters().begin(), aggDecl->get_parameters().end() );
    183183                        output << ")" << endl;
     184                        output << indent;
    184185                }
    185186
     
    321322        void CodeGenerator::visit( __attribute__((unused)) ConstructorInit * init ){
    322323                assertf( ! genC, "ConstructorInit nodes should not reach code generation." );
    323                 // xxx - generate something reasonable for constructor/destructor pairs
    324                 output << "<ctorinit>";
     324                // pseudo-output for constructor/destructor pairs
     325                output << "<ctorinit>{" << std::endl << ++indent << "ctor: ";
     326                maybeAccept( init->get_ctor(), *this );
     327                output << ", " << std::endl << indent << "dtor: ";
     328                maybeAccept( init->get_dtor(), *this );
     329                output << std::endl << --indent << "}";
    325330        }
    326331
     
    336341                        if ( varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic && operatorLookup( varExpr->get_var()->get_name(), opInfo ) ) {
    337342                                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 
    369343                                switch ( opInfo.type ) {
    370344                                  case OT_INDEX:
     
    695669                extension( commaExpr );
    696670                output << "(";
     671                if ( genC ) {
     672                        // arg1 of a CommaExpr is never used, so it can be safely cast to void to reduce gcc warnings.
     673                        commaExpr->set_arg1( new CastExpr( commaExpr->get_arg1() ) );
     674                }
    697675                commaExpr->get_arg1()->accept( *this );
    698676                output << " , ";
     
    758736                for ( Statement * stmt : stmts ) {
    759737                        output << lineDirective( stmt ) << indent;
    760             output << printLabels( stmt->get_labels() );
     738                        output << printLabels( stmt->get_labels() );
    761739                        if ( i+1 == numStmts ) {
    762740                                // last statement in a statement expression needs to be handled specially -
     
    803781        void CodeGenerator::visit( ExprStmt * exprStmt ) {
    804782                assert( exprStmt );
    805                 Expression * expr = exprStmt->get_expr();
    806783                if ( genC ) {
    807784                        // cast the top-level expression to void to reduce gcc warnings.
    808                         expr = new CastExpr( expr );
    809                 }
    810                 expr->accept( *this );
     785                        exprStmt->set_expr( new CastExpr( exprStmt->get_expr() ) );
     786                }
     787                exprStmt->get_expr()->accept( *this );
    811788                output << ";";
    812789        }
  • src/CodeGen/CodeGenerator.h

    r54cd58b0 r9236060  
    1919#include <ostream>                // for ostream, operator<<
    2020#include <string>                 // for string
     21
     22#include "Common/Indenter.h"      // for Indenter
    2123
    2224#include "SynTree/Declaration.h"  // for DeclarationWithType (ptr only), Fun...
  • src/CodeGen/GenType.cc

    r54cd58b0 r9236060  
    3737                virtual void visit( PointerType *pointerType );
    3838                virtual void visit( ArrayType *arrayType );
     39                virtual void visit( ReferenceType *refType );
    3940                virtual void visit( StructInstType *structInst );
    4041                virtual void visit( UnionInstType *unionInst );
     
    147148        }
    148149
     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
    149158        void GenType::visit( FunctionType *funcType ) {
    150159                std::ostringstream os;
  • src/CodeGen/OperatorTable.cc

    r54cd58b0 r9236060  
    1414//
    1515
    16 #include <map>      // for map, _Rb_tree_const_iterator, map<>::const_iterator
    17 #include <utility>  // for pair
     16#include <algorithm>  // for any_of
     17#include <map>        // for map, _Rb_tree_const_iterator, map<>::const_iterator
     18#include <utility>    // for pair
    1819
    1920#include "OperatorTable.h"
     
    9394                } // if
    9495        }
     96
     97        /// determines if a given function name is one of the operator types between [begin, end)
     98        template<typename Iterator>
     99        bool isOperatorType( const std::string & funcName, Iterator begin, Iterator end ) {
     100                OperatorInfo info;
     101                if ( operatorLookup( funcName, info ) ) {
     102                        return std::find( begin, end, info.type ) != end;
     103                }
     104                return false;
     105        }
     106
     107        bool isConstructor( const std::string & funcName ) {
     108                static OperatorType types[] = { OT_CTOR };
     109                return isOperatorType( funcName, std::begin(types), std::end(types) );
     110        }
     111
     112        bool isDestructor( const std::string & funcName ) {
     113                static OperatorType types[] = { OT_DTOR };
     114                return isOperatorType( funcName, std::begin(types), std::end(types) );
     115        }
     116
     117        bool isAssignment( const std::string & funcName ) {
     118                static OperatorType types[] = { OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };
     119                return isOperatorType( funcName, std::begin(types), std::end(types) );
     120        }
     121
     122        bool isCtorDtor( const std::string & funcName ) {
     123                static OperatorType types[] = { OT_CTOR, OT_DTOR };
     124                return isOperatorType( funcName, std::begin(types), std::end(types) );
     125        }
     126
     127        bool isCtorDtorAssign( const std::string & funcName ) {
     128                static OperatorType types[] = { OT_CTOR, OT_DTOR, OT_PREFIXASSIGN, OT_POSTFIXASSIGN, OT_INFIXASSIGN };
     129                return isOperatorType( funcName, std::begin(types), std::end(types) );
     130        }
    95131} // namespace CodeGen
    96132
  • src/CodeGen/OperatorTable.h

    r54cd58b0 r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // OperatorTable.h -- 
     7// OperatorTable.h --
    88//
    99// Author           : Richard C. Bilson
     
    4242
    4343        bool operatorLookup( std::string funcName, OperatorInfo &info );
     44
     45        bool isConstructor( const std::string & );
     46        bool isDestructor( const std::string & );
     47        bool isAssignment( const std::string & );
     48        bool isCtorDtor( const std::string & );
     49        bool isCtorDtorAssign( const std::string & );
    4450} // namespace CodeGen
    4551
  • src/Common/PassVisitor.h

    r54cd58b0 r9236060  
    114114        virtual void visit( PointerType *pointerType ) override final;
    115115        virtual void visit( ArrayType *arrayType ) override final;
     116        virtual void visit( ReferenceType *referenceType ) override final;
    116117        virtual void visit( FunctionType *functionType ) override final;
    117118        virtual void visit( StructInstType *aggregateUseType ) override final;
     
    200201        virtual Type* mutate( PointerType *pointerType ) override final;
    201202        virtual Type* mutate( ArrayType *arrayType ) override final;
     203        virtual Type* mutate( ReferenceType *referenceType ) override final;
    202204        virtual Type* mutate( FunctionType *functionType ) override final;
    203205        virtual Type* mutate( StructInstType *aggregateUseType ) override final;
  • src/Common/PassVisitor.impl.h

    r54cd58b0 r9236060  
    792792
    793793template< typename pass_type >
     794void PassVisitor< pass_type >::visit( ReferenceType * node ) {
     795        VISIT_BODY( node );
     796}
     797
     798template< typename pass_type >
    794799void PassVisitor< pass_type >::visit( FunctionType * node ) {
    795800        VISIT_BODY( node );
     
    11291134
    11301135template< typename pass_type >
     1136Type * PassVisitor< pass_type >::mutate( ReferenceType * node ) {
     1137        MUTATE_BODY( Type, node );
     1138}
     1139
     1140template< typename pass_type >
    11311141Type * PassVisitor< pass_type >::mutate( FunctionType * node ) {
    11321142        MUTATE_BODY( Type, node );
  • src/Common/utility.h

    r54cd58b0 r9236060  
    309309template< typename T1, typename T2 >
    310310struct group_iterate_t {
    311         group_iterate_t( const T1 & v1, const T2 & v2 ) : args(v1, v2) {
    312                 assertf(v1.size() == v2.size(), "group iteration requires containers of the same size.");
     311        group_iterate_t( bool skipBoundsCheck, const T1 & v1, const T2 & v2 ) : args(v1, v2) {
     312                assertf(skipBoundsCheck || v1.size() == v2.size(), "group iteration requires containers of the same size: <%lu, %lu>.", v1.size(), v2.size());
    313313        };
    314314
     
    335335};
    336336
     337/// performs bounds check to ensure that all arguments are of the same length.
    337338template< typename... Args >
    338339group_iterate_t<Args...> group_iterate( Args &&... args ) {
    339         return group_iterate_t<Args...>(std::forward<Args>( args )...);
     340        return group_iterate_t<Args...>(false, std::forward<Args>( args )...);
     341}
     342
     343/// does not perform a bounds check - requires user to ensure that iteration terminates when appropriate.
     344template< typename... Args >
     345group_iterate_t<Args...> unsafe_group_iterate( Args &&... args ) {
     346        return group_iterate_t<Args...>(true, std::forward<Args>( args )...);
    340347}
    341348
  • src/Concurrency/Keywords.cc

    r54cd58b0 r9236060  
    2121#include "Common/SemanticError.h"  // for SemanticError
    2222#include "Common/utility.h"        // for deleteAll, map_range
    23 #include "InitTweak/InitTweak.h"   // for isConstructor
     23#include "CodeGen/OperatorTable.h" // for isConstructor
     24#include "InitTweak/InitTweak.h"   // for getPointerBase
    2425#include "Parser/LinkageSpec.h"    // for Cforall
    2526#include "SymTab/AddVisit.h"       // for acceptAndAdd
     
    289290                        LinkageSpec::Cforall,
    290291                        nullptr,
    291                         new PointerType(
     292                        new ReferenceType(
    292293                                noQualifiers,
    293294                                new StructInstType(
     
    445446
    446447                //Makes sure it's not a copy
    447                 PointerType* pty = dynamic_cast< PointerType * >( ty );
    448                 if( ! pty ) throw SemanticError( "Mutex argument must be of pointer/reference type ", arg );
     448                ReferenceType* rty = dynamic_cast< ReferenceType * >( ty );
     449                if( ! rty ) throw SemanticError( "Mutex argument must be of reference type ", arg );
    449450
    450451                //Make sure the we are pointing directly to a type
    451                 Type* base = pty->get_base();
    452                 if(  dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
     452                Type* base = rty->get_base();
     453                if( dynamic_cast< ReferenceType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
     454                if( dynamic_cast< PointerType * >( base ) ) throw SemanticError( "Mutex argument have exactly one level of indirection ", arg );
    453455
    454456                //Make sure that typed isn't mutex
     
    520522                Visitor::visit(decl);
    521523
    522                 if( ! InitTweak::isConstructor(decl->get_name()) ) return;
     524                if( ! CodeGen::isConstructor(decl->get_name()) ) return;
    523525
    524526                DeclarationWithType * param = decl->get_functionType()->get_parameters().front();
    525                 auto ptr = dynamic_cast< PointerType * >( param->get_type() );
    526                 // if( ptr ) std::cerr << "FRED1" << std::endl;
    527                 auto type  = dynamic_cast< StructInstType * >( ptr->get_base() );
     527                auto type  = dynamic_cast< StructInstType * >( InitTweak::getPointerBase( param->get_type() ) );
    528528                // if( type ) std::cerr << "FRED2" << std::endl;
    529529                if( type && type->get_baseStruct()->is_thread() ) {
  • src/GenPoly/Box.cc

    r54cd58b0 r9236060  
    5656#include "Common/UniqueName.h"
    5757#include "Common/utility.h"
     58
     59#include "CodeGen/OperatorTable.h"
    5860
    5961#include "InitTweak/InitTweak.h"
     
    570572                        // To compound the issue, the right side can be *x, etc. because of lvalue-returning functions
    571573                        if ( UntypedExpr * assign = dynamic_cast< UntypedExpr * >( commaExpr->get_arg1() ) ) {
    572                                 if ( InitTweak::isAssignment( InitTweak::getFunctionName( assign ) ) ) {
     574                                if ( CodeGen::isAssignment( InitTweak::getFunctionName( assign ) ) ) {
    573575                                        assert( assign->get_args().size() == 2 );
    574576                                        if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( assign->get_args().back() ) ) {
     
    610612                                                }
    611613                                        } else {
    612                                                 throw SemanticError( "Cannot pass non-struct type for generic struct" );
     614                                                throw SemanticError( "Cannot pass non-struct type for generic struct: ", argBaseType );
    613615                                        }
    614616                                }
     
    10251027                                                } // if
    10261028                                                if ( baseType1 || baseType2 ) {
     1029                                                        delete ret->get_result();
    10271030                                                        ret->set_result( appExpr->get_result()->clone() );
    10281031                                                        if ( appExpr->get_env() ) {
     
    10381041                                                assert( ! appExpr->get_args().empty() );
    10391042                                                if ( isPolyType( appExpr->get_result(), scopeTyVars, env ) ) {
     1043                                                        // remove dereference from polymorphic types since they are boxed.
    10401044                                                        Expression *ret = appExpr->get_args().front();
     1045                                                        // fix expr type to remove pointer
    10411046                                                        delete ret->get_result();
    10421047                                                        ret->set_result( appExpr->get_result()->clone() );
     
    11281133
    11291134                        assert( appExpr->get_function()->has_result() );
    1130                         PointerType *pointer = safe_dynamic_cast< PointerType *>( appExpr->get_function()->get_result() );
    1131                         FunctionType *function = safe_dynamic_cast< FunctionType *>( pointer->get_base() );
     1135                        FunctionType * function = getFunctionType( appExpr->get_function()->get_result() );
     1136                        assertf( function, "ApplicationExpr has non-function type: %s", toString( appExpr->get_function()->get_result() ).c_str() );
    11321137
    11331138                        if ( Expression *newExpr = handleIntrinsics( appExpr ) ) {
     
    12061211                                                        if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * >( expr->get_args().front() ) ) {
    12071212                                                                assert( appExpr->get_function()->has_result() );
    1208                                                                 PointerType *pointer = safe_dynamic_cast< PointerType *>( appExpr->get_function()->get_result() );
    1209                                                                 FunctionType *function = safe_dynamic_cast< FunctionType *>( pointer->get_base() );
     1213                                                                FunctionType *function = getFunctionType( appExpr->get_function()->get_result() );
     1214                                                                assert( function );
    12101215                                                                needs = needsAdapter( function, scopeTyVars );
    12111216                                                        } // if
     
    12161221                        // isPolyType check needs to happen before mutating addrExpr arg, so pull it forward
    12171222                        // out of the if condition.
     1223                        addrExpr->set_arg( mutateExpression( addrExpr->get_arg() ) );
     1224                        // ... but must happen after mutate, since argument might change (e.g. intrinsic *?, ?[?]) - re-evaluate above comment
    12181225                        bool polytype = isPolyType( addrExpr->get_arg()->get_result(), scopeTyVars, env );
    1219                         addrExpr->set_arg( mutateExpression( addrExpr->get_arg() ) );
    12201226                        if ( polytype || needs ) {
    12211227                                Expression *ret = addrExpr->get_arg();
     
    12841290                                if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
    12851291                                        std::string adapterName = makeAdapterName( mangleName );
    1286                                         paramList.push_front( new ObjectDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
     1292                                        // adapter may not be used in body, pass along with unused attribute.
     1293                                        paramList.push_front( new ObjectDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0, { new Attribute( "unused" ) } ) );
    12871294                                        adaptersDone.insert( adaptersDone.begin(), mangleName );
    12881295                                }
     
    13901397                        std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin();
    13911398                        std::list< DeclarationWithType *> inferredParams;
    1392                         ObjectDecl newObj( "", Type::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
     1399                        // size/align/offset parameters may not be used in body, pass along with unused attribute.
     1400                        ObjectDecl newObj( "", Type::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0,
     1401                                           { new Attribute( "unused" ) } );
    13931402                        ObjectDecl newPtr( "", Type::StorageClasses(), LinkageSpec::C, 0,
    13941403                                           new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 );
     
    14131422                                for ( std::list< DeclarationWithType *>::iterator assert = (*tyParm)->get_assertions().begin(); assert != (*tyParm)->get_assertions().end(); ++assert ) {
    14141423//      *assert = (*assert)->acceptMutator( *this );
     1424                                        // assertion parameters may not be used in body, pass along with unused attribute.
     1425                                        (*assert)->get_attributes().push_back( new Attribute( "unused" ) );
    14151426                                        inferredParams.push_back( *assert );
    14161427                                }
  • src/GenPoly/Lvalue.cc

    r54cd58b0 r9236060  
    2727#include "SynTree/Mutator.h"
    2828#include "SymTab/Indexer.h"
     29#include "SymTab/Autogen.h"
    2930
    3031#include "ResolvExpr/Resolver.h"
     
    3536#include "Common/UniqueName.h"
    3637#include "Common/utility.h"
     38#include "Common/PassVisitor.h"
     39
     40#include "InitTweak/InitTweak.h"
     41
     42#if 0
     43#define PRINT(x) x
     44#else
     45#define PRINT(x)
     46#endif
    3747
    3848namespace GenPoly {
    3949        namespace {
    40                 /// Replace uses of lvalue returns with appropriate pointers
    41                 class Pass1 : public Mutator {
    42                   public:
    43                         Pass1();
    44 
    45                         virtual Expression *mutate( ApplicationExpr *appExpr );
    46                         virtual Statement *mutate( ReturnStmt *appExpr );
    47                         virtual DeclarationWithType *mutate( FunctionDecl *funDecl );
    48                   private:
    49                         DeclarationWithType* retval;
    50                 };
    51 
    52                 /// Replace declarations of lvalue returns with appropriate pointers
    53                 class Pass2 : public Visitor {
    54                   public:
    55                         virtual void visit( FunctionType *funType );
    56                   private:
     50                // TODO: fold this into the general createDeref function??
     51                Expression * mkDeref( Expression * arg ) {
     52                        if ( SymTab::dereferenceOperator ) {
     53                                VariableExpr * deref = new VariableExpr( SymTab::dereferenceOperator );
     54                                deref->set_result( new PointerType( Type::Qualifiers(), deref->get_result() ) );
     55                                Type * base = InitTweak::getPointerBase( arg->get_result() );
     56                                assertf( base, "expected pointer type in dereference (type was %s)", toString( arg->get_result() ).c_str() );
     57                                ApplicationExpr * ret = new ApplicationExpr( deref, { arg } );
     58                                delete ret->get_result();
     59                                ret->set_result( base->clone() );
     60                                ret->get_result()->set_lvalue( true );
     61                                return ret;
     62                        } else {
     63                                return UntypedExpr::createDeref( arg );
     64                        }
     65                }
     66
     67                struct ReferenceConversions final {
     68                        Expression * postmutate( CastExpr * castExpr );
     69                        Expression * postmutate( AddressExpr * addrExpr );
     70                };
     71
     72                /// Intrinsic functions that take reference parameters don't REALLY take reference parameters -- their reference arguments must always be implicitly dereferenced.
     73                struct FixIntrinsicArgs final {
     74                        Expression * postmutate( ApplicationExpr * appExpr );
     75                };
     76
     77                struct FixIntrinsicResult final {
     78                        Expression * postmutate( ApplicationExpr * appExpr );
     79                };
     80
     81                /// Replace reference types with pointer types
     82                struct ReferenceTypeElimination final {
     83                        Type * postmutate( ReferenceType * refType );
    5784                };
    5885
     
    6087                /// https://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Lvalues.html#Lvalues
    6188                /// Replaces &(a,b) with (a, &b), &(a ? b : c) with (a ? &b : &c)
    62                 class GeneralizedLvalue : public Mutator {
    63                         typedef Mutator Parent;
    64 
    65                         virtual Expression * mutate( MemberExpr * memExpr );
    66                         virtual Expression * mutate( AddressExpr * addressExpr );
     89                struct GeneralizedLvalue final : public WithVisitorRef<GeneralizedLvalue> {
     90                        Expression * postmutate( AddressExpr * addressExpr );
     91                        Expression * postmutate( MemberExpr * memExpr );
    6792
    6893                        template<typename Func>
    6994                        Expression * applyTransformation( Expression * expr, Expression * arg, Func mkExpr );
    7095                };
     96
     97                /// Removes redundant &*/*& pattern that this pass can generate
     98                struct CollapseAddrDeref final {
     99                        Expression * postmutate( AddressExpr * addressExpr );
     100                        Expression * postmutate( ApplicationExpr * appExpr );
     101                };
     102
     103                struct AddrRef final : public WithGuards {
     104                        void premutate( AddressExpr * addrExpr );
     105                        Expression * postmutate( AddressExpr * addrExpr );
     106                        void premutate( Expression * expr );
     107
     108                        bool first = true;
     109                        bool current = false;
     110                        int refDepth = 0;
     111                };
    71112        } // namespace
    72113
     114        static bool referencesEliminated = false;
     115        // used by UntypedExpr::createDeref to determine whether result type of dereference should be ReferenceType or value type.
     116        bool referencesPermissable() {
     117                return ! referencesEliminated;
     118        }
     119
    73120        void convertLvalue( std::list< Declaration* >& translationUnit ) {
    74                 Pass1 p1;
    75                 Pass2 p2;
    76                 GeneralizedLvalue genLval;
    77                 mutateAll( translationUnit, p1 );
    78                 acceptAll( translationUnit, p2 );
     121                std::cerr << "convertLvalue" << std::endl;
     122                PassVisitor<ReferenceConversions> refCvt;
     123                PassVisitor<ReferenceTypeElimination> elim;
     124                PassVisitor<GeneralizedLvalue> genLval;
     125                PassVisitor<FixIntrinsicArgs> fixer;
     126                PassVisitor<CollapseAddrDeref> collapser;
     127                PassVisitor<AddrRef> addrRef;
     128                PassVisitor<FixIntrinsicResult> intrinsicResults;
     129                mutateAll( translationUnit, intrinsicResults );
     130                mutateAll( translationUnit, addrRef );
     131                mutateAll( translationUnit, refCvt );
     132                mutateAll( translationUnit, fixer );
     133                mutateAll( translationUnit, collapser );
    79134                mutateAll( translationUnit, genLval );
     135                mutateAll( translationUnit, elim );  // last because other passes need reference types to work
     136
     137                // from this point forward, no other pass should create reference types.
     138                referencesEliminated = true;
    80139        }
    81140
    82141        Expression * generalizedLvalue( Expression * expr ) {
    83                 GeneralizedLvalue genLval;
     142                PassVisitor<GeneralizedLvalue> genLval;
    84143                return expr->acceptMutator( genLval );
    85144        }
    86145
    87146        namespace {
    88                 Type* isLvalueRet( FunctionType *function ) {
    89                         if ( function->get_returnVals().empty() ) return 0;
    90                         Type *ty = function->get_returnVals().front()->get_type();
    91                         return ty->get_lvalue() ? ty : 0;
    92                 }
    93 
    94                 bool isIntrinsicApp( ApplicationExpr *appExpr ) {
    95                         if ( VariableExpr *varExpr = dynamic_cast< VariableExpr* >( appExpr->get_function() ) ) {
    96                                 return varExpr->get_var()->get_linkage() == LinkageSpec::Intrinsic;
    97                         } else {
    98                                 return false;
    99                         } // if
    100                 }
    101 
    102                 Pass1::Pass1() {
    103                 }
    104 
    105                 DeclarationWithType * Pass1::mutate( FunctionDecl *funcDecl ) {
    106                         if ( funcDecl->get_statements() ) {
    107                                 DeclarationWithType* oldRetval = retval;
    108                                 retval = 0;
    109                                 if ( ! LinkageSpec::isBuiltin( funcDecl->get_linkage() ) && isLvalueRet( funcDecl->get_functionType() ) ) {
    110                                         retval = funcDecl->get_functionType()->get_returnVals().front();
    111                                 }
    112                                 // fix expressions and return statements in this function
    113                                 funcDecl->set_statements( funcDecl->get_statements()->acceptMutator( *this ) );
    114                                 retval = oldRetval;
    115                         } // if
    116                         return funcDecl;
    117                 }
    118 
    119                 Expression * Pass1::mutate( ApplicationExpr *appExpr ) {
    120                         appExpr->get_function()->acceptMutator( *this );
    121                         mutateAll( appExpr->get_args(), *this );
    122 
    123                         PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
    124                         FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
    125 
    126                         Type *funType = isLvalueRet( function );
    127                         if ( funType && ! isIntrinsicApp( appExpr ) ) {
    128                                 Expression *expr = appExpr;
    129                                 Type *appType = appExpr->get_result();
    130                                 if ( isPolyType( funType ) && ! isPolyType( appType ) ) {
    131                                         // make sure cast for polymorphic type is inside dereference
    132                                         expr = new CastExpr( appExpr, new PointerType( Type::Qualifiers(), appType->clone() ) );
    133                                 }
    134                                 UntypedExpr *deref = new UntypedExpr( new NameExpr( "*?" ) );
    135                                 deref->set_result( appType->clone() );
    136                                 appExpr->set_result( new PointerType( Type::Qualifiers(), appType ) );
    137                                 deref->get_args().push_back( expr );
    138                                 return deref;
    139                         } else {
    140                                 return appExpr;
    141                         } // if
    142                 }
    143 
    144                 Statement * Pass1::mutate(ReturnStmt *retStmt) {
    145                         if ( retval && retStmt->get_expr() ) {
    146                                 if ( retStmt->get_expr()->get_result()->get_lvalue() ) {
    147                                         // ***** Code Removal ***** because casts may be stripped already
    148 
    149                                         // strip casts because not allowed to take address of cast
    150                                         // while ( CastExpr *castExpr = dynamic_cast< CastExpr* >( retStmt->get_expr() ) ) {
    151                                         //      retStmt->set_expr( castExpr->get_arg() );
    152                                         //      retStmt->get_expr()->set_env( castExpr->get_env() );
    153                                         //      castExpr->set_env( 0 );
    154                                         //      castExpr->set_arg( 0 );
    155                                         //      delete castExpr;
    156                                         // } // while
    157                                         retStmt->set_expr( new AddressExpr( retStmt->get_expr()->acceptMutator( *this ) ) );
     147                // true for intrinsic function calls that return a reference
     148                bool isIntrinsicReference( Expression * expr ) {
     149                        if ( UntypedExpr * untyped = dynamic_cast< UntypedExpr * >( expr ) ) {
     150                                std::string fname = InitTweak::getFunctionName( untyped );
     151                                // known intrinsic-reference prelude functions
     152                                return fname == "*?" || fname == "?[?]";
     153                        } else if ( ApplicationExpr * appExpr = dynamic_cast< ApplicationExpr * > ( expr ) ) {
     154                                if ( DeclarationWithType * func = InitTweak::getFunction( appExpr ) ) {
     155                                        // use type of return variable rather than expr result type, since it may have been changed to a pointer type
     156                                        FunctionType * ftype = GenPoly::getFunctionType( func->get_type() );
     157                                        Type * ret = ftype->get_returnVals().empty() ? nullptr : ftype->get_returnVals().front()->get_type();
     158                                        return func->get_linkage() == LinkageSpec::Intrinsic && dynamic_cast<ReferenceType *>( ret );
     159                                }
     160                        }
     161                        return false;
     162                }
     163
     164                Expression * FixIntrinsicResult::postmutate( ApplicationExpr * appExpr ) {
     165                        if ( isIntrinsicReference( appExpr ) ) {
     166                                // eliminate reference types from intrinsic applications - now they return lvalues
     167                                Type * result = appExpr->get_result();
     168                                appExpr->set_result( result->stripReferences()->clone() );
     169                                appExpr->get_result()->set_lvalue( true );
     170                                Expression * ret = new CastExpr( appExpr, result );
     171                                ret->set_env( appExpr->get_env() );
     172                                appExpr->set_env( nullptr );
     173                                return ret;
     174                        }
     175                        return appExpr;
     176                }
     177
     178                Expression * FixIntrinsicArgs::postmutate( ApplicationExpr * appExpr ) {
     179                        // intrinsic functions don't really take reference-typed parameters, so they require an implicit dereference on their arguments.
     180                        if ( DeclarationWithType * function = InitTweak::getFunction( appExpr ) ) {
     181                                FunctionType * ftype = GenPoly::getFunctionType( function->get_type() );
     182                                assertf( ftype, "Function declaration does not have function type." );
     183                                // can be of differing lengths only when function is variadic
     184                                assertf( ftype->get_parameters().size() == appExpr->get_args().size() || ftype->get_isVarArgs(), "ApplicationExpr args do not match formal parameter type." );
     185
     186
     187                                unsigned int i = 0;
     188                                const unsigned int end = ftype->get_parameters().size();
     189                                for ( auto p : unsafe_group_iterate( appExpr->get_args(), ftype->get_parameters() ) ) {
     190                                        if (i == end) break;
     191                                        Expression *& arg = std::get<0>( p );
     192                                        Type * formal = std::get<1>( p )->get_type();
     193                                        PRINT(
     194                                                std::cerr << "pair<0>: " << arg << std::endl;
     195                                                std::cerr << "pair<1>: " << formal << std::endl;
     196                                        )
     197                                        if ( dynamic_cast<ReferenceType*>( formal ) ) {
     198                                                if ( isIntrinsicReference( arg ) ) { // do not combine conditions, because that changes the meaning of the else if
     199                                                        if ( function->get_linkage() != LinkageSpec::Intrinsic ) { // intrinsic functions that turn pointers into references
     200                                                                // if argument is dereference or array subscript, the result isn't REALLY a reference, so it's not necessary to fix the argument
     201                                                                PRINT(
     202                                                                        std::cerr << "===is intrinsic arg in non-intrinsic call - adding address" << std::endl;
     203                                                                )
     204                                                                arg = new AddressExpr( arg );
     205                                                        }
     206                                                } else if ( function->get_linkage() == LinkageSpec::Intrinsic ) {
     207                                                        // std::cerr << "===adding deref to arg" << std::endl;
     208                                                        // if the parameter is a reference, add a dereference to the reference-typed argument.
     209                                                        Type * baseType = InitTweak::getPointerBase( arg->get_result() );
     210                                                        assertf( baseType, "parameter is reference, arg must be pointer or reference: %s", toString( arg->get_result() ).c_str() );
     211                                                        PointerType * ptrType = new PointerType( Type::Qualifiers(), baseType->clone() );
     212                                                        delete arg->get_result();
     213                                                        arg->set_result( ptrType );
     214                                                        arg = mkDeref( arg );
     215                                                }
     216                                        }
     217                                        ++i;
     218                                }
     219                        }
     220                        return appExpr;
     221                }
     222
     223                // idea: &&&E: get outer &, inner &
     224                // at inner &, record depth D of reference type
     225                // at outer &, add D derefs.
     226                void AddrRef::premutate( Expression * expr ) {
     227                        GuardValue( current );
     228                        GuardValue( first );
     229                        current = false;
     230                        first = true;
     231                }
     232
     233                void AddrRef::premutate( AddressExpr * addrExpr ) {
     234                        GuardValue( current );
     235                        GuardValue( first );
     236                        current = first;
     237                        first = false;
     238                        if ( current ) {
     239                                GuardValue( refDepth );
     240                                refDepth = 0;
     241                        }
     242                }
     243
     244                Expression * AddrRef::postmutate( AddressExpr * addrExpr ) {
     245                        if ( refDepth == 0 ) {
     246                                if ( ! isIntrinsicReference( addrExpr->get_arg() ) ) {
     247                                        // try to avoid ?[?]
     248                                        refDepth = addrExpr->get_arg()->get_result()->referenceDepth();
     249                                }
     250                        }
     251                        if ( current ) {
     252                                Expression * ret = addrExpr;
     253                                while ( refDepth ) {
     254                                        ret = mkDeref( ret );
     255                                        refDepth--;
     256                                }
     257                                return ret;
     258                        }
     259                        return addrExpr;
     260                }
     261
     262                Expression * ReferenceConversions::postmutate( AddressExpr * addrExpr ) {
     263                        // Inner expression may have been lvalue to reference conversion, which becomes an address expression.
     264                        // In this case, remove the outer address expression and return the argument.
     265                        // TODO: It's possible that this might catch too much and require a more sophisticated check.
     266                        return addrExpr;
     267                }
     268
     269                Expression * ReferenceConversions::postmutate( CastExpr * castExpr ) {
     270                        // xxx - is it possible to convert directly between reference types with a different base? E.g.,
     271                        //   int x;
     272                        //   (double&)x;
     273                        // At the moment, I am working off of the assumption that this is illegal, thus the cast becomes redundant
     274                        // after this pass, so trash the cast altogether. If that changes, care must be taken to insert the correct
     275                        // pointer casts in the right places.
     276
     277                        // conversion to reference type
     278                        if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_result() ) ) {
     279                                (void)refType;
     280                                if ( ReferenceType * otherRef = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) {
     281                                        // nothing to do if casting from reference to reference.
     282                                        (void)otherRef;
     283                                        PRINT( std::cerr << "convert reference to reference -- nop" << std::endl; )
     284                                        if ( isIntrinsicReference( castExpr->get_arg() ) ) {
     285                                                Expression * callExpr = castExpr->get_arg();
     286                                                PRINT(
     287                                                        std::cerr << "but arg is deref -- &" << std::endl;
     288                                                        std::cerr << callExpr << std::endl;
     289                                                )
     290                                                callExpr = new AddressExpr( callExpr ); // this doesn't work properly for multiple casts
     291                                                delete callExpr->get_result();
     292                                                callExpr->set_result( refType->clone() );
     293                                                // move environment out to new top-level
     294                                                callExpr->set_env( castExpr->get_env() );
     295                                                castExpr->set_arg( nullptr );
     296                                                castExpr->set_env( nullptr );
     297                                                delete castExpr;
     298                                                return callExpr;
     299                                        }
     300                                        int depth1 = refType->referenceDepth();
     301                                        int depth2 = otherRef->referenceDepth();
     302                                        assertf( depth1 == depth2, "non-intrinsic reference with cast of reference to reference not yet supported: %d %d %s", depth1, depth2, toString( castExpr ).c_str() );
     303                                        PRINT( std::cerr << castExpr << std::endl; )
     304                                        return castExpr;
     305                                } else if ( castExpr->get_arg()->get_result()->get_lvalue() ) {
     306                                        // conversion from lvalue to reference
     307                                        // xxx - keep cast, but turn into pointer cast??
     308                                        // xxx - memory
     309                                        PRINT(
     310                                                std::cerr << "convert lvalue to reference -- &" << std::endl;
     311                                                std::cerr << castExpr->get_arg() << std::endl;
     312                                        )
     313                                        AddressExpr * ret = new AddressExpr( castExpr->get_arg() );
     314                                        if ( refType->get_base()->get_qualifiers() != castExpr->get_arg()->get_result()->get_qualifiers() ) {
     315                                                // must keep cast if cast-to type is different from the actual type
     316                                                castExpr->set_arg( ret );
     317                                                return castExpr;
     318                                        }
     319                                        ret->set_env( castExpr->get_env() );
     320                                        delete ret->get_result();
     321                                        ret->set_result( castExpr->get_result() );
     322                                        castExpr->set_env( nullptr );
     323                                        castExpr->set_arg( nullptr );
     324                                        castExpr->set_result( nullptr );
     325                                        delete castExpr;
     326                                        return ret;
    158327                                } else {
    159                                         throw SemanticError( "Attempt to return non-lvalue from an lvalue-qualified function" );
    160                                 } // if
    161                         } // if
    162                         return retStmt;
    163                 }
    164 
    165                 void Pass2::visit( FunctionType *funType ) {
    166                         std::string typeName;
    167                         if ( isLvalueRet( funType ) ) {
    168                                 DeclarationWithType *retParm = funType->get_returnVals().front();
    169 
    170                                 // make a new parameter that is a pointer to the type of the old return value
    171                                 retParm->set_type( new PointerType( Type::Qualifiers(), retParm->get_type() ) );
    172                         } // if
    173 
    174                         Visitor::visit( funType );
     328                                        // rvalue to reference conversion -- introduce temporary
     329                                }
     330                                assertf( false, "Only conversions to reference from lvalue are currently supported: %s", toString( castExpr ).c_str() );
     331                        } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( castExpr->get_arg()->get_result() ) ) {
     332                                (void)refType;
     333                                // conversion from reference to rvalue
     334                                PRINT(
     335                                        std::cerr << "convert reference to rvalue -- *" << std::endl;
     336                                        std::cerr << "was = " << castExpr << std::endl;
     337                                )
     338                                Expression * ret = castExpr->get_arg();
     339                                TypeSubstitution * env = castExpr->get_env();
     340                                castExpr->set_env( nullptr );
     341                                if ( ! isIntrinsicReference( ret ) ) {
     342                                        // dereference if not already dereferenced
     343                                        ret = mkDeref( ret );
     344                                }
     345                                if ( ResolvExpr::typesCompatibleIgnoreQualifiers( castExpr->get_result(), castExpr->get_arg()->get_result()->stripReferences(), SymTab::Indexer() ) ) {
     346                                        // can remove cast if types are compatible, changing expression type to value type
     347                                        ret->set_result( castExpr->get_result()->clone() );
     348                                        castExpr->set_arg( nullptr );
     349                                        delete castExpr;
     350                                } else {
     351                                        // must keep cast if types are different
     352                                        castExpr->set_arg( ret );
     353                                        ret = castExpr;
     354                                }
     355                                ret->set_env( env );
     356                                PRINT( std::cerr << "now: " << ret << std::endl; )
     357                                return ret;
     358                        }
     359                        return castExpr;
     360                }
     361
     362                Type * ReferenceTypeElimination::postmutate( ReferenceType * refType ) {
     363                        Type * base = refType->get_base();
     364                        Type::Qualifiers qualifiers = refType->get_qualifiers();
     365                        refType->set_base( nullptr );
     366                        delete refType;
     367                        return new PointerType( qualifiers, base );
    175368                }
    176369
     
    180373                                Expression * arg1 = commaExpr->get_arg1()->clone();
    181374                                Expression * arg2 = commaExpr->get_arg2()->clone();
    182                                 Expression * ret = new CommaExpr( arg1, mkExpr( arg2 ) );
     375                                Expression * ret = new CommaExpr( arg1, mkExpr( arg2 )->acceptMutator( *visitor ) );
    183376                                ret->set_env( expr->get_env() );
    184377                                expr->set_env( nullptr );
    185378                                delete expr;
    186                                 return ret->acceptMutator( *this );
     379                                return ret;
    187380                        } else if ( ConditionalExpr * condExpr = dynamic_cast< ConditionalExpr * >( arg ) ) {
    188381                                Expression * arg1 = condExpr->get_arg1()->clone();
    189382                                Expression * arg2 = condExpr->get_arg2()->clone();
    190383                                Expression * arg3 = condExpr->get_arg3()->clone();
    191                                 ConditionalExpr * ret = new ConditionalExpr( arg1, mkExpr( arg2 ), mkExpr( arg3 ) );
     384                                ConditionalExpr * ret = new ConditionalExpr( arg1, mkExpr( arg2 )->acceptMutator( *visitor ), mkExpr( arg3 )->acceptMutator( *visitor ) );
    192385                                ret->set_env( expr->get_env() );
    193386                                expr->set_env( nullptr );
     
    202395                                unify( ret->get_arg2()->get_result(), ret->get_arg3()->get_result(), newEnv, needAssertions, haveAssertions, openVars, SymTab::Indexer(), commonType );
    203396                                ret->set_result( commonType ? commonType : ret->get_arg2()->get_result()->clone() );
    204                                 return ret->acceptMutator( *this );
     397                                return ret;
    205398                        }
    206399                        return expr;
    207400                }
    208401
    209                 Expression * GeneralizedLvalue::mutate( MemberExpr * memExpr ) {
    210                         Parent::mutate( memExpr );
     402                Expression * GeneralizedLvalue::postmutate( MemberExpr * memExpr ) {
    211403                        return applyTransformation( memExpr, memExpr->get_aggregate(), [=]( Expression * aggr ) { return new MemberExpr( memExpr->get_member(), aggr ); } );
    212404                }
    213405
    214                 Expression * GeneralizedLvalue::mutate( AddressExpr * addrExpr ) {
    215                         addrExpr = safe_dynamic_cast< AddressExpr * >( Parent::mutate( addrExpr ) );
     406                Expression * GeneralizedLvalue::postmutate( AddressExpr * addrExpr ) {
    216407                        return applyTransformation( addrExpr, addrExpr->get_arg(), []( Expression * arg ) { return new AddressExpr( arg ); } );
     408                }
     409
     410                Expression * CollapseAddrDeref::postmutate( AddressExpr * addrExpr ) {
     411                        Expression * arg = addrExpr->get_arg();
     412                        if ( isIntrinsicReference( arg ) ) {
     413                                std::string fname = InitTweak::getFunctionName( arg );
     414                                if ( fname == "*?" ) {
     415                                        Expression *& arg0 = InitTweak::getCallArg( arg, 0 );
     416                                        Expression * ret = arg0;
     417                                        ret->set_env( addrExpr->get_env() );
     418                                        arg0 = nullptr;
     419                                        addrExpr->set_env( nullptr );
     420                                        delete addrExpr;
     421                                        return ret;
     422                                }
     423                        }
     424                        return addrExpr;
     425                }
     426
     427                Expression * CollapseAddrDeref::postmutate( ApplicationExpr * appExpr ) {
     428                        if ( isIntrinsicReference( appExpr ) ) {
     429                                std::string fname = InitTweak::getFunctionName( appExpr );
     430                                if ( fname == "*?" ) {
     431                                        Expression * arg = InitTweak::getCallArg( appExpr, 0 );
     432                                        // xxx - this isn't right, because it can remove casts that should be there...
     433                                        // while ( CastExpr * castExpr = dynamic_cast< CastExpr * >( arg ) ) {
     434                                        //      arg = castExpr->get_arg();
     435                                        // }
     436                                        if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( arg ) ) {
     437                                                Expression * ret = addrExpr->get_arg();
     438                                                ret->set_env( appExpr->get_env() );
     439                                                addrExpr->set_arg( nullptr );
     440                                                appExpr->set_env( nullptr );
     441                                                delete appExpr;
     442                                                return ret;
     443                                        }
     444                                }
     445                        }
     446                        return appExpr;
    217447                }
    218448        } // namespace
  • src/GenPoly/Lvalue.h

    r54cd58b0 r9236060  
    2424        void convertLvalue( std::list< Declaration* >& translationUnit );
    2525
     26        /// true after reference types have been eliminated from the source code. After this point, reference types should not be added to the AST.
     27        bool referencesPermissable();
     28
    2629        /// applies transformations that allow GCC to accept more complicated lvalue expressions, e.g. &(a, b)
    2730        Expression * generalizedLvalue( Expression * expr );
  • src/GenPoly/Specialize.cc

    r54cd58b0 r9236060  
    101101                        // conversion of 0 (null) to function type does not require tuple specialization
    102102                        if ( dynamic_cast< ZeroType * >( actualType ) ) return false;
    103                         FunctionType * aftype = getFunctionType( actualType );
    104                         assertf( aftype, "formal type is a function type, but actual type is not." );
     103                        FunctionType * aftype = getFunctionType( actualType->stripReferences() );
     104                        assertf( aftype, "formal type is a function type, but actual type is not: %s", toString( actualType ).c_str() );
    105105                        if ( fftype->get_parameters().size() != aftype->get_parameters().size() ) return true;
    106106                        for ( auto params : group_iterate( fftype->get_parameters(), aftype->get_parameters() ) ) {
  • src/InitTweak/FixInit.cc

    r54cd58b0 r9236060  
    2626#include "FixGlobalInit.h"
    2727#include "CodeGen/GenType.h"  // for warning/error messages
     28#include "CodeGen/OperatorTable.h"
    2829#include "Common/PassVisitor.h"
    2930#include "GenPoly/DeclMutator.h"
     
    238239                        SemanticError errors;
    239240                  private:
    240                         void handleFirstParam( Expression * firstParam );
    241241                        template< typename... Params >
    242242                        void emit( CodeLocation, const Params &... params );
     
    363363                                        FunctionType * ftype = dynamic_cast< FunctionType * >( GenPoly::getFunctionType( funcDecl->get_type() ) );
    364364                                        assert( ftype );
    365                                         if ( isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) {
    366                                                 Type * t1 = ftype->get_parameters().front()->get_type();
     365                                        if ( CodeGen::isConstructor( funcDecl->get_name() ) && ftype->get_parameters().size() == 2 ) {
     366                                                Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() );
    367367                                                Type * t2 = ftype->get_parameters().back()->get_type();
    368                                                 PointerType * ptrType = safe_dynamic_cast< PointerType * > ( t1 );
    369 
    370                                                 if ( ResolvExpr::typesCompatible( ptrType->get_base(), t2, SymTab::Indexer() ) ) {
     368                                                assert( t1 );
     369
     370                                                if ( ResolvExpr::typesCompatible( t1, t2, SymTab::Indexer() ) ) {
    371371                                                        // optimization: don't need to copy construct in order to call a copy constructor
    372372                                                        return appExpr;
    373373                                                } // if
    374                                         } else if ( isDestructor( funcDecl->get_name() ) ) {
     374                                        } else if ( CodeGen::isDestructor( funcDecl->get_name() ) ) {
    375375                                                // correctness: never copy construct arguments to a destructor
    376376                                                return appExpr;
     
    401401
    402402                bool ResolveCopyCtors::skipCopyConstruct( Type * type ) {
    403                         return dynamic_cast< VarArgsType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type );
     403                        return dynamic_cast< VarArgsType * >( type ) || dynamic_cast< ReferenceType * >( type ) || GenPoly::getFunctionType( type ) || Tuples::isTtype( type );
    404404                }
    405405
     
    489489                                impCpCtorExpr->get_returnDecls().push_back( ret );
    490490                                CP_CTOR_PRINT( std::cerr << "makeCtorDtor for a return" << std::endl; )
    491                                 if ( ! result->get_lvalue() ) {
     491                                if ( ! dynamic_cast< ReferenceType * >( result ) ) {
    492492                                        // destructing lvalue returns is bad because it can cause multiple destructor calls to the same object - the returned object is not a temporary
    493493                                        destructRet( ret, impCpCtorExpr );
     
    975975                        if ( ! funcDecl ) return false;
    976976                        if ( ! funcDecl->get_statements() ) return false;
    977                         return isCtorDtor( funcDecl->get_name() ) && ! LinkageSpec::isOverridable( funcDecl->get_linkage() );
     977                        return CodeGen::isCtorDtor( funcDecl->get_name() ) && ! LinkageSpec::isOverridable( funcDecl->get_linkage() );
    978978                }
    979979
     
    992992
    993993                        function = funcDecl;
    994                         isCtor = isConstructor( function->get_name() );
     994                        isCtor = CodeGen::isConstructor( function->get_name() );
    995995                        if ( checkWarnings( function ) ) {
    996996                                FunctionType * type = function->get_functionType();
    997997                                assert( ! type->get_parameters().empty() );
    998998                                thisParam = safe_dynamic_cast< ObjectDecl * >( type->get_parameters().front() );
    999                                 PointerType * ptrType = safe_dynamic_cast< PointerType * > ( thisParam->get_type() );
    1000                                 StructInstType * structType = dynamic_cast< StructInstType * >( ptrType->get_base() );
     999                                Type * thisType = getPointerBase( thisParam->get_type() );
     1000                                StructInstType * structType = dynamic_cast< StructInstType * >( thisType );
    10011001                                if ( structType ) {
    10021002                                        structDecl = structType->get_baseStruct();
     
    10311031
    10321032                        if ( ! unhandled.empty() ) {
    1033                                 // need to explicitly re-add function parameters in order to resolve copy constructors
     1033                                // need to explicitly re-add function parameters to the indexer in order to resolve copy constructors
    10341034                                enterScope();
    10351035                                maybeAccept( function->get_functionType(), *this );
     
    10461046                                        // insert and resolve default/copy constructor call for each field that's unhandled
    10471047                                        std::list< Statement * > stmt;
    1048                                         UntypedExpr * deref = UntypedExpr::createDeref( new VariableExpr( thisParam ) );
    1049 
    10501048                                        Expression * arg2 = 0;
    10511049                                        if ( isCopyConstructor( function ) ) {
     
    10561054                                        }
    10571055                                        InitExpander srcParam( arg2 );
    1058                                         SymTab::genImplicitCall( srcParam, new MemberExpr( field, deref ), function->get_name(), back_inserter( stmt ), field, isCtor );
     1056                                        // cast away reference type and construct field.
     1057                                        Expression * thisExpr = new CastExpr( new VariableExpr( thisParam ), thisParam->get_type()->stripReferences()->clone() );
     1058                                        Expression * memberDest = new MemberExpr( field, thisExpr );
     1059                                        SymTab::genImplicitCall( srcParam, memberDest, function->get_name(), back_inserter( stmt ), field, isCtor );
    10591060
    10601061                                        assert( stmt.size() <= 1 );
     
    10831084                }
    10841085
     1086                /// true if expr is effectively just the 'this' parameter
     1087                bool isThisExpression( Expression * expr, DeclarationWithType * thisParam ) {
     1088                        // TODO: there are more complicated ways to pass 'this' to a constructor, e.g. &*, *&, etc.
     1089                        if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( expr ) ) {
     1090                                return varExpr->get_var() == thisParam;
     1091                        } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * > ( expr ) ) {
     1092                                return isThisExpression( castExpr->get_arg(), thisParam );
     1093                        }
     1094                        return false;
     1095                }
     1096
     1097                /// returns a MemberExpr if expr is effectively just member access on the 'this' parameter, else nullptr
     1098                MemberExpr * isThisMemberExpr( Expression * expr, DeclarationWithType * thisParam ) {
     1099                        if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( expr ) ) {
     1100                                if ( isThisExpression( memberExpr->get_aggregate(), thisParam ) ) {
     1101                                        return memberExpr;
     1102                                }
     1103                        } else if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
     1104                                return isThisMemberExpr( castExpr->get_arg(), thisParam );
     1105                        }
     1106                        return nullptr;
     1107                }
     1108
    10851109                void GenStructMemberCalls::visit( ApplicationExpr * appExpr ) {
    10861110                        if ( ! checkWarnings( function ) ) return;
     
    10911115                                Expression * firstParam = appExpr->get_args().front();
    10921116
    1093                                 if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( firstParam ) ) {
     1117                                if ( isThisExpression( firstParam, thisParam ) ) {
    10941118                                        // if calling another constructor on thisParam, assume that function handles
    10951119                                        // all members - if it doesn't a warning will appear in that function.
    1096                                         if ( varExpr->get_var() == thisParam ) {
    1097                                                 unhandled.clear();
    1098                                         }
    1099                                 } else {
    1100                                         // if first parameter is a member expression then
    1101                                         // remove the member from unhandled set.
    1102                                         handleFirstParam( firstParam );
    1103                                 }
    1104                         }
    1105 
    1106                         Parent::visit( appExpr );
    1107                 }
    1108 
    1109                 void GenStructMemberCalls::handleFirstParam( Expression * firstParam ) {
    1110                         using namespace std;
    1111                         if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( firstParam ) ) {
    1112                                 if ( MemberExpr * memberExpr = dynamic_cast< MemberExpr * >( addrExpr->get_arg() ) ) {
    1113                                         if ( ApplicationExpr * deref = dynamic_cast< ApplicationExpr * >( memberExpr->get_aggregate() ) ) {
    1114                                                 if ( getFunctionName( deref ) == "*?" && deref->get_args().size() == 1 ) {
    1115                                                         if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( deref->get_args().front() ) ) {
    1116                                                                 if ( varExpr->get_var() == thisParam ) {
    1117                                                                         unhandled.erase( memberExpr->get_member() );
    1118                                                                 }
    1119                                                         }
    1120                                                 }
     1120                                        unhandled.clear();
     1121                                } else if ( MemberExpr * memberExpr = isThisMemberExpr( firstParam, thisParam ) ) {
     1122                                        // if first parameter is a member expression on the this parameter,
     1123                                        // then remove the member from unhandled set.
     1124                                        if ( isThisExpression( memberExpr->get_aggregate(), thisParam ) ) {
     1125                                                unhandled.erase( memberExpr->get_member() );
    11211126                                        }
    11221127                                }
    11231128                        }
     1129                        Parent::visit( appExpr );
    11241130                }
    11251131
     
    11281134                        if ( ! isCtor ) return;
    11291135
    1130                         if ( ApplicationExpr * deref = dynamic_cast< ApplicationExpr * >( memberExpr->get_aggregate() ) ) {
    1131                                 if ( getFunctionName( deref ) == "*?" && deref->get_args().size() == 1 ) {
    1132                                         if ( VariableExpr * varExpr = dynamic_cast< VariableExpr * >( deref->get_args().front() ) ) {
    1133                                                 if ( varExpr->get_var() == thisParam ) {
    1134                                                         if ( unhandled.count( memberExpr->get_member() ) ) {
    1135                                                                 // emit a warning because a member was used before it was constructed
    1136                                                                 usedUninit.insert( { memberExpr->get_member(), memberExpr->location } );
    1137                                                         }
    1138                                                 }
    1139                                         }
     1136                        if ( isThisExpression( memberExpr->get_aggregate(), thisParam ) ) {
     1137                                if ( unhandled.count( memberExpr->get_member() ) ) {
     1138                                        // emit a warning because a member was used before it was constructed
     1139                                        usedUninit.insert( { memberExpr->get_member(), memberExpr->location } );
    11401140                                }
    11411141                        }
     
    11831183                        ctorExpr->set_callExpr( nullptr );
    11841184                        ctorExpr->set_env( nullptr );
     1185                        delete ctorExpr;
    11851186
    11861187                        Expression *& firstArg = callExpr->get_args().front();
    1187                         UntypedExpr * assign = new UntypedExpr( new NameExpr( "?=?" ) );
    1188                         assign->get_args().push_back( new VariableExpr( tmp ) );
    1189                         assign->get_args().push_back( firstArg );
    1190                         assign->set_result( ctorExpr->get_result()->clone() );
    1191                         firstArg = assign;
    1192 
    1193                         CommaExpr * commaExpr = new CommaExpr( callExpr, new VariableExpr( tmp ) );
     1188
     1189                        // xxx - hack in 'fake' assignment operator until resolver can easily be called in this pass. Once the resolver can be used in PassVisitor, this hack goes away.
     1190
     1191                        // generate the type of assignment operator using the type of tmp minus any reference types
     1192                        Type * type = tmp->get_type()->stripReferences();
     1193                        FunctionType * ftype = SymTab::genAssignType( type );
     1194
     1195                        // generate fake assignment decl and call it using &tmp and &firstArg
     1196                        // since tmp is guaranteed to be a reference and we want to assign pointers
     1197                        FunctionDecl * assignDecl = new FunctionDecl( "?=?", Type::StorageClasses(), LinkageSpec::Intrinsic, ftype, nullptr );
     1198                        ApplicationExpr * assign = new ApplicationExpr( VariableExpr::functionPointer( assignDecl ) );
     1199                        assign->get_args().push_back( new AddressExpr( new VariableExpr( tmp ) ) );
     1200                        Expression * addrArg = new AddressExpr( firstArg );
     1201                        // if firstArg has type T&&, then &firstArg has type T*&.
     1202                        // Cast away the reference to a value type so that the argument
     1203                        // matches the assignment's parameter types
     1204                        if ( dynamic_cast<ReferenceType *>( addrArg->get_result() ) ) {
     1205                                addrArg = new CastExpr( addrArg, addrArg->get_result()->stripReferences()->clone() );
     1206                        }
     1207                        assign->get_args().push_back( addrArg );
     1208                        firstArg = new VariableExpr( tmp );
     1209
     1210                        // for constructor expr:
     1211                        //   T x;
     1212                        //   x{};
     1213                        // results in:
     1214                        //   T x;
     1215                        //   T & tmp;
     1216                        //   &tmp = &x, ?{}(tmp), tmp
     1217                        CommaExpr * commaExpr = new CommaExpr( assign, new CommaExpr( callExpr, new VariableExpr( tmp ) ) );
    11941218                        commaExpr->set_env( env );
    1195                         delete ctorExpr;
    11961219                        return commaExpr;
    11971220                }
  • src/InitTweak/GenInit.cc

    r54cd58b0 r9236060  
    2121
    2222#include "Common/PassVisitor.h"
     23#include "CodeGen/OperatorTable.h"
    2324
    2425#include "GenPoly/DeclMutator.h"
     
    5455
    5556          protected:
    56                 FunctionType * ftype;
     57                FunctionType * ftype = nullptr;
    5758                std::string funcName;
    5859        };
     
    137138                std::list< DeclarationWithType * > & returnVals = ftype->get_returnVals();
    138139                assert( returnVals.size() == 0 || returnVals.size() == 1 );
    139                 // hands off if the function returns an lvalue - we don't want to allocate a temporary if a variable's address
     140                // hands off if the function returns a reference - we don't want to allocate a temporary if a variable's address
    140141                // is being returned
    141                 if ( returnStmt->get_expr() && returnVals.size() == 1 && ! returnVals.front()->get_type()->get_lvalue() ) {
     142                if ( returnStmt->get_expr() && returnVals.size() == 1 && ! dynamic_cast< ReferenceType * >( returnVals.front()->get_type() ) ) {
    142143                        // explicitly construct the return value using the return expression and the retVal object
    143144                        assertf( returnVals.front()->get_name() != "", "Function %s has unnamed return value\n", funcName.c_str() );
    144                         UntypedExpr *construct = new UntypedExpr( new NameExpr( "?{}" ) );
    145                         construct->get_args().push_back( new AddressExpr( new VariableExpr( returnVals.front() ) ) );
    146                         construct->get_args().push_back( returnStmt->get_expr() );
    147                         stmtsToAddBefore.push_back(new ExprStmt(noLabels, construct));
     145
     146                        stmtsToAddBefore.push_back( genCtorDtor( "?{}", dynamic_cast< ObjectDecl *>( returnVals.front() ), returnStmt->get_expr() ) );
    148147
    149148                        // return the retVal object
     
    212211
    213212        bool CtorDtor::isManaged( Type * type ) const {
     213                // at least for now, references are never constructed
     214                if ( dynamic_cast< ReferenceType * >( type ) ) return false;
    214215                // need to clear and reset qualifiers when determining if a type is managed
    215216                ValueGuard< Type::Qualifiers > qualifiers( type->get_qualifiers() );
     
    235236        void CtorDtor::handleDWT( DeclarationWithType * dwt ) {
    236237                // if this function is a user-defined constructor or destructor, mark down the type as "managed"
    237                 if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && isCtorDtor( dwt->get_name() ) ) {
     238                if ( ! LinkageSpec::isOverridable( dwt->get_linkage() ) && CodeGen::isCtorDtor( dwt->get_name() ) ) {
    238239                        std::list< DeclarationWithType * > & params = GenPoly::getFunctionType( dwt->get_type() )->get_parameters();
    239240                        assert( ! params.empty() );
    240                         PointerType * type = safe_dynamic_cast< PointerType * >( params.front()->get_type() );
    241                         managedTypes.insert( SymTab::Mangler::mangle( type->get_base() ) );
     241                        Type * type = InitTweak::getPointerBase( params.front()->get_type() );
     242                        assert( type );
     243                        managedTypes.insert( SymTab::Mangler::mangle( type ) );
    242244                }
    243245        }
  • src/InitTweak/InitTweak.cc

    r54cd58b0 r9236060  
    170170
    171171                        UntypedExpr * increment = new UntypedExpr( new NameExpr( "++?" ) );
    172                         increment->get_args().push_back( new AddressExpr( index->clone() ) );
     172                        increment->get_args().push_back( index->clone() );
    173173                        *out++ = new ExprStmt( noLabels, increment );
    174174                }
     
    380380                template<typename CallExpr>
    381381                Expression *& callArg( CallExpr * callExpr, unsigned int pos ) {
    382                         if ( pos >= callExpr->get_args().size() ) assertf( false, "asking for argument that doesn't exist. Return NULL/throw exception?" );
     382                        if ( pos >= callExpr->get_args().size() ) assertf( false, "getCallArg for argument that doesn't exist: (%u); %s.", pos, toString( callExpr ).c_str() );
    383383                        for ( Expression *& arg : callExpr->get_args() ) {
    384384                                if ( pos == 0 ) return arg;
     
    458458                } else if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) {
    459459                        return arrayType->get_base();
     460                } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( type ) ) {
     461                        return refType->get_base();
    460462                } else {
    461463                        return NULL;
     
    543545                if ( ftype->get_parameters().size() != 2 ) return 0;
    544546
    545                 Type * t1 = ftype->get_parameters().front()->get_type();
     547                Type * t1 = getPointerBase( ftype->get_parameters().front()->get_type() );
    546548                Type * t2 = ftype->get_parameters().back()->get_type();
    547                 PointerType * ptrType = dynamic_cast< PointerType * > ( t1 );
    548                 assert( ptrType );
    549 
    550                 if ( ResolvExpr::typesCompatibleIgnoreQualifiers( ptrType->get_base(), t2, SymTab::Indexer() ) ) {
     549                assert( t1 );
     550
     551                if ( ResolvExpr::typesCompatibleIgnoreQualifiers( t1, t2, SymTab::Indexer() ) ) {
    551552                        return function;
    552553                } else {
  • src/InitTweak/InitTweak.h

    r54cd58b0 r9236060  
    2525// helper functions for initialization
    2626namespace InitTweak {
    27         bool isConstructor( const std::string & );
    28         bool isDestructor( const std::string & );
    29         bool isAssignment( const std::string & );
    30         bool isCtorDtor( const std::string & );
    31         bool isCtorDtorAssign( const std::string & );
    32 
    3327        FunctionDecl * isAssignment( Declaration * decl );
    3428        FunctionDecl * isDestructor( Declaration * decl );
  • src/Makefile.in

    r54cd58b0 r9236060  
    224224        SynTree/driver_cfa_cpp-PointerType.$(OBJEXT) \
    225225        SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT) \
     226        SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT) \
    226227        SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT) \
    227228        SynTree/driver_cfa_cpp-ReferenceToType.$(OBJEXT) \
     
    520521        SynTree/VoidType.cc SynTree/BasicType.cc \
    521522        SynTree/PointerType.cc SynTree/ArrayType.cc \
    522         SynTree/FunctionType.cc SynTree/ReferenceToType.cc \
    523         SynTree/TupleType.cc SynTree/TypeofType.cc SynTree/AttrType.cc \
     523        SynTree/ReferenceType.cc SynTree/FunctionType.cc \
     524        SynTree/ReferenceToType.cc SynTree/TupleType.cc \
     525        SynTree/TypeofType.cc SynTree/AttrType.cc \
    524526        SynTree/VarArgsType.cc SynTree/ZeroOneType.cc \
    525527        SynTree/Constant.cc SynTree/Expression.cc SynTree/TupleExpr.cc \
     
    867869SynTree/driver_cfa_cpp-ArrayType.$(OBJEXT): SynTree/$(am__dirstamp) \
    868870        SynTree/$(DEPDIR)/$(am__dirstamp)
     871SynTree/driver_cfa_cpp-ReferenceType.$(OBJEXT):  \
     872        SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)
    869873SynTree/driver_cfa_cpp-FunctionType.$(OBJEXT):  \
    870874        SynTree/$(am__dirstamp) SynTree/$(DEPDIR)/$(am__dirstamp)
     
    10701074@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-PointerType.Po@am__quote@
    10711075@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceToType.Po@am__quote@
     1076@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po@am__quote@
    10721077@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-Statement.Po@am__quote@
    10731078@AMDEP_TRUE@@am__include@ @am__quote@SynTree/$(DEPDIR)/driver_cfa_cpp-TupleExpr.Po@am__quote@
     
    21672172@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    21682173@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ArrayType.obj `if test -f 'SynTree/ArrayType.cc'; then $(CYGPATH_W) 'SynTree/ArrayType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ArrayType.cc'; fi`
     2174
     2175SynTree/driver_cfa_cpp-ReferenceType.o: SynTree/ReferenceType.cc
     2176@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.o -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc
     2177@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po
     2178@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.o' libtool=no @AMDEPBACKSLASH@
     2179@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2180@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceType.o `test -f 'SynTree/ReferenceType.cc' || echo '$(srcdir)/'`SynTree/ReferenceType.cc
     2181
     2182SynTree/driver_cfa_cpp-ReferenceType.obj: SynTree/ReferenceType.cc
     2183@am__fastdepCXX_TRUE@   $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -MT SynTree/driver_cfa_cpp-ReferenceType.obj -MD -MP -MF SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`
     2184@am__fastdepCXX_TRUE@   $(AM_V_at)$(am__mv) SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Tpo SynTree/$(DEPDIR)/driver_cfa_cpp-ReferenceType.Po
     2185@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(AM_V_CXX)source='SynTree/ReferenceType.cc' object='SynTree/driver_cfa_cpp-ReferenceType.obj' libtool=no @AMDEPBACKSLASH@
     2186@AMDEP_TRUE@@am__fastdepCXX_FALSE@      DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     2187@am__fastdepCXX_FALSE@  $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(driver_cfa_cpp_CXXFLAGS) $(CXXFLAGS) -c -o SynTree/driver_cfa_cpp-ReferenceType.obj `if test -f 'SynTree/ReferenceType.cc'; then $(CYGPATH_W) 'SynTree/ReferenceType.cc'; else $(CYGPATH_W) '$(srcdir)/SynTree/ReferenceType.cc'; fi`
    21692188
    21702189SynTree/driver_cfa_cpp-FunctionType.o: SynTree/FunctionType.cc
  • src/Parser/DeclarationNode.cc

    r54cd58b0 r9236060  
    345345} // DeclarationNode::newTypeDecl
    346346
    347 DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers ) {
    348         DeclarationNode * newnode = new DeclarationNode;
    349         newnode->type = new TypeData( TypeData::Pointer );
     347DeclarationNode * DeclarationNode::newPointer( DeclarationNode * qualifiers, OperKinds kind ) {
     348        DeclarationNode * newnode = new DeclarationNode;
     349        newnode->type = new TypeData( kind == OperKinds::PointTo ? TypeData::Pointer : TypeData::Reference );
    350350        if ( qualifiers ) {
    351351                return newnode->addQualifiers( qualifiers );
     
    764764DeclarationNode * DeclarationNode::addPointer( DeclarationNode * p ) {
    765765        if ( p ) {
    766                 assert( p->type->kind == TypeData::Pointer );
     766                assert( p->type->kind == TypeData::Pointer || TypeData::Reference );
    767767                setBase( p->type );
    768768                p->type = nullptr;
     
    786786DeclarationNode * DeclarationNode::addNewPointer( DeclarationNode * p ) {
    787787        if ( p ) {
    788                 assert( p->type->kind == TypeData::Pointer );
     788                assert( p->type->kind == TypeData::Pointer || p->type->kind == TypeData::Reference );
    789789                if ( type ) {
    790790                        switch ( type->kind ) {
  • src/Parser/ExpressionNode.cc

    r54cd58b0 r9236060  
    305305Expression * build_unary_ptr( OperKinds op, ExpressionNode * expr_node ) {
    306306        std::list< Expression * > args;
    307         args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node) ) );
     307        args.push_back(  maybeMoveBuild< Expression >(expr_node) ); // xxx
    308308        return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args );
    309309} // build_unary_ptr
     
    318318Expression * build_binary_ptr( OperKinds op, ExpressionNode * expr_node1, ExpressionNode * expr_node2 ) {
    319319        std::list< Expression * > args;
    320         args.push_back( new AddressExpr( maybeMoveBuild< Expression >(expr_node1) ) );
     320        args.push_back( maybeMoveBuild< Expression >(expr_node1) );
    321321        args.push_back( maybeMoveBuild< Expression >(expr_node2) );
    322322        return new UntypedExpr( new NameExpr( OperName[ (int)op ] ), args );
  • src/Parser/ParseNode.h

    r54cd58b0 r9236060  
    237237        static DeclarationNode * newTraitUse( const std::string * name, ExpressionNode * params );
    238238        static DeclarationNode * newTypeDecl( std::string * name, DeclarationNode * typeParams );
    239         static DeclarationNode * newPointer( DeclarationNode * qualifiers );
     239        static DeclarationNode * newPointer( DeclarationNode * qualifiers, OperKinds kind );
    240240        static DeclarationNode * newArray( ExpressionNode * size, DeclarationNode * qualifiers, bool isStatic );
    241241        static DeclarationNode * newVarArray( DeclarationNode * qualifiers );
  • src/Parser/TypeData.cc

    r54cd58b0 r9236060  
    3030          case Unknown:
    3131          case Pointer:
     32          case Reference:
    3233          case EnumConstant:
    3334                // nothing else to initialize
     
    101102          case Unknown:
    102103          case Pointer:
     104          case Reference:
    103105          case EnumConstant:
    104106                // nothing to destroy
     
    168170          case EnumConstant:
    169171          case Pointer:
     172          case Reference:
    170173                // nothing else to copy
    171174                break;
     
    403406                        // add dtor:  void ^?{}(T *)
    404407                        FunctionType * dtorType = new FunctionType( Type::Qualifiers(), false );
    405                         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 ) );
     408                        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 ) );
    406409                        td->get_assertions().push_front( new FunctionDecl( "^?{}", Type::StorageClasses(), LinkageSpec::Cforall, dtorType, nullptr ) );
    407410
    408411                        // add copy ctor:  void ?{}(T *, T)
    409412                        FunctionType * copyCtorType = new FunctionType( Type::Qualifiers(), false );
    410                         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 ) );
     413                        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 ) );
    411414                        copyCtorType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) );
    412415                        td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, copyCtorType, nullptr ) );
     
    414417                        // add default ctor:  void ?{}(T *)
    415418                        FunctionType * ctorType = new FunctionType( Type::Qualifiers(), false );
    416                         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 ) );
     419                        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 ) );
    417420                        td->get_assertions().push_front( new FunctionDecl( "?{}", Type::StorageClasses(), LinkageSpec::Cforall, ctorType, nullptr ) );
    418421
    419422                        // add assignment operator:  T * ?=?(T *, T)
    420423                        FunctionType * assignType = new FunctionType( Type::Qualifiers(), false );
    421                         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 ) );
     424                        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 ) );
    422425                        assignType->get_parameters().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) );
    423426                        assignType->get_returnVals().push_back( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new TypeInstType( Type::Qualifiers(), td->get_name(), *i ), nullptr ) );
     
    439442          case TypeData::Array:
    440443                return buildArray( td );
     444          case TypeData::Reference:
     445                return buildReference( td );
    441446          case TypeData::Function:
    442447                return buildFunction( td );
     
    617622        buildForall( td->forall, at->get_forall() );
    618623        return at;
    619 } // buildPointer
     624} // buildArray
     625
     626ReferenceType * buildReference( const TypeData * td ) {
     627        ReferenceType * rt;
     628        if ( td->base ) {
     629                rt = new ReferenceType( buildQualifiers( td ), typebuild( td->base ) );
     630        } else {
     631                rt = new ReferenceType( buildQualifiers( td ), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) );
     632        } // if
     633        buildForall( td->forall, rt->get_forall() );
     634        return rt;
     635} // buildReference
    620636
    621637AggregateDecl * buildAggregate( const TypeData * td, std::list< Attribute * > attributes, LinkageSpec::Spec linkage ) {
  • src/Parser/TypeData.h

    r54cd58b0 r9236060  
    2020
    2121struct TypeData {
    22         enum Kind { Basic, Pointer, Array, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,
     22        enum Kind { Basic, Pointer, Array, Reference, Function, Aggregate, AggregateInst, Enum, EnumConstant, Symbolic,
    2323                                SymbolicInst, Tuple, Typeof, Builtin, Unknown };
    2424
     
    103103PointerType * buildPointer( const TypeData * );
    104104ArrayType * buildArray( const TypeData * );
     105ReferenceType * buildReference( const TypeData * );
    105106AggregateDecl * buildAggregate( const TypeData *, std::list< Attribute * > );
    106107ReferenceToType * buildComAggInst( const TypeData *, std::list< Attribute * > attributes, LinkageSpec::Spec linkage );
  • src/Parser/lex.ll

    r54cd58b0 r9236060  
    236236__label__               { KEYWORD_RETURN(LABEL); }                              // GCC
    237237long                    { KEYWORD_RETURN(LONG); }
    238 lvalue                  { KEYWORD_RETURN(LVALUE); }                             // CFA
    239238monitor                 { KEYWORD_RETURN(MONITOR); }                    // CFA
    240239mutex                   { KEYWORD_RETURN(MUTEX); }                              // CFA
  • src/Parser/parser.yy

    r54cd58b0 r9236060  
    118118%token RESTRICT                                                                                 // C99
    119119%token ATOMIC                                                                                   // C11
    120 %token FORALL LVALUE MUTEX VIRTUAL                                              // CFA
     120%token FORALL MUTEX VIRTUAL                                             // CFA
    121121%token VOID CHAR SHORT INT LONG FLOAT DOUBLE SIGNED UNSIGNED
    122122%token BOOL COMPLEX IMAGINARY                                                   // C99
     
    668668        conditional_expression
    669669        | unary_expression assignment_operator assignment_expression
    670                 { $$ = new ExpressionNode( build_binary_ptr( $2, $1, $3 ) ); }
     670                { $$ = new ExpressionNode( build_binary_val( $2, $1, $3 ) ); }
    671671        ;
    672672
     
    14251425        | VOLATILE
    14261426                { $$ = DeclarationNode::newTypeQualifier( Type::Volatile ); }
    1427         | LVALUE                                                                                        // CFA
    1428                 { $$ = DeclarationNode::newTypeQualifier( Type::Lvalue ); }
    14291427        | MUTEX
    14301428                { $$ = DeclarationNode::newTypeQualifier( Type::Mutex ); }
     
    24072405variable_ptr:
    24082406        ptrref_operator variable_declarator
    2409                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2407                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    24102408        | ptrref_operator type_qualifier_list variable_declarator
    2411                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2409                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    24122410        | '(' variable_ptr ')' attribute_list_opt
    24132411                { $$ = $2->addQualifiers( $4 ); }                               // redundant parenthesis
     
    24552453function_ptr:
    24562454        ptrref_operator function_declarator
    2457                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2455                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    24582456        | ptrref_operator type_qualifier_list function_declarator
    2459                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2457                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    24602458        | '(' function_ptr ')'
    24612459                { $$ = $2; }
     
    24952493KR_function_ptr:
    24962494        ptrref_operator KR_function_declarator
    2497                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2495                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    24982496        | ptrref_operator type_qualifier_list KR_function_declarator
    2499                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2497                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    25002498        | '(' KR_function_ptr ')'
    25012499                { $$ = $2; }
     
    25392537type_ptr:
    25402538        ptrref_operator variable_type_redeclarator
    2541                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2539                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    25422540        | ptrref_operator type_qualifier_list variable_type_redeclarator
    2543                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2541                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    25442542        | '(' type_ptr ')' attribute_list_opt
    25452543                { $$ = $2->addQualifiers( $4 ); }
     
    25832581identifier_parameter_ptr:
    25842582        ptrref_operator identifier_parameter_declarator
    2585                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2583                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    25862584        | ptrref_operator type_qualifier_list identifier_parameter_declarator
    2587                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2585                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    25882586        | '(' identifier_parameter_ptr ')' attribute_list_opt
    25892587                { $$ = $2->addQualifiers( $4 ); }
     
    26432641type_parameter_ptr:
    26442642        ptrref_operator type_parameter_redeclarator
    2645                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2643                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    26462644        | ptrref_operator type_qualifier_list type_parameter_redeclarator
    2647                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2645                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    26482646        | '(' type_parameter_ptr ')' attribute_list_opt
    26492647                { $$ = $2->addQualifiers( $4 ); }
     
    26862684abstract_ptr:
    26872685        ptrref_operator
    2688                 { $$ = DeclarationNode::newPointer( 0 ); }
     2686                { $$ = DeclarationNode::newPointer( 0, $1 ); }
    26892687        | ptrref_operator type_qualifier_list
    2690                 { $$ = DeclarationNode::newPointer( $2 ); }
     2688                { $$ = DeclarationNode::newPointer( $2, $1 ); }
    26912689        | ptrref_operator abstract_declarator
    2692                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2690                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    26932691        | ptrref_operator type_qualifier_list abstract_declarator
    2694                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2692                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    26952693        | '(' abstract_ptr ')' attribute_list_opt
    26962694                { $$ = $2->addQualifiers( $4 ); }
     
    27752773abstract_parameter_ptr:
    27762774        ptrref_operator
    2777                 { $$ = DeclarationNode::newPointer( nullptr ); }
     2775                { $$ = DeclarationNode::newPointer( nullptr, $1 ); }
    27782776        | ptrref_operator type_qualifier_list
    2779                 { $$ = DeclarationNode::newPointer( $2 ); }
     2777                { $$ = DeclarationNode::newPointer( $2, $1 ); }
    27802778        | ptrref_operator abstract_parameter_declarator
    2781                 { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr ) ); }
     2779                { $$ = $2->addPointer( DeclarationNode::newPointer( nullptr, $1 ) ); }
    27822780        | ptrref_operator type_qualifier_list abstract_parameter_declarator
    2783                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2781                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    27842782        | '(' abstract_parameter_ptr ')' attribute_list_opt
    27852783                { $$ = $2->addQualifiers( $4 ); }
     
    28542852variable_abstract_ptr:
    28552853        ptrref_operator
    2856                 { $$ = DeclarationNode::newPointer( 0 ); }
     2854                { $$ = DeclarationNode::newPointer( 0, $1 ); }
    28572855        | ptrref_operator type_qualifier_list
    2858                 { $$ = DeclarationNode::newPointer( $2 ); }
     2856                { $$ = DeclarationNode::newPointer( $2, $1 ); }
    28592857        | ptrref_operator variable_abstract_declarator
    2860                 { $$ = $2->addPointer( DeclarationNode::newPointer( 0 ) ); }
     2858                { $$ = $2->addPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    28612859        | ptrref_operator type_qualifier_list variable_abstract_declarator
    2862                 { $$ = $3->addPointer( DeclarationNode::newPointer( $2 ) ); }
     2860                { $$ = $3->addPointer( DeclarationNode::newPointer( $2, $1 ) ); }
    28632861        | '(' variable_abstract_ptr ')' attribute_list_opt
    28642862                { $$ = $2->addQualifiers( $4 ); }
     
    29002898                // No SUE declaration in parameter list.
    29012899        ptrref_operator type_specifier_nobody
    2902                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2900                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29032901        | type_qualifier_list ptrref_operator type_specifier_nobody
    2904                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2902                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29052903        | ptrref_operator cfa_abstract_function
    2906                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2904                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29072905        | type_qualifier_list ptrref_operator cfa_abstract_function
    2908                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2906                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29092907        | ptrref_operator cfa_identifier_parameter_declarator_tuple
    2910                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2908                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29112909        | type_qualifier_list ptrref_operator cfa_identifier_parameter_declarator_tuple
    2912                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2910                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29132911        ;
    29142912
     
    29882986cfa_abstract_ptr:                                                                               // CFA
    29892987        ptrref_operator type_specifier
    2990                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2988                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29912989        | type_qualifier_list ptrref_operator type_specifier
    2992                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2990                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29932991        | ptrref_operator cfa_abstract_function
    2994                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2992                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29952993        | type_qualifier_list ptrref_operator cfa_abstract_function
    2996                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2994                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    29972995        | ptrref_operator cfa_abstract_declarator_tuple
    2998                 { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0 ) ); }
     2996                { $$ = $2->addNewPointer( DeclarationNode::newPointer( 0, $1 ) ); }
    29992997        | type_qualifier_list ptrref_operator cfa_abstract_declarator_tuple
    3000                 { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1 ) ); }
     2998                { $$ = $3->addNewPointer( DeclarationNode::newPointer( $1, $2 ) ); }
    30012999        ;
    30023000
  • src/ResolvExpr/Alternative.cc

    r54cd58b0 r9236060  
    2828                : cost( cost ), cvtCost( cvtCost ), expr( expr ), env( env ) {}
    2929
    30         Alternative::Alternative( const Alternative &other ) {
    31                 initialize( other, *this );
     30        Alternative::Alternative( const Alternative &other ) : cost( other.cost ), cvtCost( other.cvtCost ), expr( maybeClone( other.expr ) ), env( other.env ) {
    3231        }
    3332
    3433        Alternative &Alternative::operator=( const Alternative &other ) {
    3534                if ( &other == this ) return *this;
    36                 initialize( other, *this );
     35                delete expr;
     36                cost = other.cost;
     37                cvtCost = other.cvtCost;
     38                expr = maybeClone( other.expr );
     39                env = other.env;
    3740                return *this;
    3841        }
     
    5154                other.expr = nullptr;
    5255                return *this;
    53         }
    54 
    55         void Alternative::initialize( const Alternative &src, Alternative &dest ) {
    56                 dest.cost = src.cost;
    57                 dest.cvtCost = src.cvtCost;
    58                 dest.expr = maybeClone( src.expr );
    59                 dest.env = src.env;
    6056        }
    6157
  • src/ResolvExpr/Alternative.h

    r54cd58b0 r9236060  
    3535                ~Alternative();
    3636
    37                 void initialize( const Alternative &src, Alternative &dest );
    38 
    3937                void print( std::ostream &os, int indent = 0 ) const;
    4038
  • src/ResolvExpr/AlternativeFinder.cc

    r54cd58b0 r9236060  
    6767
    6868        Cost sumCost( const AltList &in ) {
    69                 Cost total;
     69                Cost total = Cost::zero;
    7070                for ( AltList::const_iterator i = in.begin(); i != in.end(); ++i ) {
    7171                        total += i->cost;
     
    144144                        expr->get_result()->accept( global_renamer );
    145145                }
    146         }
     146
     147                void referenceToRvalueConversion( Expression *& expr ) {
     148                        if ( dynamic_cast< ReferenceType * >( expr->get_result() ) ) {
     149                                // cast away reference from expr
     150                                expr = new CastExpr( expr, expr->get_result()->stripReferences()->clone() );
     151                        }
     152                }
     153        } // namespace
    147154
    148155        template< typename InputIterator, typename OutputIterator >
     
    213220        void AlternativeFinder::addAnonConversions( const Alternative & alt ) {
    214221                // adds anonymous member interpretations whenever an aggregate value type is seen.
    215                 Expression * expr = alt.expr->clone();
    216                 std::unique_ptr< Expression > manager( expr ); // RAII for expr
    217                 alt.env.apply( expr->get_result() );
    218                 if ( StructInstType *structInst = dynamic_cast< StructInstType* >( expr->get_result() ) ) {
     222                // it's okay for the aggregate expression to have reference type -- cast it to the base type to treat the aggregate as the referenced value
     223                std::unique_ptr<Expression> aggrExpr( alt.expr->clone() );
     224                alt.env.apply( aggrExpr->get_result() );
     225                Type * aggrType = aggrExpr->get_result();
     226                if ( dynamic_cast< ReferenceType * >( aggrType ) ) {
     227                        aggrType = aggrType->stripReferences();
     228                        aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) );
     229                }
     230
     231                if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) {
    219232                        NameExpr nameExpr( "" );
    220                         addAggMembers( structInst, expr, alt.cost+Cost( 0, 0, 1 ), alt.env, &nameExpr );
    221                 } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( expr->get_result() ) ) {
     233                        addAggMembers( structInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr );
     234                } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) {
    222235                        NameExpr nameExpr( "" );
    223                         addAggMembers( unionInst, expr, alt.cost+Cost( 0, 0, 1 ), alt.env, &nameExpr );
     236                        addAggMembers( unionInst, aggrExpr.get(), alt.cost+Cost::safe, alt.env, &nameExpr );
    224237                } // if
    225238        }
     
    277290                FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
    278291
    279                 Cost convCost( 0, 0, 0 );
     292                Cost convCost = Cost::zero;
    280293                std::list< DeclarationWithType* >& formals = function->get_parameters();
    281294                std::list< DeclarationWithType* >::iterator formal = formals.begin();
     
    290303                                actualType->print( std::cerr, 8 );
    291304                        )
    292                         Cost actualCost;
     305                        Cost actualCost = Cost::zero;
    293306                        if ( formal == formals.end() ) {
    294307                                if ( function->get_isVarArgs() ) {
    295                                         convCost += Cost( 1, 0, 0 );
     308                                        convCost.incUnsafe();
     309                                        // convert reference-typed expressions to value-typed expressions
     310                                        referenceToRvalueConversion( *actualExpr );
    296311                                        continue;
    297312                                } else {
     
    305320                                std::cerr << std::endl << " to ";
    306321                                formalType->print( std::cerr, 8 );
     322                                std::cerr << std::endl << "environment is: ";
     323                                alt.env.print( std::cerr, 8 );
     324                                std::cerr << std::endl;
    307325                        )
    308326                        Cost newCost = conversionCost( actualType, formalType, indexer, alt.env );
     
    316334                        convCost += newCost;
    317335                        actualCost += newCost;
    318                         if ( actualCost != Cost( 0, 0, 0 ) ) {
     336                        if ( actualCost != Cost::zero ) {
    319337                                Type *newType = formalType->clone();
    320338                                alt.env.apply( newType );
    321339                                *actualExpr = new CastExpr( *actualExpr, newType );
    322340                        }
    323                         convCost += Cost( 0, polyCost( formalType, alt.env, indexer ) + polyCost( actualType, alt.env, indexer ), 0 );
     341                        convCost.incPoly( polyCost( formalType, alt.env, indexer ) + polyCost( actualType, alt.env, indexer ) );
    324342                        ++formal; // can't be in for-loop update because of the continue
    325343                }
     
    343361                        }
    344362                        convCost += newCost;
    345                         convCost += Cost( 0, polyCost( assert->second.formalType, alt.env, indexer ) + polyCost( assert->second.actualType, alt.env, indexer ), 0 );
     363                        convCost.incPoly( polyCost( assert->second.formalType, alt.env, indexer ) + polyCost( assert->second.actualType, alt.env, indexer ) );
    346364                }
    347365
     
    400418                        Expression * actual = actualIt->expr;
    401419                        Type * actualType = actual->get_result();
     420
    402421                        PRINT(
    403422                                std::cerr << "formal type is ";
     
    408427                        )
    409428                        if ( ! unify( formalType, actualType, resultEnv, resultNeed, resultHave, openVars, indexer ) ) {
     429                                // std::cerr << "unify failed" << std::endl;
    410430                                return false;
    411431                        }
     
    452472                        // match flattened actuals with formal parameters - actuals will be grouped to match
    453473                        // with formals as appropriate
    454                         Cost cost;
     474                        Cost cost = Cost::zero;
    455475                        std::list< Expression * > newExprs;
    456476                        ObjectDecl * obj = safe_dynamic_cast< ObjectDecl * >( formal );
     
    643663                        makeExprList( instantiatedActuals, appExpr->get_args() );
    644664                        PRINT(
     665                                std::cerr << "instantiate function success: " << appExpr << std::endl;
    645666                                std::cerr << "need assertions:" << std::endl;
    646667                                printAssertionSet( resultNeed, std::cerr, 8 );
     
    663684                                UntypedExpr *vexpr = untypedExpr->clone();
    664685                                vexpr->set_result( pt.clone() );
    665                                 alternatives.push_back( Alternative( vexpr, env, Cost()) );
     686                                alternatives.push_back( Alternative( vexpr, env, Cost::zero) );
    666687                                return;
    667688                        }
     
    681702                AltList candidates;
    682703                SemanticError errors;
    683                 for ( AltList::const_iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) {
     704                for ( AltList::iterator func = funcFinder.alternatives.begin(); func != funcFinder.alternatives.end(); ++func ) {
    684705                        try {
    685706                                PRINT(
     
    688709                                )
    689710                                // check if the type is pointer to function
    690                                 PointerType *pointer;
    691                                 if ( ( pointer = dynamic_cast< PointerType* >( func->expr->get_result() ) ) ) {
     711                                if ( PointerType *pointer = dynamic_cast< PointerType* >( func->expr->get_result()->stripReferences() ) ) {
    692712                                        if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
     713                                                referenceToRvalueConversion( func->expr );
    693714                                                for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
    694715                                                        // XXX
     
    696717                                                        makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
    697718                                                }
    698                                         } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( pointer->get_base() ) ) {
    699                                                 EqvClass eqvClass;
    700                                                 if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
    701                                                         if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
    702                                                                 for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
    703                                                                         makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
    704                                                                 } // for
    705                                                         } // if
     719                                        }
     720                                } else if ( TypeInstType *typeInst = dynamic_cast< TypeInstType* >( func->expr->get_result()->stripReferences() ) ) { // handle ftype (e.g. *? on function pointer)
     721                                        referenceToRvalueConversion( func->expr );
     722                                        EqvClass eqvClass;
     723                                        if ( func->env.lookup( typeInst->get_name(), eqvClass ) && eqvClass.type ) {
     724                                                if ( FunctionType *function = dynamic_cast< FunctionType* >( eqvClass.type ) ) {
     725                                                        for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
     726                                                                makeFunctionAlternatives( *func, function, *actualAlt, std::back_inserter( candidates ) );
     727                                                        } // for
    706728                                                } // if
    707729                                        } // if
     
    722744                                        }
    723745
    724                                         for ( AltList::const_iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {
     746                                        for ( AltList::iterator funcOp = funcOpFinder.alternatives.begin(); funcOp != funcOpFinder.alternatives.end(); ++funcOp ) {
    725747                                                // check if the type is pointer to function
    726                                                 PointerType *pointer;
    727                                                 if ( ( pointer = dynamic_cast< PointerType* >( funcOp->expr->get_result() ) ) ) {
     748                                                if ( PointerType *pointer = dynamic_cast< PointerType* >( funcOp->expr->get_result()->stripReferences() ) ) {
    728749                                                        if ( FunctionType *function = dynamic_cast< FunctionType* >( pointer->get_base() ) ) {
     750                                                                referenceToRvalueConversion( funcOp->expr );
    729751                                                                for ( std::list< AltList >::iterator actualAlt = possibilities.begin(); actualAlt != possibilities.end(); ++actualAlt ) {
    730752                                                                        AltList currentAlt;
     
    753775                                PointerType *pointer = safe_dynamic_cast< PointerType* >( appExpr->get_function()->get_result() );
    754776                                FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
    755                                 std::cerr << "Case +++++++++++++" << std::endl;
     777                                std::cerr << "Case +++++++++++++ " << appExpr->get_function() << std::endl;
    756778                                std::cerr << "formals are:" << std::endl;
    757779                                printAll( function->get_parameters(), std::cerr, 8 );
     
    796818        bool isLvalue( Expression *expr ) {
    797819                // xxx - recurse into tuples?
    798                 return expr->has_result() && expr->get_result()->get_lvalue();
     820                return expr->has_result() && ( expr->get_result()->get_lvalue() || dynamic_cast< ReferenceType * >( expr->get_result() ) );
    799821        }
    800822
     
    810832
    811833        Expression * restructureCast( Expression * argExpr, Type * toType ) {
    812                 if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() ) {
    813                         // Argument expression is a tuple and the target type is not void. Cast each member of the tuple
    814                         // to its corresponding target type, producing the tuple of those cast expressions. If there are
    815                         // more components of the tuple than components in the target type, then excess components do not
    816                         // come out in the result expression (but UniqueExprs ensure that side effects will still be done).
     834                if ( argExpr->get_result()->size() > 1 && ! toType->isVoid() && ! dynamic_cast<ReferenceType *>( toType ) ) {
     835                        // Argument expression is a tuple and the target type is not void and not a reference type.
     836                        // Cast each member of the tuple to its corresponding target type, producing the tuple of those
     837                        // cast expressions. If there are more components of the tuple than components in the target type,
     838                        // then excess components do not come out in the result expression (but UniqueExprs ensure that
     839                        // side effects will still be done).
    817840                        if ( Tuples::maybeImpure( argExpr ) && ! dynamic_cast< UniqueExpr * >( argExpr ) ) {
    818841                                // expressions which may contain side effects require a single unique instance of the expression.
     
    855878                        // that are cast directly.  The candidate is invalid if it has fewer results than there are types to cast
    856879                        // to.
    857                         int discardedValues = (*i).expr->get_result()->size() - castExpr->get_result()->size();
     880                        int discardedValues = i->expr->get_result()->size() - castExpr->get_result()->size();
    858881                        if ( discardedValues < 0 ) continue;
    859882                        // xxx - may need to go into tuple types and extract relevant types and use unifyList. Note that currently, this does not
    860883                        // allow casting a tuple to an atomic type (e.g. (int)([1, 2, 3]))
    861884                        // unification run for side-effects
    862                         unify( castExpr->get_result(), (*i).expr->get_result(), i->env, needAssertions, haveAssertions, openVars, indexer );
    863                         Cost thisCost = castCost( (*i).expr->get_result(), castExpr->get_result(), indexer, i->env );
     885                        unify( castExpr->get_result(), i->expr->get_result(), i->env, needAssertions, haveAssertions, openVars, indexer );
     886                        Cost thisCost = castCost( i->expr->get_result(), castExpr->get_result(), indexer, i->env );
    864887                        if ( thisCost != Cost::infinity ) {
    865888                                // count one safe conversion for each value that is thrown away
    866                                 thisCost += Cost( 0, 0, discardedValues );
     889                                thisCost.incSafe( discardedValues );
    867890
    868891                                candidates.push_back( Alternative( restructureCast( i->expr->clone(), toType ), i->env, i->cost, thisCost ) );
     
    895918                funcFinder.findWithAdjustment( memberExpr->get_aggregate() );
    896919                for ( AltList::const_iterator agg = funcFinder.alternatives.begin(); agg != funcFinder.alternatives.end(); ++agg ) {
    897                         if ( StructInstType *structInst = dynamic_cast< StructInstType* >( agg->expr->get_result() ) ) {
    898                                 addAggMembers( structInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() );
    899                         } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( agg->expr->get_result() ) ) {
    900                                 addAggMembers( unionInst, agg->expr, agg->cost, agg->env, memberExpr->get_member() );
    901                         } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( agg->expr->get_result() ) ) {
    902                                 addTupleMembers( tupleType, agg->expr, agg->cost, agg->env, memberExpr->get_member() );
     920                        // 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
     921                        std::unique_ptr<Expression> aggrExpr( agg->expr->clone() );
     922                        Type * aggrType = aggrExpr->get_result();
     923                        if ( dynamic_cast< ReferenceType * >( aggrType ) ) {
     924                                aggrType = aggrType->stripReferences();
     925                                aggrExpr.reset( new CastExpr( aggrExpr.release(), aggrType->clone() ) );
     926                        }
     927                        // find member of the given type
     928                        if ( StructInstType *structInst = dynamic_cast< StructInstType* >( aggrExpr->get_result() ) ) {
     929                                addAggMembers( structInst, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() );
     930                        } else if ( UnionInstType *unionInst = dynamic_cast< UnionInstType* >( aggrExpr->get_result() ) ) {
     931                                addAggMembers( unionInst, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() );
     932                        } else if ( TupleType * tupleType = dynamic_cast< TupleType * >( aggrExpr->get_result() ) ) {
     933                                addTupleMembers( tupleType, aggrExpr.get(), agg->cost, agg->env, memberExpr->get_member() );
    903934                        } // if
    904935                } // for
     
    915946                for ( std::list< DeclarationWithType* >::iterator i = declList.begin(); i != declList.end(); ++i ) {
    916947                        VariableExpr newExpr( *i, nameExpr->get_argName() );
    917                         alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
     948                        alternatives.push_back( Alternative( newExpr.clone(), env, Cost::zero ) );
    918949                        PRINT(
    919950                                std::cerr << "decl is ";
     
    10591090                        for ( std::list< DeclarationWithType* >::iterator i = attrList.begin(); i != attrList.end(); ++i ) {
    10601091                                VariableExpr newExpr( *i );
    1061                                 alternatives.push_back( Alternative( newExpr.clone(), env, Cost() ) );
     1092                                alternatives.push_back( Alternative( newExpr.clone(), env, Cost::zero ) );
    10621093                                renameTypes( alternatives.back().expr );
    10631094                        } // for
     
    12321263                                if ( thisCost != Cost::infinity ) {
    12331264                                        // count one safe conversion for each value that is thrown away
    1234                                         thisCost += Cost( 0, 0, discardedValues );
     1265                                        thisCost.incSafe( discardedValues );
    12351266                                        candidates.push_back( Alternative( new InitExpr( restructureCast( alt.expr->clone(), toType ), initAlt.designation->clone() ), newEnv, alt.cost, thisCost ) );
    12361267                                }
  • src/ResolvExpr/CastCost.cc

    r54cd58b0 r9236060  
    4646                                assert( type );
    4747                                if ( type->get_base() ) {
    48                                         return castCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 );
     48                                        return castCost( src, type->get_base(), indexer, env ) + Cost::safe;
    4949                                } // if
    5050                        } // if
    5151                } // if
    5252                if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
    53                         return Cost( 0, 0, 0 );
     53                        return Cost::zero;
    5454                } else if ( dynamic_cast< VoidType* >( dest ) ) {
    55                         return Cost( 0, 0, 1 );
     55                        return Cost::safe;
     56                } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) {
     57                        return convertToReferenceCost( src, refType, indexer, env );
    5658                } else {
    5759                        CastCost converter( dest, indexer, env );
     
    6163                        } else {
    6264                                // xxx - why are we adding cost 0 here?
    63                                 return converter.get_cost() + Cost( 0, 0, 0 );
     65                                return converter.get_cost() + Cost::zero;
    6466                        } // if
    6567                } // if
     
    7476                if ( destAsPointer && basicType->isInteger() ) {
    7577                        // necessary for, e.g. unsigned long => void*
    76                         cost = Cost( 1, 0, 0 );
     78                        cost = Cost::unsafe;
    7779                } else {
    78                         ConversionCost::visit( basicType );
     80                        cost = conversionCost( basicType, dest, indexer, env );
    7981                } // if
    8082        }
     
    8385                if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
    8486                        if ( pointerType->get_qualifiers() <= destAsPtr->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
    85                                 cost = Cost( 0, 0, 1 );
     87                                cost = Cost::safe;
    8688                        } else {
    8789                                TypeEnvironment newEnv( env );
     
    9092                                int castResult = ptrsCastable( pointerType->get_base(), destAsPtr->get_base(), newEnv, indexer );
    9193                                if ( castResult > 0 ) {
    92                                         cost = Cost( 0, 0, 1 );
     94                                        cost = Cost::safe;
    9395                                } else if ( castResult < 0 ) {
    9496                                        cost = Cost::infinity;
     
    98100                        if ( destAsBasic->isInteger() ) {
    99101                                // necessary for, e.g. void* => unsigned long
    100                                 cost = Cost( 1, 0, 0 );
     102                                cost = Cost::unsafe;
    101103                        } // if
    102104                }
  • src/ResolvExpr/CommonType.cc

    r54cd58b0 r9236060  
    1717#include "SynTree/Type.h"
    1818#include "Unify.h"
    19 
    2019
    2120/// #define DEBUG
     
    3130                virtual void visit( PointerType *pointerType );
    3231                virtual void visit( ArrayType *arrayType );
     32                virtual void visit( ReferenceType *refType );
    3333                virtual void visit( FunctionType *functionType );
    3434                virtual void visit( StructInstType *aggregateUseType );
     
    4242                virtual void visit( OneType *oneType );
    4343
    44                 void getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer );
     44                template< typename Pointer > void getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer );
     45                template< typename RefType > void handleRefType( RefType *inst, Type *other );
    4546
    4647                Type *result;
     
    5253        };
    5354
     55        Type * handleReference( ReferenceType * refType, Type * other, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment & env, const OpenVarSet &openVars ) {
     56                Type * result = nullptr, * common = nullptr;
     57                AssertionSet have, need;
     58                OpenVarSet newOpen( openVars );
     59                // need unify to bind type variables
     60                if ( unify( refType->get_base(), other, env, have, need, newOpen, indexer, common ) ) {
     61                        // std::cerr << "unify success" << std::endl;
     62                        if ( widenSecond ) {
     63                                if ( widenFirst || other->get_qualifiers() <= refType->get_qualifiers() ) {
     64                                        result = new ReferenceType( refType->get_qualifiers(), common ); // refType->clone();
     65                                        result->get_qualifiers() |= other->get_qualifiers();
     66                                }
     67                        } else if ( widenFirst ) {
     68                                if ( widenSecond || refType->get_qualifiers() <= other->get_qualifiers() ) {
     69                                        result = common;
     70                                        result->get_qualifiers() |= refType->get_qualifiers();
     71                                }
     72                        }
     73                } else {
     74                        // std::cerr << "exact unify failed: " << refType << " " << other << std::endl;
     75                }
     76                // std::cerr << "common type of reference [" << refType << "] and non-reference [" << other << "] is [" << result << "]" << std::endl;
     77                return result;
     78        }
     79
    5480        Type *commonType( Type *type1, Type *type2, bool widenFirst, bool widenSecond, const SymTab::Indexer &indexer, TypeEnvironment &env, const OpenVarSet &openVars ) {
    5581                CommonType visitor( type2, widenFirst, widenSecond, indexer, env, openVars );
     82
     83                int depth1 = type1->referenceDepth();
     84                int depth2 = type2->referenceDepth();
     85                if ( depth1 > 0 || depth2 > 0 ) {
     86                        int diff = depth1-depth2;
     87                        // TODO: should it be possible for commonType to generate complicated conversions? I would argue no, only conversions that involve types of the same reference level or a difference of 1 should be allowed.
     88                        if ( diff > 1 || diff < -1 ) return nullptr;
     89
     90                        // special case where one type has a reference depth of 1 larger than the other
     91                        if ( diff > 0 ) {
     92                                return handleReference( safe_dynamic_cast<ReferenceType *>( type1 ), type2, widenFirst, widenSecond, indexer, env, openVars );
     93                        } else if ( diff < 0 ) {
     94                                return handleReference( safe_dynamic_cast<ReferenceType *>( type2 ), type1, widenSecond, widenFirst, indexer, env, openVars );
     95                        }
     96                        // otherwise, both are reference types of the same depth and this is handled by the CommonType visitor.
     97                }
     98
    5699                type1->accept( visitor );
    57100                Type *result = visitor.get_result();
     
    142185        }
    143186
    144         void CommonType::getCommonWithVoidPointer( PointerType* voidPointer, PointerType* otherPointer ) {
     187        template< typename Pointer >
     188        void CommonType::getCommonWithVoidPointer( Pointer* voidPointer, Pointer* otherPointer ) {
    145189                if ( TypeInstType* var = dynamic_cast< TypeInstType* >( otherPointer->get_base() ) ) {
    146190                        OpenVarSet::const_iterator entry = openVars.find( var->get_name() );
     
    188232
    189233        void CommonType::visit( __attribute((unused)) ArrayType *arrayType ) {}
     234
     235        void CommonType::visit( ReferenceType *refType ) {
     236                if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {
     237                        if ( widenFirst && dynamic_cast< VoidType* >( otherRef->get_base() ) && ! isFtype(refType->get_base()) ) {
     238                                getCommonWithVoidPointer( otherRef, refType );
     239                        } else if ( widenSecond && dynamic_cast< VoidType* >( refType->get_base() ) && ! isFtype(otherRef->get_base()) ) {
     240                                getCommonWithVoidPointer( refType, otherRef );
     241                        } else if ( ( refType->get_base()->get_qualifiers() >= otherRef->get_base()->get_qualifiers() || widenFirst )
     242                                           && ( refType->get_base()->get_qualifiers() <= otherRef->get_base()->get_qualifiers() || widenSecond ) ) {
     243                                Type::Qualifiers tq1 = refType->get_base()->get_qualifiers(), tq2 = otherRef->get_base()->get_qualifiers();
     244                                refType->get_base()->get_qualifiers() = Type::Qualifiers();
     245                                otherRef->get_base()->get_qualifiers() = Type::Qualifiers();
     246                                AssertionSet have, need;
     247                                OpenVarSet newOpen( openVars );
     248                                if ( unifyExact( refType->get_base(), otherRef->get_base(), env, have, need, newOpen, indexer ) ) {
     249                                        if ( tq1 < tq2 ) {
     250                                                result = refType->clone();
     251                                        } else {
     252                                                result = otherRef->clone();
     253                                        } // if
     254                                        result->get_qualifiers() = tq1 | tq2;
     255                                } else {
     256                                        /// std::cout << "place for ptr-to-type" << std::endl;
     257                                } // if
     258                                refType->get_base()->get_qualifiers() = tq1;
     259                                otherRef->get_base()->get_qualifiers() = tq2;
     260                        } // if
     261                } else if ( widenSecond && dynamic_cast< ZeroType* >( type2 ) ) {
     262                        result = refType->clone();
     263                        result->get_qualifiers() |= type2->get_qualifiers();
     264                } // if
     265        }
     266
    190267        void CommonType::visit( __attribute((unused)) FunctionType *functionType ) {}
    191268        void CommonType::visit( __attribute((unused)) StructInstType *aggregateUseType ) {}
     
    195272                if ( dynamic_cast< BasicType * >( type2 ) || dynamic_cast< ZeroType* >( type2 ) || dynamic_cast< OneType* >( type2 ) ) {
    196273                        // reuse BasicType, EnumInstType code by swapping type2 with enumInstType
    197                         Type * temp = type2;
     274                        ValueGuard< Type * > temp( type2 );
    198275                        type2 = enumInstType;
    199                         temp->accept( *this );
    200                         type2 = temp;
     276                        temp.old->accept( *this );
    201277                } // if
    202278        }
  • src/ResolvExpr/ConversionCost.cc

    r54cd58b0 r9236060  
    2121
    2222namespace ResolvExpr {
    23         const Cost Cost::zero = Cost( 0, 0, 0 );
    24         const Cost Cost::infinity = Cost( -1, -1, -1 );
     23        const Cost Cost::zero = Cost( 0, 0, 0, 0 );
     24        const Cost Cost::infinity = Cost( -1, -1, -1, -1 );
     25        const Cost Cost::unsafe = Cost( 1, 0, 0, 0 );
     26        const Cost Cost::poly = Cost( 0, 1, 0, 0 );
     27        const Cost Cost::safe = Cost( 0, 0, 1, 0 );
     28        const Cost Cost::reference = Cost( 0, 0, 0, 1 );
     29
    2530
    2631        Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
     
    4146                                assert( type );
    4247                                if ( type->get_base() ) {
    43                                         return conversionCost( src, type->get_base(), indexer, env ) + Cost( 0, 0, 1 );
     48                                        return conversionCost( src, type->get_base(), indexer, env ) + Cost::safe;
    4449                                } // if
    4550                        } // if
     
    5459                if ( typesCompatibleIgnoreQualifiers( src, dest, indexer, env ) ) {
    5560///     std::cout << "compatible!" << std::endl;
    56                         return Cost( 0, 0, 0 );
     61                        return Cost::zero;
    5762                } else if ( dynamic_cast< VoidType* >( dest ) ) {
    58                         return Cost( 0, 0, 1 );
     63                        return Cost::safe;
     64                } else if ( ReferenceType * refType = dynamic_cast< ReferenceType * > ( dest ) ) {
     65                        // std::cerr << "conversionCost: dest is reference" << std::endl;
     66                        return convertToReferenceCost( src, refType, indexer, env );
    5967                } else {
    6068                        ConversionCost converter( dest, indexer, env );
     
    6371                                return Cost::infinity;
    6472                        } else {
    65                                 return converter.get_cost() + Cost( 0, 0, 0 );
    66                         } // if
    67                 } // if
     73                                return converter.get_cost() + Cost::zero;
     74                        } // if
     75                } // if
     76        }
     77
     78        Cost convertToReferenceCost( Type * src, Type * dest, int diff, const SymTab::Indexer & indexer, const TypeEnvironment & env ) {
     79                std::cerr << "convert to reference cost..." << std::endl;
     80                if ( diff > 0 ) {
     81                        // TODO: document this
     82                        Cost cost = convertToReferenceCost( safe_dynamic_cast< ReferenceType * >( src )->get_base(), dest, diff-1, indexer, env );
     83                        cost.incReference();
     84                        return cost;
     85                } else if ( diff < -1 ) {
     86                        // TODO: document this
     87                        Cost cost = convertToReferenceCost( src, safe_dynamic_cast< ReferenceType * >( dest )->get_base(), diff+1, indexer, env );
     88                        cost.incReference();
     89                        return cost;
     90                } else if ( diff == 0 ) {
     91                        ReferenceType * srcAsRef = dynamic_cast< ReferenceType * >( src );
     92                        ReferenceType * destAsRef = dynamic_cast< ReferenceType * >( dest );
     93                        if ( srcAsRef && destAsRef ) { // pointer-like conversions between references
     94                                std::cerr << "converting between references" << std::endl;
     95                                if ( srcAsRef->get_base()->get_qualifiers() <= destAsRef->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( srcAsRef->get_base(), destAsRef->get_base(), indexer, env ) ) {
     96                                        return Cost::safe;
     97                                } else {  // xxx - this discards reference qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?
     98                                        int assignResult = ptrsAssignable( srcAsRef->get_base(), destAsRef->get_base(), env );
     99                                        if ( assignResult < 0 ) {
     100                                                return Cost::safe;
     101                                        } else if ( assignResult > 0 ) {
     102                                                return Cost::unsafe;
     103                                        } // if
     104                                } // if
     105                        } else {
     106                                std::cerr << "reference to rvalue conversion" << std::endl;
     107                                ConversionCost converter( dest, indexer, env );
     108                                src->accept( converter );
     109                                return converter.get_cost();
     110                        } // if
     111                } else {
     112                        ReferenceType * destAsRef = dynamic_cast< ReferenceType * >( dest );
     113                        assert( diff == -1 && destAsRef );
     114                        if ( typesCompatibleIgnoreQualifiers( src, destAsRef->get_base(), indexer, env ) ) {
     115                                std::cerr << "converting compatible base type" << std::endl;
     116                                if ( src->get_lvalue() ) {
     117                                        std::cerr << "lvalue to reference conversion" << std::endl;
     118                                        // lvalue-to-reference conversion:  cv lvalue T => cv T &
     119                                        if ( src->get_qualifiers() == destAsRef->get_base()->get_qualifiers() ) {
     120                                                return Cost::reference; // cost needs to be non-zero to add cast
     121                                        } if ( src->get_qualifiers() < destAsRef->get_base()->get_qualifiers() ) {
     122                                                return Cost::safe; // cost needs to be higher than previous cast to differentiate adding qualifiers vs. keeping same
     123                                        } else {
     124                                                return Cost::unsafe;
     125                                        } // if
     126                                } else if ( destAsRef->get_base()->get_const() ) {
     127                                        std::cerr << "rvalue to const ref conversion" << std::endl;
     128                                        // rvalue-to-const-reference conversion: T => const T &
     129                                        return Cost::safe;
     130                                } else {
     131                                        // std::cerr << "rvalue to non-const reference conversion" << std::endl;
     132                                        // rvalue-to-reference conversion: T => T &
     133                                        return Cost::unsafe;
     134                                } // if
     135                        } // if
     136                        std::cerr << "attempting to convert from incompatible base type -- fail" << std::endl;
     137                }
     138                return Cost::infinity;
     139        }
     140
     141        Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env ) {
     142                int sdepth = src->referenceDepth(), ddepth = dest->referenceDepth();
     143                return convertToReferenceCost( src, dest, sdepth-ddepth, indexer, env );
    68144        }
    69145
     
    157233                        int tableResult = costMatrix[ basicType->get_kind() ][ destAsBasic->get_kind() ];
    158234                        if ( tableResult == -1 ) {
    159                                 cost = Cost( 1, 0, 0 );
    160                         } else {
    161                                 cost = Cost( 0, 0, tableResult );
     235                                cost = Cost::unsafe;
     236                        } else {
     237                                cost = Cost::zero;
     238                                cost.incSafe( tableResult );
    162239                        } // if
    163240                } else if ( dynamic_cast< EnumInstType *>( dest ) ) {
    164241                        // xxx - not positive this is correct, but appears to allow casting int => enum
    165                         cost = Cost( 1, 0, 0 );
     242                        cost = Cost::unsafe;
    166243                } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {
    167                         cost = Cost( 1, 0, 0 );
     244                        cost = Cost::unsafe;
    168245                } // if
    169246        }
     
    171248        void ConversionCost::visit(PointerType *pointerType) {
    172249                if ( PointerType *destAsPtr = dynamic_cast< PointerType* >( dest ) ) {
    173                         if ( pointerType->get_base()->get_qualifiers() <= destAsPtr->get_base()->get_qualifiers() && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
    174                                 cost = Cost( 0, 0, 1 );
    175                         } else {
     250                        // std::cerr << pointerType << " ===> " << destAsPtr;
     251                        Type::Qualifiers tq1 = pointerType->get_base()->get_qualifiers();
     252                        Type::Qualifiers tq2 = destAsPtr->get_base()->get_qualifiers();
     253                        if ( tq1 <= tq2 && typesCompatibleIgnoreQualifiers( pointerType->get_base(), destAsPtr->get_base(), indexer, env ) ) {
     254                                if ( tq1 == tq2 ) {
     255                                        // types are the same
     256                                        cost = Cost::zero;
     257                                } else {
     258                                        // types are the same, except otherPointer has more qualifiers
     259                                        // std::cerr << " :: compatible and good qualifiers" << std::endl;
     260                                        cost = Cost::safe;
     261                                }
     262                        } else {  // xxx - this discards qualifiers from consideration -- reducing qualifiers is a safe conversion; is this right?
    176263                                int assignResult = ptrsAssignable( pointerType->get_base(), destAsPtr->get_base(), env );
    177                                 if ( assignResult < 0 ) {
    178                                         cost = Cost( 0, 0, 1 );
     264                                // std::cerr << " :: " << assignResult << std::endl;
     265                                if ( assignResult < 0 && pointerType->get_base()->get_qualifiers() <= destAsPtr->get_qualifiers() ) {
     266                                        cost = Cost::safe;
    179267                                } else if ( assignResult > 0 ) {
    180                                         cost = Cost( 1, 0, 0 );
     268                                        cost = Cost::unsafe;
    181269                                } // if
     270                                // assignResult == 0 means Cost::Infinity
    182271                        } // if
    183272                } else if ( dynamic_cast< ZeroType* >( dest ) != nullptr || dynamic_cast< OneType* >( dest ) != nullptr ) {
    184                         cost = Cost( 1, 0, 0 );
     273                        cost = Cost::unsafe;
    185274                } // if
    186275        }
    187276
    188277        void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {}
     278
     279        void ConversionCost::visit(ReferenceType *refType) {
     280                // Note: dest can never be a reference, since it would have been caught in an earlier check
     281                assert( ! dynamic_cast< ReferenceType * >( dest ) );
     282                // convert reference to rvalue: cv T1 & => T2
     283                // recursively compute conversion cost from T1 to T2.
     284                // cv can be safely dropped because of 'implicit dereference' behavior.
     285                refType->get_base()->accept( *this );
     286                if ( refType->get_base()->get_qualifiers() == dest->get_qualifiers() ) {
     287                        cost.incReference();  // prefer exact qualifiers
     288                } else if ( refType->get_base()->get_qualifiers() < dest->get_qualifiers() ) {
     289                        cost.incSafe(); // then gaining qualifiers
     290                } else {
     291                        cost.incUnsafe(); // lose qualifiers as last resort
     292                }
     293                // std::cerr << refType << " ==> " << dest << " " << cost << std::endl;
     294        }
     295
    189296        void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {}
    190297
     
    208315                static Type::Qualifiers q;
    209316                static BasicType integer( q, BasicType::SignedInt );
    210                 integer.accept( *this );
    211                 if ( cost < Cost( 1, 0, 0 ) ) {
     317                integer.accept( *this );  // safe if dest >= int
     318                if ( cost < Cost::unsafe ) {
    212319                        cost.incSafe();
    213320                } // if
     
    231338                        assert( type );
    232339                        if ( type->get_base() ) {
    233                                 cost = conversionCost( type->get_base(), dest, indexer, env ) + Cost( 0, 0, 1 );
     340                                cost = conversionCost( type->get_base(), dest, indexer, env ) + Cost::safe;
    234341                        } // if
    235342                } // if
     
    237344
    238345        void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) {
    239                 Cost c;
     346                Cost c = Cost::zero;
    240347                if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
    241348                        std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
     
    269376                        int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];
    270377                        if ( tableResult == -1 ) {
    271                                 cost = Cost( 1, 0, 0 );
    272                         } else {
    273                                 cost = Cost( 0, 0, tableResult + 1 );
     378                                cost = Cost::unsafe;
     379                        } else {
     380                                cost = Cost::zero;
     381                                cost.incSafe( tableResult + 1 );
    274382                        }
    275383                } else if ( dynamic_cast< PointerType* >( dest ) ) {
    276                         cost = Cost( 0, 0, 1 );
     384                        cost = Cost::safe;
    277385                }
    278386        }
     
    285393                        int tableResult = costMatrix[ BasicType::SignedInt ][ destAsBasic->get_kind() ];
    286394                        if ( tableResult == -1 ) {
    287                                 cost = Cost( 1, 0, 0 );
    288                         } else {
    289                                 cost = Cost( 0, 0, tableResult + 1 );
     395                                cost = Cost::unsafe;
     396                        } else {
     397                                cost = Cost::zero;
     398                                cost.incSafe( tableResult + 1 );
    290399                        }
    291400                }
  • src/ResolvExpr/ConversionCost.h

    r54cd58b0 r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // ConversionCost.h -- 
     7// ConversionCost.h --
    88//
    99// Author           : Richard C. Bilson
     
    2525          public:
    2626                ConversionCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    27  
     27
    2828                Cost get_cost() const { return cost; }
    2929
     
    3232                virtual void visit(PointerType *pointerType);
    3333                virtual void visit(ArrayType *arrayType);
     34                virtual void visit(ReferenceType *refType);
    3435                virtual void visit(FunctionType *functionType);
    3536                virtual void visit(StructInstType *aggregateUseType);
     
    4849                const TypeEnvironment &env;
    4950        };
     51
     52        Cost convertToReferenceCost( Type * src, ReferenceType * dest, const SymTab::Indexer & indexer, const TypeEnvironment & env );
    5053} // namespace ResolvExpr
    5154
  • src/ResolvExpr/Cost.h

    r54cd58b0 r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // Cost.h -- 
     7// Cost.h --
    88//
    99// Author           : Richard C. Bilson
     
    2020namespace ResolvExpr {
    2121        class Cost {
     22          private:
     23                Cost( int unsafeCost, int polyCost, int safeCost, int referenceCost );
     24
    2225          public:
    23                 Cost();
    24                 Cost( int unsafe, int poly, int safe );
    25  
    26                 void incUnsafe( int inc = 1 );
    27                 void incPoly( int inc = 1 );
    28                 void incSafe( int inc = 1 );
    29  
     26                Cost & incUnsafe( int inc = 1 );
     27                Cost & incPoly( int inc = 1 );
     28                Cost & incSafe( int inc = 1 );
     29                Cost & incReference( int inc = 1 );
     30
    3031                Cost operator+( const Cost &other ) const;
    3132                Cost operator-( const Cost &other ) const;
     
    3536                bool operator!=( const Cost &other ) const;
    3637                friend std::ostream &operator<<( std::ostream &os, const Cost &cost );
    37  
     38
    3839                static const Cost zero;
    3940                static const Cost infinity;
     41
     42                static const Cost unsafe;
     43                static const Cost poly;
     44                static const Cost safe;
     45                static const Cost reference;
    4046          private:
    4147                int compare( const Cost &other ) const;
    4248
    43                 int unsafe;
    44                 int poly;
    45                 int safe;
     49                int unsafeCost;
     50                int polyCost;
     51                int safeCost;
     52                int referenceCost;
    4653        };
    4754
    48         inline Cost::Cost() : unsafe( 0 ), poly( 0 ), safe( 0 ) {}
     55        inline Cost::Cost( int unsafeCost, int polyCost, int safeCost, int referenceCost ) : unsafeCost( unsafeCost ), polyCost( polyCost ), safeCost( safeCost ), referenceCost( referenceCost ) {}
    4956
    50         inline Cost::Cost( int unsafe, int poly, int safe ) : unsafe( unsafe ), poly( poly ), safe( safe ) {}
    51 
    52         inline void Cost::incUnsafe( int inc ) {
    53                 unsafe += inc;
     57        inline Cost & Cost::incUnsafe( int inc ) {
     58                if ( *this == infinity ) return *this;
     59                unsafeCost += inc;
     60                return *this;
    5461        }
    5562
    56         inline void Cost::incPoly( int inc ) {
    57                 poly += inc;
     63        inline Cost & Cost::incPoly( int inc ) {
     64                if ( *this == infinity ) return *this;
     65                polyCost += inc;
     66                return *this;
    5867        }
    5968
    60         inline void Cost::incSafe( int inc ) {
    61                 safe += inc;
     69        inline Cost & Cost::incSafe( int inc ) {
     70                if ( *this == infinity ) return *this;
     71                safeCost += inc;
     72                return *this;
     73        }
     74
     75        inline Cost & Cost::incReference( int inc ) {
     76                if ( *this == infinity ) return *this;
     77                referenceCost += inc;
     78                return *this;
    6279        }
    6380
    6481        inline Cost Cost::operator+( const Cost &other ) const {
    65                 return Cost( unsafe + other.unsafe, poly + other.poly, safe + other.safe );
     82                if ( *this == infinity || other == infinity ) return infinity;
     83                return Cost( unsafeCost + other.unsafeCost, polyCost + other.polyCost, safeCost + other.safeCost, referenceCost + other.referenceCost );
    6684        }
    6785
    6886        inline Cost Cost::operator-( const Cost &other ) const {
    69                 return Cost( unsafe - other.unsafe, poly - other.poly, safe - other.safe );
     87                if ( *this == infinity || other == infinity ) return infinity;
     88                return Cost( unsafeCost - other.unsafeCost, polyCost - other.polyCost, safeCost - other.safeCost, referenceCost - other.referenceCost );
    7089        }
    7190
    7291        inline Cost &Cost::operator+=( const Cost &other ) {
    73                 unsafe += other.unsafe;
    74                 poly += other.poly;
    75                 safe += other.safe;
     92                if ( *this == infinity ) return *this;
     93                if ( other == infinity ) {
     94                        *this = infinity;
     95                        return *this;
     96                }
     97                unsafeCost += other.unsafeCost;
     98                polyCost += other.polyCost;
     99                safeCost += other.safeCost;
     100                referenceCost += other.referenceCost;
    76101                return *this;
    77102        }
    78103
    79104        inline bool Cost::operator<( const Cost &other ) const {
    80             if ( *this == infinity ) return false;
    81             if ( other == infinity ) return true;
    82             if ( unsafe > other.unsafe ) {
     105                if ( *this == infinity ) return false;
     106                if ( other == infinity ) return true;
     107
     108                if ( unsafeCost > other.unsafeCost ) {
    83109                        return false;
    84             } else if ( unsafe < other.unsafe ) {
     110                } else if ( unsafeCost < other.unsafeCost ) {
    85111                        return true;
    86             } else if ( poly > other.poly ) {
     112                } else if ( polyCost > other.polyCost ) {
    87113                        return false;
    88             } else if ( poly < other.poly ) {
     114                } else if ( polyCost < other.polyCost ) {
    89115                        return true;
    90             } else if ( safe > other.safe ) {
     116                } else if ( safeCost > other.safeCost ) {
    91117                        return false;
    92             } else if ( safe < other.safe ) {
     118                } else if ( safeCost < other.safeCost ) {
    93119                        return true;
    94             } else {
     120                } else if ( referenceCost > other.referenceCost ) {
    95121                        return false;
    96             } // if
     122                } else if ( referenceCost < other.referenceCost ) {
     123                        return true;
     124                } else {
     125                        return false;
     126                } // if
    97127        }
    98128
    99129        inline bool Cost::operator==( const Cost &other ) const {
    100                 return unsafe == other.unsafe
    101                         && poly == other.poly
    102                         && safe == other.safe;
     130                return unsafeCost == other.unsafeCost
     131                        && polyCost == other.polyCost
     132                        && safeCost == other.safeCost
     133                        && referenceCost == other.referenceCost;
    103134        }
    104135
     
    108139
    109140        inline std::ostream &operator<<( std::ostream &os, const Cost &cost ) {
    110                 os << "( " << cost.unsafe << ", " << cost.poly << ", " << cost.safe << " )";
     141                os << "( " << cost.unsafeCost << ", " << cost.polyCost << ", " << cost.safeCost << ", " << cost.referenceCost << " )";
    111142                return os;
    112143        }
  • src/ResolvExpr/Unify.cc

    r54cd58b0 r9236060  
    4242                virtual void visit(PointerType *pointerType);
    4343                virtual void visit(ArrayType *arrayType);
     44                virtual void visit(ReferenceType *refType);
    4445                virtual void visit(FunctionType *functionType);
    4546                virtual void visit(StructInstType *aggregateUseType);
     
    376377                                } // if
    377378                        } else {
     379                                common = type1->clone();
     380                                common->get_qualifiers() = tq1 | tq2;
    378381                                result = true;
    379382                        } // if
     
    425428                        markAssertions( haveAssertions, needAssertions, pointerType );
    426429                        markAssertions( haveAssertions, needAssertions, otherPointer );
     430                } // if
     431        }
     432
     433        void Unify::visit(ReferenceType *refType) {
     434                if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {
     435                        result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
     436                        markAssertions( haveAssertions, needAssertions, refType );
     437                        markAssertions( haveAssertions, needAssertions, otherRef );
    427438                } // if
    428439        }
  • src/ResolvExpr/typeops.h

    r54cd58b0 r9236060  
    6666        Cost castCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    6767
    68         template< typename SrcIterator, typename DestIterator >
    69         Cost castCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
    70                 Cost ret;
    71                 if ( destBegin == destEnd ) {
    72                         if ( srcBegin == srcEnd ) {
    73                                 return Cost::zero;
    74                         } else {
    75                                 return Cost( 0, 0, 1 );
    76                         } // if
    77                 } // if
    78                 while ( srcBegin != srcEnd && destBegin != destEnd ) {
    79                         Cost thisCost = castCost( *srcBegin++, *destBegin++, indexer, env );
    80                         if ( thisCost == Cost::infinity ) {
    81                                 return Cost::infinity;
    82                         } // if
    83                         ret += thisCost;
    84                 } // while
    85                 if ( srcBegin == srcEnd && destBegin == destEnd ) {
    86                         return ret;
    87                 } else {
    88                         return Cost::infinity;
    89                 } // if
    90         }
    91 
    9268        // in ConversionCost.cc
    9369        Cost conversionCost( Type *src, Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    94 
    95         template< typename SrcIterator, typename DestIterator >
    96         Cost conversionCostList( SrcIterator srcBegin, SrcIterator srcEnd, DestIterator destBegin, DestIterator destEnd, const SymTab::Indexer &indexer, const TypeEnvironment &env ) {
    97                 Cost ret;
    98                 while ( srcBegin != srcEnd && destBegin != destEnd ) {
    99                         Cost thisCost = conversionCost( *srcBegin++, *destBegin++, indexer, env );
    100                         if ( thisCost == Cost::infinity ) {
    101                                 return Cost::infinity;
    102                         } // if
    103                         ret += thisCost;
    104                 } // while
    105                 if ( srcBegin == srcEnd && destBegin == destEnd ) {
    106                         return ret;
    107                 } else {
    108                         return Cost::infinity;
    109                 } // if
    110         }
    11170
    11271        // in PtrsAssignable.cc
  • src/SymTab/Autogen.cc

    r54cd58b0 r9236060  
    1313// Update Count     : 62
    1414//
     15
    1516#include "Autogen.h"
    1617
     
    2324
    2425#include "AddVisit.h"              // for addVisit
     26#include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign
    2527#include "Common/ScopedMap.h"      // for ScopedMap<>::const_iterator, Scope...
    2628#include "Common/utility.h"        // for cloneAll, operator+
     
    2830#include "GenPoly/ScopedSet.h"     // for ScopedSet, ScopedSet<>::iterator
    2931#include "SymTab/Mangler.h"        // for Mangler
     32#include "SynTree/Attribute.h"     // For Attribute
    3033#include "SynTree/Mutator.h"       // for maybeMutate
    3134#include "SynTree/Statement.h"     // for CompoundStmt, ReturnStmt, ExprStmt
     
    131134        FunctionType * genDefaultType( Type * paramType ) {
    132135                FunctionType *ftype = new FunctionType( Type::Qualifiers(), false );
    133                 ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr );
     136                ObjectDecl *dstParam = new ObjectDecl( "_dst", Type::StorageClasses(), LinkageSpec::Cforall, nullptr, new ReferenceType( Type::Qualifiers(), paramType->clone() ), nullptr );
    134137                ftype->get_parameters().push_back( dstParam );
    135138
     
    182185                        FunctionType * ftype = funcDecl->get_functionType();
    183186                        assert( ! ftype->get_parameters().empty() );
    184                         Type * t = safe_dynamic_cast< PointerType * >( ftype->get_parameters().front()->get_type() )->get_base();
     187                        Type * t = InitTweak::getPointerBase( ftype->get_parameters().front()->get_type() );
     188                        assert( t );
    185189                        map.insert( Mangler::mangleType( t ), true );
    186190                }
     
    228232                        FunctionType * ftype = data.genType( refType );
    229233
    230                         if(concurrent_type && InitTweak::isDestructor( data.fname )) {
     234                        if(concurrent_type && CodeGen::isDestructor( data.fname )) {
    231235                                ftype->get_parameters().front()->get_type()->set_mutex( true );
    232236                        }
     
    280284                FunctionType *copyCtorType = genCopyType( refType->clone() );
    281285
     286                // add unused attribute to parameters of default constructor and destructor
     287                ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     288                dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     289
    282290                // xxx - should we also generate void ?{}(E *, int) and E ?{}(E *, E)?
    283291                // right now these cases work, but that might change.
     
    303311        /// generates a single struct member operation (constructor call, destructor call, assignment call)
    304312        void makeStructMemberOp( ObjectDecl * dstParam, Expression * src, DeclarationWithType * field, FunctionDecl * func, bool isDynamicLayout, bool forward = true ) {
    305                 ObjectDecl * returnVal = NULL;
    306                 if ( ! func->get_functionType()->get_returnVals().empty() ) {
    307                         returnVal = dynamic_cast<ObjectDecl*>( func->get_functionType()->get_returnVals().front() );
    308                 }
    309 
    310313                InitTweak::InitExpander srcParam( src );
    311314
    312                 // assign to destination (and return value if generic)
    313                 UntypedExpr *derefExpr = UntypedExpr::createDeref( new VariableExpr( dstParam ) );
    314                 Expression *dstselect = new MemberExpr( field, derefExpr );
     315                // assign to destination
     316                Expression *dstselect = new MemberExpr( field, new CastExpr( new VariableExpr( dstParam ), safe_dynamic_cast< ReferenceType* >( dstParam->get_type() )->get_base()->clone() ) );
    315317                genImplicitCall( srcParam, dstselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    316 
    317                 if ( isDynamicLayout && returnVal ) {
    318                         // xxx - there used to be a dereference on returnVal, but this seems to have been wrong?
    319                         Expression *retselect = new MemberExpr( field, new VariableExpr( returnVal ) );
    320                         genImplicitCall( srcParam, retselect, func->get_name(), back_inserter( func->get_statements()->get_kids() ), field, forward );
    321                 } // if
    322318        }
    323319
     
    424420
    425421                // field ctors are only generated if default constructor and copy constructor are both generated
    426                 unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return InitTweak::isConstructor( dcl->get_name() ); } );
     422                unsigned numCtors = std::count_if( newFuncs.begin(), newFuncs.end(), [](FunctionDecl * dcl) { return CodeGen::isConstructor( dcl->get_name() ); } );
    427423
    428424                if ( functionNesting == 0 ) {
     
    439435                        // generate appropriate calls to member ctor, assignment
    440436                        // destructor needs to do everything in reverse, so pass "forward" based on whether the function is a destructor
    441                         if ( ! InitTweak::isDestructor( dcl->get_name() ) ) {
     437                        if ( ! CodeGen::isDestructor( dcl->get_name() ) ) {
    442438                                makeStructFunctionBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), dcl, isDynamicLayout );
    443439                        } else {
    444440                                makeStructFunctionBody( aggregateDecl->get_members().rbegin(), aggregateDecl->get_members().rend(), dcl, isDynamicLayout, false );
    445441                        }
    446                         if ( InitTweak::isAssignment( dcl->get_name() ) ) {
     442                        if ( CodeGen::isAssignment( dcl->get_name() ) ) {
    447443                                // assignment needs to return a value
    448444                                FunctionType * assignType = dcl->get_functionType();
     
    473469                                        // our inheritance model. I think the correct way to handle this is to
    474470                                        // cast the structure to the type of the member and let the resolver
    475                                         // figure out whether it's valid and have a pass afterwards that fixes
    476                                         // the assignment to use pointer arithmetic with the offset of the
    477                                         // member, much like how generic type members are handled.
     471                                        // figure out whether it's valid/choose the correct unnamed member
    478472                                        continue;
    479473                                }
     
    491485        void makeUnionFieldsAssignment( ObjectDecl * srcParam, ObjectDecl * dstParam, OutputIterator out ) {
    492486                UntypedExpr *copy = new UntypedExpr( new NameExpr( "__builtin_memcpy" ) );
    493                 copy->get_args().push_back( new VariableExpr( dstParam ) );
     487                copy->get_args().push_back( new AddressExpr( new VariableExpr( dstParam ) ) );
    494488                copy->get_args().push_back( new AddressExpr( new VariableExpr( srcParam ) ) );
    495489                copy->get_args().push_back( new SizeofExpr( srcParam->get_type()->clone() ) );
     
    503497                ObjectDecl * dstParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().front() );
    504498                ObjectDecl * srcParam = safe_dynamic_cast< ObjectDecl * >( ftype->get_parameters().back() );
    505                 ObjectDecl * returnVal = nullptr;
    506                 if ( ! ftype->get_returnVals().empty() ) {
    507                         returnVal = safe_dynamic_cast< ObjectDecl * >( ftype->get_returnVals().front() );
    508                 }
    509499
    510500                makeUnionFieldsAssignment( srcParam, dstParam, back_inserter( funcDecl->get_statements()->get_kids() ) );
    511                 if ( returnVal ) {
     501                if ( CodeGen::isAssignment( funcDecl->get_name() ) ) {
     502                        // also generate return statement in assignment
    512503                        funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( noLabels, new VariableExpr( srcParam ) ) );
    513504                }
     
    536527                cloneAll( typeParams, copyCtorType->get_forall() );
    537528                cloneAll( typeParams, assignType->get_forall() );
     529
     530                // add unused attribute to parameters of default constructor and destructor
     531                ctorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
     532                dtorType->get_parameters().front()->get_attributes().push_back( new Attribute( "unused" ) );
    538533
    539534                // Routines at global scope marked "static" to prevent multiple definitions is separate translation units
  • src/SymTab/Autogen.h

    r54cd58b0 r9236060  
    4343        extern Type * SizeType;
    4444
     45        /// intrinsic dereference operator for unqualified types - set when *? function is seen in FindSpecialDeclarations.
     46        /// Useful for creating dereference ApplicationExprs without a full resolver pass.
     47        extern FunctionDecl * dereferenceOperator;
     48
     49        // temporary
     50        FunctionType * genAssignType( Type * paramType );
     51
    4552        /// inserts into out a generated call expression to function fname with arguments dstParam and srcParam. Intended to be used with generated ?=?, ?{}, and ^?{} calls.
    4653        template< typename OutputIterator >
     
    5158        template< typename OutputIterator >
    5259        Statement * genScalarCall( InitTweak::InitExpander & srcParam, Expression *dstParam, const std::string & fname, OutputIterator out, Type * type, bool addCast = false ) {
    53         // want to be able to generate assignment, ctor, and dtor generically,
    54         // so fname is either ?=?, ?{}, or ^?{}
    55         UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );
     60                // want to be able to generate assignment, ctor, and dtor generically,
     61                // so fname is either ?=?, ?{}, or ^?{}
     62                UntypedExpr *fExpr = new UntypedExpr( new NameExpr( fname ) );
    5663
    57         // do something special for unnamed members
    58         dstParam = new AddressExpr( dstParam );
    59         if ( addCast ) {
    60                 // cast to T* with qualifiers removed, so that qualified objects can be constructed
    61                 // and destructed with the same functions as non-qualified objects.
    62                 // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument
    63                 // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever
    64                 // remove lvalue as a qualifier, this can change to
    65                 //   type->get_qualifiers() = Type::Qualifiers();
    66                 assert( type );
    67                 Type * castType = type->clone();
    68                 castType->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
    69                 castType->set_lvalue( true ); // xxx - might not need this
    70                 dstParam = new CastExpr( dstParam, new PointerType( Type::Qualifiers(), castType ) );
    71         }
    72         fExpr->get_args().push_back( dstParam );
     64                if ( addCast ) {
     65                        // cast to T& with qualifiers removed, so that qualified objects can be constructed
     66                        // and destructed with the same functions as non-qualified objects.
     67                        // unfortunately, lvalue is considered a qualifier. For AddressExpr to resolve, its argument
     68                        // must have an lvalue qualified type, so remove all qualifiers except lvalue. If we ever
     69                        // remove lvalue as a qualifier, this can change to
     70                        //   type->get_qualifiers() = Type::Qualifiers();
     71                        assert( type );
     72                        Type * castType = type->clone();
     73                        castType->get_qualifiers() -= Type::Qualifiers( Type::Lvalue | Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
     74                        // castType->set_lvalue( true ); // xxx - might not need this
     75                        dstParam = new CastExpr( dstParam, new ReferenceType( Type::Qualifiers(), castType ) );
     76                }
     77                fExpr->get_args().push_back( dstParam );
    7378
    74         Statement * listInit = srcParam.buildListInit( fExpr );
     79                Statement * listInit = srcParam.buildListInit( fExpr );
    7580
    76         std::list< Expression * > args = *++srcParam;
    77         fExpr->get_args().splice( fExpr->get_args().end(), args );
     81                std::list< Expression * > args = *++srcParam;
     82                fExpr->get_args().splice( fExpr->get_args().end(), args );
    7883
    79         *out++ = new ExprStmt( noLabels, fExpr );
     84                *out++ = new ExprStmt( noLabels, fExpr );
    8085
    81         srcParam.clearArrayIndices();
     86                srcParam.clearArrayIndices();
    8287
    83         return listInit;
     88                return listInit;
    8489        }
    8590
     
    117122
    118123                UntypedExpr *inc = new UntypedExpr( update );
    119                 inc->get_args().push_back( new AddressExpr( new VariableExpr( index ) ) );
     124                inc->get_args().push_back( new VariableExpr( index ) );
    120125
    121126                UntypedExpr *dstIndex = new UntypedExpr( new NameExpr( "?[?]" ) );
  • src/SymTab/Indexer.cc

    r54cd58b0 r9236060  
    2323#include <utility>                 // for pair, make_pair, move
    2424
     25#include "CodeGen/OperatorTable.h" // for isCtorDtor, isCtorDtorAssign
    2526#include "Common/SemanticError.h"  // for SemanticError
    2627#include "Common/utility.h"        // for cloneAll
     
    111112        void Indexer::removeSpecialOverrides( const std::string &id, std::list< DeclarationWithType * > & out ) const {
    112113                // only need to perform this step for constructors, destructors, and assignment functions
    113                 if ( ! InitTweak::isCtorDtorAssign( id ) ) return;
     114                if ( ! CodeGen::isCtorDtorAssign( id ) ) return;
    114115
    115116                // helpful data structure
     
    139140                                decls.push_back( DeclBall{ function, isUserDefinedFunc, isDefaultCtor, isDtor, isCopyFunc } );
    140141                                existsUserDefinedFunc = existsUserDefinedFunc || isUserDefinedFunc;
    141                                 existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && InitTweak::isConstructor( function->get_name() ) );
     142                                existsUserDefinedCtor = existsUserDefinedCtor || (isUserDefinedFunc && CodeGen::isConstructor( function->get_name() ) );
    142143                                existsUserDefinedDtor = existsUserDefinedDtor || (isUserDefinedFunc && isDtor);
    143144                                existsUserDefinedCopyFunc = existsUserDefinedCopyFunc || (isUserDefinedFunc && isCopyFunc);
     
    157158                                assert( ! params.empty() );
    158159                                // use base type of pointer, so that qualifiers on the pointer type aren't considered.
    159                                 Type * base = safe_dynamic_cast< PointerType * >( params.front()->get_type() )->get_base();
     160                                Type * base = InitTweak::getPointerBase( params.front()->get_type() );
     161                                assert( base );
    160162                                funcMap[ Mangler::mangle( base ) ] += function;
    161163                        } else {
  • src/SymTab/Mangler.cc

    r54cd58b0 r9236060  
    131131                mangleName << "A0";
    132132                maybeAccept( arrayType->get_base(), *this );
     133        }
     134
     135        void Mangler::visit( ReferenceType *refType ) {
     136                printQualifiers( refType );
     137                mangleName << "R";
     138                maybeAccept( refType->get_base(), *this );
    133139        }
    134140
     
    302308                // Removed due to restrict not affecting function compatibility in GCC
    303309//              if ( type->get_isRestrict() ) {
    304 //                      mangleName << "R";
     310//                      mangleName << "E";
    305311//              } // if
    306312                if ( type->get_lvalue() ) {
  • src/SymTab/Mangler.h

    r54cd58b0 r9236060  
    4242                virtual void visit( PointerType *pointerType );
    4343                virtual void visit( ArrayType *arrayType );
     44                virtual void visit( ReferenceType *refType );
    4445                virtual void visit( FunctionType *functionType );
    4546                virtual void visit( StructInstType *aggregateUseType );
  • src/SymTab/Validate.cc

    r54cd58b0 r9236060  
    5454#include "Autogen.h"                   // for SizeType, autogenerateRoutines
    5555#include "CodeGen/CodeGenerator.h"     // for genName
     56#include "CodeGen/OperatorTable.h"     // for isCtorDtor, isCtorDtorAssign
    5657#include "Common/PassVisitor.h"        // for PassVisitor, WithDeclsToAdd
    5758#include "Common/ScopedMap.h"          // for ScopedMap<>::const_iterator
     
    239240        };
    240241
     242
     243        FunctionDecl * dereferenceOperator = nullptr;
     244        struct FindSpecialDeclarations final {
     245                void previsit( FunctionDecl * funcDecl );
     246        };
     247
    241248        void validate( std::list< Declaration * > &translationUnit, bool doDebug ) {
    242249                PassVisitor<EnumAndPointerDecay> epc;
     
    245252                PassVisitor<CompoundLiteral> compoundliteral;
    246253                PassVisitor<ValidateGenericParameters> genericParams;
     254                PassVisitor<FindSpecialDeclarations> finder;
    247255
    248256                EliminateTypedef::eliminateTypedef( translationUnit );
     
    261269                acceptAll( translationUnit, fpd );
    262270                ArrayLength::computeLength( translationUnit );
     271                acceptAll( translationUnit, finder );
    263272        }
    264273
     
    821830                std::list< DeclarationWithType * > &params = funcType->get_parameters();
    822831
    823                 if ( InitTweak::isCtorDtorAssign( funcDecl->get_name() ) ) {
     832                if ( CodeGen::isCtorDtorAssign( funcDecl->get_name() ) ) { // TODO: also check /=, etc.
    824833                        if ( params.size() == 0 ) {
    825834                                throw SemanticError( "Constructors, destructors, and assignment functions require at least one parameter ", funcDecl );
    826835                        }
    827                         PointerType * ptrType = dynamic_cast< PointerType * >( params.front()->get_type() );
    828                         if ( ! ptrType || ptrType->is_array() ) {
    829                                 throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a pointer ", funcDecl );
     836                        ReferenceType * refType = dynamic_cast< ReferenceType * >( params.front()->get_type() );
     837                        if ( ! refType ) {
     838                                throw SemanticError( "First parameter of a constructor, destructor, or assignment function must be a reference ", funcDecl );
    830839                        }
    831                         if ( InitTweak::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {
     840                        if ( CodeGen::isCtorDtor( funcDecl->get_name() ) && returnVals.size() != 0 ) {
    832841                                throw SemanticError( "Constructors and destructors cannot have explicit return values ", funcDecl );
    833842                        }
     
    945954                }
    946955        }
     956
     957        void FindSpecialDeclarations::previsit( FunctionDecl * funcDecl ) {
     958                if ( ! dereferenceOperator ) {
     959                        if ( funcDecl->get_name() == "*?" && funcDecl->get_linkage() == LinkageSpec::Intrinsic ) {
     960                                FunctionType * ftype = funcDecl->get_functionType();
     961                                if ( ftype->get_parameters().size() == 1 && ftype->get_parameters().front()->get_type()->get_qualifiers() == Type::Qualifiers() ) {
     962                                        dereferenceOperator = funcDecl;
     963                                }
     964                        }
     965                }
     966        }
    947967} // namespace SymTab
    948968
  • src/SynTree/AddressExpr.cc

    r54cd58b0 r9236060  
    1818#include "Common/utility.h"
    1919
     20// Address expressions are typed based on the following inference rules:
     21//    E : lvalue T  &..& (n references)
     22//   &E :        T *&..& (n references)
     23//
     24//    E : T  &..&        (m references)
     25//   &E : T *&..&        (m-1 references)
     26//
     27// That is, lvalues becomes
     28
     29namespace {
     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
    2039AddressExpr::AddressExpr( Expression *arg, Expression *_aname ) : Expression( _aname ), arg( arg ) {
    2140        if ( arg->has_result() ) {
    22                 set_result( new PointerType( Type::Qualifiers(), arg->get_result()->clone() ) );
     41                if ( arg->get_result()->get_lvalue() ) {
     42                        // lvalue, retains all layers of reference and gains a pointer inside the references
     43                        set_result( addrType( arg->get_result() ) );
     44                } else {
     45                        // taking address of non-lvalue -- must be a reference, loses one layer of reference
     46                        ReferenceType * refType = safe_dynamic_cast< ReferenceType * >( arg->get_result() );
     47                        set_result( addrType( refType->get_base() ) );
     48                }
     49                // result of & is never an lvalue
     50                get_result()->set_lvalue( false );
    2351        }
    2452}
  • src/SynTree/ApplicationExpr.cc

    r54cd58b0 r9236060  
    4444}
    4545
    46 ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list< Expression * > & argList ) : function( funcExpr ), args( argList ) {
     46ApplicationExpr::ApplicationExpr( Expression *funcExpr, const std::list<Expression *> & args ) : function( funcExpr ), args( args ) {
    4747        PointerType *pointer = safe_dynamic_cast< PointerType* >( funcExpr->get_result() );
    4848        FunctionType *function = safe_dynamic_cast< FunctionType* >( pointer->get_base() );
  • src/SynTree/Expression.cc

    r54cd58b0 r9236060  
    3434#include "InitTweak/InitTweak.h"
    3535
     36#include "GenPoly/Lvalue.h"
    3637
    3738Expression::Expression( Expression *_aname ) : result( 0 ), env( 0 ), argName( _aname ) {}
     
    9293}
    9394
     95VariableExpr * VariableExpr::functionPointer( FunctionDecl * func ) {
     96        VariableExpr * funcExpr = new VariableExpr( func );
     97        funcExpr->set_result( new PointerType( Type::Qualifiers(), funcExpr->get_result() ) );
     98        return funcExpr;
     99}
     100
    94101void VariableExpr::print( std::ostream &os, int indent ) const {
    95102        os << "Variable Expression: ";
     
    152159
    153160void AlignofExpr::print( std::ostream &os, int indent) const {
    154         os << std::string( indent, ' ' ) << "Alignof Expression on: ";
     161        os << "Alignof Expression on: ";
    155162
    156163        if (isType)
     
    261268
    262269void AttrExpr::print( std::ostream &os, int indent) const {
    263         os << std::string( indent, ' ' ) << "Attr ";
     270        os << "Attr ";
    264271        attr->print( os, indent + 2 );
    265272        if ( isType || expr ) {
     
    360367namespace {
    361368        TypeSubstitution makeSub( Type * t ) {
    362                 if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) {
     369                if ( ReferenceType * refType = dynamic_cast< ReferenceType * >( t ) ) {
     370                        return makeSub( refType->get_base() );
     371                } else if ( StructInstType * aggInst = dynamic_cast< StructInstType * >( t ) ) {
    363372                        return TypeSubstitution( aggInst->get_baseParameters()->begin(), aggInst->get_baseParameters()->end(), aggInst->get_parameters().begin() );
    364373                } else if ( UnionInstType * aggInst = dynamic_cast< UnionInstType * >( t ) ) {
     
    425434        if ( Type * type = expr->get_result() ) {
    426435                Type * base = InitTweak::getPointerBase( type );
    427                 if ( ! base ) {
    428                         std::cerr << type << std::endl;
     436                assertf( base, "expected pointer type in dereference (type was %s)", toString( type ).c_str() );
     437                ret->set_result( base->clone() );
     438                if ( GenPoly::referencesPermissable() ) {
     439                        // if references are still allowed in the AST, dereference returns a reference
     440                        ret->set_result( new ReferenceType( Type::Qualifiers(), ret->get_result() ) );
     441                } else {
     442                        // references have been removed, in which case dereference returns an lvalue of the base type.
     443                        ret->get_result()->set_lvalue( true );
    429444                }
    430                 assertf( base, "expected pointer type in dereference\n" );
    431                 ret->set_result( maybeClone( base ) );
    432445        }
    433446        return ret;
     
    493506
    494507void LogicalExpr::print( std::ostream &os, int indent )const {
    495         os << std::string( indent, ' ' ) << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
     508        os << "Short-circuited operation (" << (isAnd?"and":"or") << ") on: ";
    496509        arg1->print(os);
    497510        os << " and ";
  • src/SynTree/Expression.h

    r54cd58b0 r9236060  
    280280        void set_var( DeclarationWithType * newValue ) { var = newValue; }
    281281
     282        static VariableExpr * functionPointer( FunctionDecl * decl );
     283
    282284        virtual VariableExpr * clone() const { return new VariableExpr( * this ); }
    283285        virtual void accept( Visitor & v ) { v.visit( this ); }
  • src/SynTree/Mutator.cc

    r54cd58b0 r9236060  
    480480}
    481481
     482Type *Mutator::mutate( ReferenceType *refType ) {
     483        mutateAll( refType->get_forall(), *this );
     484        refType->set_base( maybeMutate( refType->get_base(), *this ) );
     485        return refType;
     486}
     487
    482488Type *Mutator::mutate( FunctionType *functionType ) {
    483489        mutateAll( functionType->get_forall(), *this );
  • src/SynTree/Mutator.h

    r54cd58b0 r9236060  
    9292        virtual Type* mutate( PointerType *pointerType );
    9393        virtual Type* mutate( ArrayType *arrayType );
     94        virtual Type* mutate( ReferenceType *refType );
    9495        virtual Type* mutate( FunctionType *functionType );
    9596        virtual Type* mutate( StructInstType *aggregateUseType );
  • src/SynTree/SynTree.h

    r54cd58b0 r9236060  
    101101class PointerType;
    102102class ArrayType;
     103class ReferenceType;
    103104class FunctionType;
    104105class ReferenceToType;
  • src/SynTree/Type.cc

    r54cd58b0 r9236060  
    6565const char * Type::QualifiersNames[] = { "const", "restrict", "volatile", "lvalue", "mutex", "_Atomic" };
    6666
    67 Type *Type::stripDeclarator() {
     67Type * Type::stripDeclarator() {
    6868        Type * type = this;
    6969        while ( Type * at = InitTweak::getPointerBase( type ) ) {
     
    7272        return type;
    7373}
     74
     75Type * Type::stripReferences() {
     76        Type * type = this;
     77        while ( ReferenceType * ref = dynamic_cast<ReferenceType *>( type ) ) {
     78                type = ref->get_base();
     79        }
     80        return type;
     81}
     82
     83int Type::referenceDepth() const { return 0; }
    7484
    7585void Type::print( std::ostream &os, int indent ) const {
  • src/SynTree/Type.h

    r54cd58b0 r9236060  
    162162
    163163        /// return type without outer pointers and arrays
    164         Type *stripDeclarator();
     164        Type * stripDeclarator();
     165
     166        /// return type without outer references
     167        Type * stripReferences();
     168
     169        /// return the number of references occuring consecutively on the outermost layer of this type (i.e. do not count references nested within other types)
     170        virtual int referenceDepth() const;
    165171
    166172        virtual bool isComplete() const { return true; }
     
    256262        bool is_array() const { return isStatic || isVarLen || dimension; }
    257263
     264        virtual bool isComplete() const { return ! isVarLen; }
     265
    258266        virtual PointerType *clone() const { return new PointerType( *this ); }
    259267        virtual void accept( Visitor & v ) { v.visit( this ); }
     
    290298};
    291299
     300class ReferenceType : public Type {
     301public:
     302        Type *base;
     303
     304        ReferenceType( const Type::Qualifiers & tq, Type *base, const std::list< Attribute * > & attributes = std::list< Attribute * >() );
     305        ReferenceType( const ReferenceType & );
     306        virtual ~ReferenceType();
     307
     308        Type *get_base() { return base; }
     309        void set_base( Type *newValue ) { base = newValue; }
     310
     311        virtual int referenceDepth() const;
     312
     313        virtual ReferenceType *clone() const { return new ReferenceType( *this ); }
     314        virtual void accept( Visitor & v ) { v.visit( this ); }
     315        virtual Type *acceptMutator( Mutator & m ) { return m.mutate( this ); }
     316        virtual void print( std::ostream & os, int indent = 0 ) const;
     317};
     318
    292319class FunctionType : public Type {
    293320  public:
  • src/SynTree/TypeExpr.cc

    r54cd58b0 r9236060  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // TypeExpr.cc -- 
     7// TypeExpr.cc --
    88//
    99// Author           : Richard C. Bilson
  • src/SynTree/Visitor.cc

    r54cd58b0 r9236060  
    368368void Visitor::visit( PointerType *pointerType ) {
    369369        acceptAll( pointerType->get_forall(), *this );
     370        // xxx - should PointerType visit/mutate dimension?
    370371        maybeAccept( pointerType->get_base(), *this );
    371372}
     
    375376        maybeAccept( arrayType->get_dimension(), *this );
    376377        maybeAccept( arrayType->get_base(), *this );
     378}
     379
     380void Visitor::visit( ReferenceType *refType ) {
     381        acceptAll( refType->get_forall(), *this );
     382        maybeAccept( refType->get_base(), *this );
    377383}
    378384
  • src/SynTree/Visitor.h

    r54cd58b0 r9236060  
    9595        virtual void visit( PointerType *pointerType );
    9696        virtual void visit( ArrayType *arrayType );
     97        virtual void visit( ReferenceType *refType );
    9798        virtual void visit( FunctionType *functionType );
    9899        virtual void visit( StructInstType *aggregateUseType );
  • src/SynTree/module.mk

    r54cd58b0 r9236060  
    2020       SynTree/PointerType.cc \
    2121       SynTree/ArrayType.cc \
     22       SynTree/ReferenceType.cc \
    2223       SynTree/FunctionType.cc \
    2324       SynTree/ReferenceToType.cc \
  • src/Tuples/Explode.h

    r54cd58b0 r9236060  
    2626
    2727namespace Tuples {
    28         /// helper function used by explode to properly distribute
    29         /// '&' across a tuple expression
    30         Expression * distributeAddr( Expression * expr );
    31 
    3228        /// helper function used by explode
    3329        template< typename OutputIterator >
    3430        void explodeUnique( Expression * expr, const ResolvExpr::Alternative & alt, const SymTab::Indexer & indexer, OutputIterator out, bool isTupleAssign ) {
    35                 if ( isTupleAssign ) {
    36                         // tuple assignment needs AddressExprs to be recursively exploded to easily get at all of the components
    37                         if ( AddressExpr * addrExpr = dynamic_cast< AddressExpr * >( expr ) ) {
    38                                 ResolvExpr::AltList alts;
    39                                 explodeUnique( addrExpr->get_arg(), alt, indexer, back_inserter( alts ), isTupleAssign );
    40                                 for ( ResolvExpr::Alternative & alt : alts ) {
    41                                         // distribute '&' over all components
    42                                         alt.expr = distributeAddr( alt.expr );
    43                                         *out++ = alt;
    44                                 }
    45                                 // in tuple assignment, still need to handle the other cases, but only if not already handled here (don't want to output too many alternatives)
    46                                 return;
    47                         }
    48                 }
    49                 Type * res = expr->get_result();
     31                Type * res = expr->get_result()->stripReferences();
    5032                if ( TupleType * tupleType = dynamic_cast< TupleType * > ( res ) ) {
    5133                        if ( TupleExpr * tupleExpr = dynamic_cast< TupleExpr * >( expr ) ) {
     
    5537                                }
    5638                        } else {
    57                                 // tuple type, but not tuple expr - recursively index into its components
     39                                // tuple type, but not tuple expr - recursively index into its components.
     40                                // if expr type is reference, convert to value type
    5841                                Expression * arg = expr->clone();
     42
     43                                if ( dynamic_cast<ReferenceType *>( arg->get_result() ) ) {
     44                                        // TODO: does this go here (inside uniqueexpr) or outside uniqueexpr? I'm guessing probably should go after...
     45                                        arg = new CastExpr( arg, tupleType->clone() );
     46                                }
    5947                                if ( Tuples::maybeImpure( arg ) && ! dynamic_cast< UniqueExpr * >( arg ) ) {
    6048                                        // expressions which may contain side effects require a single unique instance of the expression.
  • src/Tuples/TupleAssignment.cc

    r54cd58b0 r9236060  
    2222#include "Explode.h"
    2323#include "Common/SemanticError.h"
     24#include "CodeGen/OperatorTable.h"
    2425#include "InitTweak/InitTweak.h"
    2526#include "InitTweak/GenInit.h"
     
    7778                if ( ! expr ) return false;
    7879                assert( expr->has_result() );
    79                 return dynamic_cast< TupleType * >( expr->get_result() );
     80                return dynamic_cast< TupleType * >( expr->get_result()->stripReferences() );
    8081        }
    8182
     
    8990        }
    9091
    91         bool pointsToTuple( Expression *expr ) {
     92        bool refToTuple( Expression *expr ) {
     93                assert( expr->get_result() );
    9294                // also check for function returning tuple of reference types
    9395                if ( CastExpr * castExpr = dynamic_cast< CastExpr * >( expr ) ) {
    94                         return pointsToTuple( castExpr->get_arg() );
    95                 } else if ( AddressExpr *addr = dynamic_cast< AddressExpr * >( expr) ) {
    96                         return isTuple( addr->get_arg() );
     96                        return refToTuple( castExpr->get_arg() );
     97                } else {
     98                        return isTuple( expr );
    9799                }
    98100                return false;
     
    109111        void TupleAssignSpotter::spot( UntypedExpr * expr, const std::list<ResolvExpr::AltList> &possibilities ) {
    110112                if (  NameExpr *op = dynamic_cast< NameExpr * >(expr->get_function()) ) {
    111                         if ( InitTweak::isCtorDtorAssign( op->get_name() ) ) {
     113                        if ( CodeGen::isCtorDtorAssign( op->get_name() ) ) {
    112114                                fname = op->get_name();
    113115                                for ( std::list<ResolvExpr::AltList>::const_iterator ali = possibilities.begin(); ali != possibilities.end(); ++ali ) {
    114116                                        if ( ali->size() == 0 ) continue; // AlternativeFinder will natrually handle this case, if it's legal
    115                                         if ( ali->size() <= 1 && InitTweak::isAssignment( op->get_name() ) ) {
     117                                        if ( ali->size() <= 1 && CodeGen::isAssignment( op->get_name() ) ) {
    116118                                                // what does it mean if an assignment takes 1 argument? maybe someone defined such a function, in which case AlternativeFinder will naturally handle it
    117119                                                continue;
     
    122124                                        const ResolvExpr::Alternative & alt1 = ali->front();
    123125                                        auto begin = std::next(ali->begin(), 1), end = ali->end();
    124                                         if ( pointsToTuple(alt1.expr) ) {
     126                                        if ( refToTuple(alt1.expr) ) {
    125127                                                if ( isMultAssign( begin, end ) ) {
    126128                                                        matcher.reset( new MultipleAssignMatcher( *this, *ali ) );
     
    196198                        for ( ResolvExpr::Alternative & alt : lhs ) {
    197199                                Expression *& expr = alt.expr;
    198                                 Type * castType = expr->get_result()->clone();
    199                                 Type * type = InitTweak::getPointerBase( castType );
    200                                 assert( type );
     200                                Type * type = expr->get_result()->clone();
    201201                                type->get_qualifiers() -= Type::Qualifiers( Type::Const | Type::Volatile | Type::Restrict | Type::Atomic );
    202                                 type->set_lvalue( true ); // xxx - might not need this
    203                                 expr = new CastExpr( expr, castType );
     202                                expr = new CastExpr( expr, new ReferenceType( Type::Qualifiers(), type ) );
     203                        }
     204                }
     205
     206                for ( ResolvExpr::Alternative & alt : lhs ) {
     207                        // every LHS value must be a reference - some come in with a cast expression, if it doesn't just cast to reference here.
     208                        // TODO: can this somehow be merge with the cast code directly above?
     209                        if ( ! dynamic_cast< ReferenceType * >( alt.expr->get_result() ) ) {
     210                                alt.expr = new CastExpr( alt.expr, new ReferenceType( Type::Qualifiers(), alt.expr->get_result()->clone() ) );
    204211                        }
    205212                }
     
    221228                assert( left );
    222229                std::list< Expression * > args;
    223                 args.push_back( new AddressExpr( UntypedExpr::createDeref( new VariableExpr( left ) ) ) );
     230                args.push_back( new VariableExpr( left ) );
    224231                // args.push_back( new AddressExpr( new VariableExpr( left ) ) );
    225232                if ( right ) args.push_back( new VariableExpr( right ) );
     
    241248                assert( expr->has_result() && ! expr->get_result()->isVoid() );
    242249                ObjectDecl * ret = new ObjectDecl( namer.newName(), Type::StorageClasses(), LinkageSpec::Cforall, nullptr, expr->get_result()->clone(), new SingleInit( expr->clone() ) );
    243                 ConstructorInit * ctorInit = InitTweak::genCtorInit( ret );
    244                 ret->set_init( ctorInit );
    245                 ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object
    246                 EnvRemover rm; // remove environments from subexpressions of StmtExprs
    247                 ctorInit->accept( rm );
     250                // if expression type is a reference, don't need to construct anything, a simple initializer is sufficient.
     251                if ( ! dynamic_cast< ReferenceType * >( expr->get_result() ) ) {
     252                        ConstructorInit * ctorInit = InitTweak::genCtorInit( ret );
     253                        ret->set_init( ctorInit );
     254                        ResolvExpr::resolveCtorInit( ctorInit, spotter.currentFinder.get_indexer() ); // resolve ctor/dtors for the new object
     255                        EnvRemover rm; // remove environments from subexpressions of StmtExprs
     256                        ctorInit->accept( rm );
     257                }
    248258                return ret;
    249259        }
  • src/libcfa/concurrency/alarm.c

    r54cd58b0 r9236060  
    4040__cfa_time_t zero_time = { 0 };
    4141
    42 void ?{}( __cfa_time_t * this ) { this->val = 0; }
    43 void ?{}( __cfa_time_t * this, zero_t zero ) { this->val = 0; }
    44 
    45 void ?{}( itimerval * this, __cfa_time_t * alarm ) {
    46         this->it_value.tv_sec = alarm->val / one_second;                        // seconds
    47         this->it_value.tv_usec = max( (alarm->val % one_second) / one_microsecond, 1000 ); // microseconds
    48         this->it_interval.tv_sec = 0;
    49         this->it_interval.tv_usec = 0;
    50 }
    51 
    52 
    53 void ?{}( __cfa_time_t * this, timespec * curr ) {
     42void ?{}( __cfa_time_t & this ) { this.val = 0; }
     43void ?{}( __cfa_time_t & this, zero_t zero ) { this.val = 0; }
     44
     45void ?{}( itimerval & this, __cfa_time_t * alarm ) {
     46        this.it_value.tv_sec = alarm->val / one_second;                 // seconds
     47        this.it_value.tv_usec = max( (alarm->val % one_second) / one_microsecond, 1000 ); // microseconds
     48        this.it_interval.tv_sec = 0;
     49        this.it_interval.tv_usec = 0;
     50}
     51
     52
     53void ?{}( __cfa_time_t & this, timespec * curr ) {
    5454        uint64_t secs  = curr->tv_sec;
    5555        uint64_t nsecs = curr->tv_nsec;
    56         this->val = (secs * one_second) + nsecs;
    57 }
    58 
    59 __cfa_time_t ?=?( __cfa_time_t * this, zero_t rhs ) {
    60         this->val = 0;
    61         return *this;
     56        this.val = (secs * one_second) + nsecs;
     57}
     58
     59__cfa_time_t ?=?( __cfa_time_t & this, zero_t rhs ) {
     60        this.val = 0;
     61        return this;
    6262}
    6363
     
    8686//=============================================================================================
    8787
    88 void ?{}( alarm_node_t * this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {
    89         this->thrd = thrd;
    90         this->alarm = alarm;
    91         this->period = period;
    92         this->next = 0;
    93         this->set = false;
    94         this->kernel_alarm = false;
    95 }
    96 
    97 void ?{}( alarm_node_t * this, processor   * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {
    98         this->proc = proc;
    99         this->alarm = alarm;
    100         this->period = period;
    101         this->next = 0;
    102         this->set = false;
    103         this->kernel_alarm = true;
    104 }
    105 
    106 void ^?{}( alarm_node_t * this ) {
    107         if( this->set ) {
    108                 unregister_self( this );
     88void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {
     89        this.thrd = thrd;
     90        this.alarm = alarm;
     91        this.period = period;
     92        this.next = 0;
     93        this.set = false;
     94        this.kernel_alarm = false;
     95}
     96
     97void ?{}( alarm_node_t & this, processor   * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time ) {
     98        this.proc = proc;
     99        this.alarm = alarm;
     100        this.period = period;
     101        this.next = 0;
     102        this.set = false;
     103        this.kernel_alarm = true;
     104}
     105
     106void ^?{}( alarm_node_t & this ) {
     107        if( this.set ) {
     108                unregister_self( &this );
    109109        }
    110110}
  • src/libcfa/concurrency/alarm.h

    r54cd58b0 r9236060  
    3636
    3737// ctors
    38 void ?{}( __cfa_time_t * this );
    39 void ?{}( __cfa_time_t * this, zero_t zero );
    40 void ?{}( __cfa_time_t * this, timespec * curr );
    41 void ?{}( itimerval * this, __cfa_time_t * alarm );
     38void ?{}( __cfa_time_t & this );
     39void ?{}( __cfa_time_t & this, zero_t zero );
     40void ?{}( __cfa_time_t & this, timespec * curr );
     41void ?{}( itimerval & this, __cfa_time_t * alarm );
    4242
    43 __cfa_time_t ?=?( __cfa_time_t * this, zero_t rhs );
     43__cfa_time_t ?=?( __cfa_time_t & this, zero_t rhs );
    4444
    4545// logical ops
     
    105105typedef alarm_node_t ** __alarm_it_t;
    106106
    107 void ?{}( alarm_node_t * this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time );
    108 void ?{}( alarm_node_t * this, processor   * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time );
    109 void ^?{}( alarm_node_t * this );
     107void ?{}( alarm_node_t & this, thread_desc * thrd, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time );
     108void ?{}( alarm_node_t & this, processor   * proc, __cfa_time_t alarm = zero_time, __cfa_time_t period = zero_time );
     109void ^?{}( alarm_node_t & this );
    110110
    111111struct alarm_list_t {
     
    114114};
    115115
    116 static inline void ?{}( alarm_list_t * this ) {
    117         this->head = 0;
    118         this->tail = &this->head;
     116static inline void ?{}( alarm_list_t & this ) {
     117        this.head = 0;
     118        this.tail = &this.head;
    119119}
    120120
  • src/libcfa/concurrency/coroutine

    r54cd58b0 r9236060  
    2525// Anything that is resumed is a coroutine.
    2626trait is_coroutine(dtype T) {
    27       void main(T * this);
    28       coroutine_desc * get_coroutine(T * this);
     27      void main(T & this);
     28      coroutine_desc * get_coroutine(T & this);
    2929};
    3030
    31 #define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X* this) { return &this->__cor; } void main(X* this)
     31#define DECL_COROUTINE(X) static inline coroutine_desc* get_coroutine(X& this) { return &this.__cor; } void main(X& this)
    3232
    3333//-----------------------------------------------------------------------------
    3434// Ctors and dtors
    35 void ?{}(coStack_t * this);
    36 void ?{}(coroutine_desc * this);
    37 void ?{}(coroutine_desc * this, const char * name);
    38 void ^?{}(coStack_t * this);
    39 void ^?{}(coroutine_desc * this);
     35void ?{}(coStack_t & this);
     36void ?{}(coroutine_desc & this);
     37void ?{}(coroutine_desc & this, const char * name);
     38void ^?{}(coStack_t & this);
     39void ^?{}(coroutine_desc & this);
    4040
    4141//-----------------------------------------------------------------------------
     
    4444
    4545forall(dtype T | is_coroutine(T))
    46 static inline void resume(T * cor);
     46static inline void resume(T & cor);
    4747
    4848forall(dtype T | is_coroutine(T))
    49 void prime(T * cor);
     49void prime(T & cor);
    5050
    5151//-----------------------------------------------------------------------------
     
    8686// Resume implementation inlined for performance
    8787forall(dtype T | is_coroutine(T))
    88 static inline void resume(T * cor) {
     88static inline void resume(T & cor) {
    8989        coroutine_desc * src = this_coroutine;          // optimization
    9090        coroutine_desc * dst = get_coroutine(cor);
     
    9292        if( unlikely(!dst->stack.base) ) {
    9393                create_stack(&dst->stack, dst->stack.size);
    94                 CtxStart(cor, CtxInvokeCoroutine);
     94                CtxStart(&cor, CtxInvokeCoroutine);
    9595        }
    9696
  • src/libcfa/concurrency/coroutine.c

    r54cd58b0 r9236060  
    4040//-----------------------------------------------------------------------------
    4141// Coroutine ctors and dtors
    42 void ?{}(coStack_t* this) {
    43         this->size              = 65000;        // size of stack
    44         this->storage   = NULL; // pointer to stack
    45         this->limit             = NULL; // stack grows towards stack limit
    46         this->base              = NULL; // base of stack
    47         this->context   = NULL; // address of cfa_context_t
    48         this->top               = NULL; // address of top of storage
    49         this->userStack = false;
     42void ?{}(coStack_t& this) {
     43        this.size               = 65000;        // size of stack
     44        this.storage    = NULL; // pointer to stack
     45        this.limit              = NULL; // stack grows towards stack limit
     46        this.base               = NULL; // base of stack
     47        this.context    = NULL; // address of cfa_context_t
     48        this.top                = NULL; // address of top of storage
     49        this.userStack  = false;
    5050}
    5151
    52 void ?{}(coStack_t* this, size_t size) {
     52void ?{}(coStack_t& this, size_t size) {
    5353        this{};
    54         this->size = size;
     54        this.size = size;
    5555
    56         create_stack(this, this->size);
     56        create_stack(&this, this.size);
    5757}
    5858
    59 void ?{}(coroutine_desc* this) {
     59void ?{}(coroutine_desc& this) {
    6060        this{ "Anonymous Coroutine" };
    6161}
    6262
    63 void ?{}(coroutine_desc* this, const char * name) {
    64         this->name = name;
    65         this->errno_ = 0;
    66         this->state = Start;
    67         this->starter = NULL;
    68         this->last = NULL;
     63void ?{}(coroutine_desc& this, const char * name) {
     64        this.name = name;
     65        this.errno_ = 0;
     66        this.state = Start;
     67        this.starter = NULL;
     68        this.last = NULL;
    6969}
    7070
    71 void ?{}(coroutine_desc* this, size_t size) {
     71void ?{}(coroutine_desc& this, size_t size) {
    7272        this{};
    73         (&this->stack){size};
     73        (this.stack){size};
    7474}
    7575
    76 void ^?{}(coStack_t* this) {
    77         if ( ! this->userStack ) {
     76void ^?{}(coStack_t& this) {
     77        if ( ! this.userStack ) {
    7878                LIB_DEBUG_DO(
    79                         if ( mprotect( this->storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) {
    80                                 abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", this, errno, strerror( errno ) );
     79                        if ( mprotect( this.storage, pageSize, PROT_READ | PROT_WRITE ) == -1 ) {
     80                                abortf( "(coStack_t *)%p.^?{}() : internal error, mprotect failure, error(%d) %s.", &this, errno, strerror( errno ) );
    8181                        }
    8282                );
    83                 free( this->storage );
     83                free( this.storage );
    8484        }
    8585}
    8686
    87 void ^?{}(coroutine_desc* this) {}
     87void ^?{}(coroutine_desc& this) {}
    8888
    8989// Part of the Public API
    9090// Not inline since only ever called once per coroutine
    9191forall(dtype T | is_coroutine(T))
    92 void prime(T* cor) {
     92void prime(T& cor) {
    9393        coroutine_desc* this = get_coroutine(cor);
    9494        assert(this->state == Start);
  • src/libcfa/concurrency/invoke.h

    r54cd58b0 r9236060  
    4747      #ifdef __CFORALL__
    4848      extern "Cforall" {
    49             void ?{}( struct __thread_queue_t * );
     49            void ?{}( struct __thread_queue_t & );
    5050            void append( struct __thread_queue_t *, struct thread_desc * );
    5151            struct thread_desc * pop_head( struct __thread_queue_t * );
    5252
    53             void ?{}( struct __condition_stack_t * );
     53            void ?{}( struct __condition_stack_t & );
    5454            void push( struct __condition_stack_t *, struct __condition_criterion_t * );
    5555            struct __condition_criterion_t * pop( struct __condition_stack_t * );
    5656
    57             void ?{}(spinlock * this);
    58             void ^?{}(spinlock * this);
     57            void ?{}(spinlock & this);
     58            void ^?{}(spinlock & this);
    5959      }
    6060      #endif
  • src/libcfa/concurrency/kernel

    r54cd58b0 r9236060  
    3737};
    3838
    39 void  ?{}(semaphore * this, int count = 1);
    40 void ^?{}(semaphore * this);
     39void  ?{}(semaphore & this, int count = 1);
     40void ^?{}(semaphore & this);
    4141void P(semaphore * this);
    4242void V(semaphore * this);
     
    5151};
    5252
    53 void ?{}(cluster * this);
    54 void ^?{}(cluster * this);
     53void ?{}(cluster & this);
     54void ^?{}(cluster & this);
    5555
    5656//-----------------------------------------------------------------------------
     
    6868        unsigned short thrd_count;
    6969};
    70 static inline void ?{}(FinishAction * this) {
    71         this->action_code = No_Action;
    72         this->thrd = NULL;
    73         this->lock = NULL;
     70static inline void ?{}(FinishAction & this) {
     71        this.action_code = No_Action;
     72        this.thrd = NULL;
     73        this.lock = NULL;
    7474}
    75 static inline void ^?{}(FinishAction * this) {}
     75static inline void ^?{}(FinishAction & this) {}
    7676
    7777// Processor
     
    9999};
    100100
    101 void ?{}(processor * this);
    102 void ?{}(processor * this, cluster * cltr);
    103 void ^?{}(processor * this);
     101void ?{}(processor & this);
     102void ?{}(processor & this, cluster * cltr);
     103void ^?{}(processor & this);
    104104
    105105// Local Variables: //
  • src/libcfa/concurrency/kernel.c

    r54cd58b0 r9236060  
    7373};
    7474
    75 void ?{}( current_stack_info_t * this ) {
    76         CtxGet( this->ctx );
    77         this->base = this->ctx.FP;
    78         this->storage = this->ctx.SP;
     75void ?{}( current_stack_info_t & this ) {
     76        CtxGet( this.ctx );
     77        this.base = this.ctx.FP;
     78        this.storage = this.ctx.SP;
    7979
    8080        rlimit r;
    8181        getrlimit( RLIMIT_STACK, &r);
    82         this->size = r.rlim_cur;
    83 
    84         this->limit = (void *)(((intptr_t)this->base) - this->size);
    85         this->context = &storage_mainThreadCtx;
    86         this->top = this->base;
    87 }
    88 
    89 void ?{}( coStack_t * this, current_stack_info_t * info) {
    90         this->size = info->size;
    91         this->storage = info->storage;
    92         this->limit = info->limit;
    93         this->base = info->base;
    94         this->context = info->context;
    95         this->top = info->top;
    96         this->userStack = true;
    97 }
    98 
    99 void ?{}( coroutine_desc * this, current_stack_info_t * info) {
    100         (&this->stack){ info };
    101         this->name = "Main Thread";
    102         this->errno_ = 0;
    103         this->state = Start;
    104 }
    105 
    106 void ?{}( thread_desc * this, current_stack_info_t * info) {
    107         (&this->cor){ info };
     82        this.size = r.rlim_cur;
     83
     84        this.limit = (void *)(((intptr_t)this.base) - this.size);
     85        this.context = &storage_mainThreadCtx;
     86        this.top = this.base;
     87}
     88
     89void ?{}( coStack_t & this, current_stack_info_t * info) {
     90        this.size = info->size;
     91        this.storage = info->storage;
     92        this.limit = info->limit;
     93        this.base = info->base;
     94        this.context = info->context;
     95        this.top = info->top;
     96        this.userStack = true;
     97}
     98
     99void ?{}( coroutine_desc & this, current_stack_info_t * info) {
     100        (this.stack){ info };
     101        this.name = "Main Thread";
     102        this.errno_ = 0;
     103        this.state = Start;
     104}
     105
     106void ?{}( thread_desc & this, current_stack_info_t * info) {
     107        (this.cor){ info };
    108108}
    109109
    110110//-----------------------------------------------------------------------------
    111111// Processor coroutine
    112 void ?{}(processorCtx_t * this, processor * proc) {
    113         (&this->__cor){ "Processor" };
    114         this->proc = proc;
    115         proc->runner = this;
    116 }
    117 
    118 void ?{}(processorCtx_t * this, processor * proc, current_stack_info_t * info) {
    119         (&this->__cor){ info };
    120         this->proc = proc;
    121         proc->runner = this;
    122 }
    123 
    124 void ?{}(processor * this) {
     112void ?{}(processorCtx_t & this, processor * proc) {
     113        (this.__cor){ "Processor" };
     114        this.proc = proc;
     115        proc->runner = &this;
     116}
     117
     118void ?{}(processorCtx_t & this, processor * proc, current_stack_info_t * info) {
     119        (this.__cor){ info };
     120        this.proc = proc;
     121        proc->runner = &this;
     122}
     123
     124void ?{}(processor & this) {
    125125        this{ mainCluster };
    126126}
    127127
    128 void ?{}(processor * this, cluster * cltr) {
    129         this->cltr = cltr;
    130         (&this->terminated){ 0 };
    131         this->do_terminate = false;
    132         this->preemption_alarm = NULL;
    133         this->pending_preemption = false;
    134 
    135         start( this );
    136 }
    137 
    138 void ?{}(processor * this, cluster * cltr, processorCtx_t * runner) {
    139         this->cltr = cltr;
    140         (&this->terminated){ 0 };
    141         this->do_terminate = false;
    142         this->preemption_alarm = NULL;
    143         this->pending_preemption = false;
    144         this->kernel_thread = pthread_self();
    145 
    146         this->runner = runner;
    147         LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", runner);
    148         runner{ this };
    149 }
    150 
    151 void ^?{}(processor * this) {
    152         if( ! this->do_terminate ) {
    153                 LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", this);
    154                 this->do_terminate = true;
    155                 P( &this->terminated );
    156                 pthread_join( this->kernel_thread, NULL );
    157         }
    158 }
    159 
    160 void ?{}(cluster * this) {
    161         ( &this->ready_queue ){};
    162         ( &this->ready_queue_lock ){};
    163 
    164         this->preemption = default_preemption();
    165 }
    166 
    167 void ^?{}(cluster * this) {
     128void ?{}(processor & this, cluster * cltr) {
     129        this.cltr = cltr;
     130        (this.terminated){ 0 };
     131        this.do_terminate = false;
     132        this.preemption_alarm = NULL;
     133        this.pending_preemption = false;
     134
     135        start( &this );
     136}
     137
     138void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) {
     139        this.cltr = cltr;
     140        (this.terminated){ 0 };
     141        this.do_terminate = false;
     142        this.preemption_alarm = NULL;
     143        this.pending_preemption = false;
     144        this.kernel_thread = pthread_self();
     145
     146        this.runner = &runner;
     147        LIB_DEBUG_PRINT_SAFE("Kernel : constructing main processor context %p\n", &runner);
     148        runner{ &this };
     149}
     150
     151void ^?{}(processor & this) {
     152        if( ! this.do_terminate ) {
     153                LIB_DEBUG_PRINT_SAFE("Kernel : core %p signaling termination\n", &this);
     154                this.do_terminate = true;
     155                P( &this.terminated );
     156                pthread_join( this.kernel_thread, NULL );
     157        }
     158}
     159
     160void ?{}(cluster & this) {
     161        ( this.ready_queue ){};
     162        ( this.ready_queue_lock ){};
     163
     164        this.preemption = default_preemption();
     165}
     166
     167void ^?{}(cluster & this) {
    168168
    169169}
     
    173173//=============================================================================================
    174174//Main of the processor contexts
    175 void main(processorCtx_t * runner) {
    176         processor * this = runner->proc;
     175void main(processorCtx_t & runner) {
     176        processor * this = runner.proc;
    177177
    178178        LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this);
     
    219219// from the processor coroutine to the target thread
    220220void runThread(processor * this, thread_desc * dst) {
    221         coroutine_desc * proc_cor = get_coroutine(this->runner);
     221        coroutine_desc * proc_cor = get_coroutine(*this->runner);
    222222        coroutine_desc * thrd_cor = get_coroutine(dst);
    223223
     
    301301        // appropriate stack.
    302302        proc_cor_storage.__cor.state = Active;
    303         main( &proc_cor_storage );
     303        main( proc_cor_storage );
    304304        proc_cor_storage.__cor.state = Halted;
    305305
     
    441441        mainThread = (thread_desc *)&storage_mainThread;
    442442        current_stack_info_t info;
    443         mainThread{ &info };
     443        (*mainThread){ &info };
    444444
    445445        LIB_DEBUG_PRINT_SAFE("Kernel : Main thread ready\n");
     
    447447        // Initialize the main cluster
    448448        mainCluster = (cluster *)&storage_mainCluster;
    449         mainCluster{};
     449        (*mainCluster){};
    450450
    451451        LIB_DEBUG_PRINT_SAFE("Kernel : main cluster ready\n");
     
    454454        // (the coroutine that contains the processing control flow)
    455455        mainProcessor = (processor *)&storage_mainProcessor;
    456         mainProcessor{ mainCluster, (processorCtx_t *)&storage_mainProcessorCtx };
     456        (*mainProcessor){ mainCluster, *(processorCtx_t *)&storage_mainProcessorCtx };
    457457
    458458        //initialize the global state variables
     
    471471        // context. Hence, the main thread does not begin through CtxInvokeThread, like all other threads. The trick here is that
    472472        // mainThread is on the ready queue when this call is made.
    473         resume( mainProcessor->runner );
     473        resume( *mainProcessor->runner );
    474474
    475475
     
    499499        // Destroy the main processor and its context in reverse order of construction
    500500        // These were manually constructed so we need manually destroy them
    501         ^(mainProcessor->runner){};
     501        ^(*mainProcessor->runner){};
    502502        ^(mainProcessor){};
    503503
     
    567567//-----------------------------------------------------------------------------
    568568// Locks
    569 void ?{}( spinlock * this ) {
    570         this->lock = 0;
    571 }
    572 void ^?{}( spinlock * this ) {
     569void ?{}( spinlock & this ) {
     570        this.lock = 0;
     571}
     572void ^?{}( spinlock & this ) {
    573573
    574574}
     
    604604}
    605605
    606 void  ?{}( semaphore * this, int count = 1 ) {
    607         (&this->lock){};
    608         this->count = count;
    609         (&this->waiting){};
    610 }
    611 void ^?{}(semaphore * this) {}
     606void  ?{}( semaphore & this, int count = 1 ) {
     607        (this.lock){};
     608        this.count = count;
     609        (this.waiting){};
     610}
     611void ^?{}(semaphore & this) {}
    612612
    613613void P(semaphore * this) {
     
    643643//-----------------------------------------------------------------------------
    644644// Queues
    645 void ?{}( __thread_queue_t * this ) {
    646         this->head = NULL;
    647         this->tail = &this->head;
     645void ?{}( __thread_queue_t & this ) {
     646        this.head = NULL;
     647        this.tail = &this.head;
    648648}
    649649
     
    666666}
    667667
    668 void ?{}( __condition_stack_t * this ) {
    669         this->top = NULL;
     668void ?{}( __condition_stack_t & this ) {
     669        this.top = NULL;
    670670}
    671671
  • src/libcfa/concurrency/monitor

    r54cd58b0 r9236060  
    2222#include "stdlib"
    2323
    24 static inline void ?{}(monitor_desc * this) {
    25         this->owner = NULL;
    26         this->recursion = 0;
     24static inline void ?{}(monitor_desc & this) {
     25        this.owner = NULL;
     26        this.recursion = 0;
    2727}
    2828
     
    3838}
    3939
    40 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count );
    41 void ^?{}( monitor_guard_t * this );
     40void ?{}( monitor_guard_t & this, monitor_desc ** m, int count );
     41void ^?{}( monitor_guard_t & this );
    4242
    4343//-----------------------------------------------------------------------------
     
    6464};
    6565
    66 void ?{}( __condition_blocked_queue_t * );
     66void ?{}( __condition_blocked_queue_t & );
    6767void append( __condition_blocked_queue_t *, __condition_node_t * );
    6868__condition_node_t * pop_head( __condition_blocked_queue_t * );
     
    7474};
    7575
    76 static inline void ?{}( condition * this ) {
    77         this->monitors = NULL;
    78         this->monitor_count = 0;
     76static inline void ?{}( condition & this ) {
     77        this.monitors = NULL;
     78        this.monitor_count = 0;
    7979}
    8080
    81 static inline void ^?{}( condition * this ) {
    82         free( this->monitors );
     81static inline void ^?{}( condition & this ) {
     82        free( this.monitors );
    8383}
    8484
  • src/libcfa/concurrency/monitor.c

    r54cd58b0 r9236060  
    139139}
    140140
    141 void ?{}( monitor_guard_t * this, monitor_desc ** m, int count ) {
    142         this->m = m;
    143         this->count = count;
    144         qsort(this->m, count);
    145         enter( this->m, this->count );
    146 
    147         this->prev_mntrs = this_thread->current_monitors;
    148         this->prev_count = this_thread->current_monitor_count;
     141void ?{}( monitor_guard_t & this, monitor_desc ** m, int count ) {
     142        this.m = m;
     143        this.count = count;
     144        qsort(this.m, count);
     145        enter( this.m, this.count );
     146
     147        this.prev_mntrs = this_thread->current_monitors;
     148        this.prev_count = this_thread->current_monitor_count;
    149149
    150150        this_thread->current_monitors      = m;
     
    152152}
    153153
    154 void ^?{}( monitor_guard_t * this ) {
    155         leave( this->m, this->count );
    156 
    157         this_thread->current_monitors      = this->prev_mntrs;
    158         this_thread->current_monitor_count = this->prev_count;
    159 }
    160 
    161 void ?{}(__condition_node_t * this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {
    162         this->waiting_thread = waiting_thread;
    163         this->count = count;
    164         this->next = NULL;
    165         this->user_info = user_info;
    166 }
    167 
    168 void ?{}(__condition_criterion_t * this ) {
    169         this->ready  = false;
    170         this->target = NULL;
    171         this->owner  = NULL;
    172         this->next   = NULL;
    173 }
    174 
    175 void ?{}(__condition_criterion_t * this, monitor_desc * target, __condition_node_t * owner ) {
    176         this->ready  = false;
    177         this->target = target;
    178         this->owner  = owner;
    179         this->next   = NULL;
     154void ^?{}( monitor_guard_t & this ) {
     155        leave( this.m, this.count );
     156
     157        this_thread->current_monitors      = this.prev_mntrs;
     158        this_thread->current_monitor_count = this.prev_count;
     159}
     160
     161void ?{}(__condition_node_t & this, thread_desc * waiting_thread, unsigned short count, uintptr_t user_info ) {
     162        this.waiting_thread = waiting_thread;
     163        this.count = count;
     164        this.next = NULL;
     165        this.user_info = user_info;
     166}
     167
     168void ?{}(__condition_criterion_t & this ) {
     169        this.ready  = false;
     170        this.target = NULL;
     171        this.owner  = NULL;
     172        this.next   = NULL;
     173}
     174
     175void ?{}(__condition_criterion_t & this, monitor_desc * target, __condition_node_t * owner ) {
     176        this.ready  = false;
     177        this.target = target;
     178        this.owner  = owner;
     179        this.next   = NULL;
    180180}
    181181
     
    202202        __condition_criterion_t criteria[count];
    203203        for(int i = 0; i < count; i++) {
    204                 (&criteria[i]){ this->monitors[i], &waiter };
     204                (criteria[i]){ this->monitors[i], &waiter };
    205205                // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] );
    206206        }
     
    314314        __condition_criterion_t criteria[count];
    315315        for(int i = 0; i < count; i++) {
    316                 (&criteria[i]){ this->monitors[i], &waiter };
     316                (criteria[i]){ this->monitors[i], &waiter };
    317317                // LIB_DEBUG_PRINT_SAFE( "Criterion %p\n", &criteria[i] );
    318318                push( &criteria[i].target->signal_stack, &criteria[i] );
     
    505505}
    506506
    507 void ?{}( __condition_blocked_queue_t * this ) {
    508         this->head = NULL;
    509         this->tail = &this->head;
     507void ?{}( __condition_blocked_queue_t & this ) {
     508        this.head = NULL;
     509        this.tail = &this.head;
    510510}
    511511
  • src/libcfa/concurrency/preemption.c

    r54cd58b0 r9236060  
    7171static pthread_t alarm_thread;                        // pthread handle to alarm thread
    7272
    73 void ?{}(event_kernel_t * this) {
    74         (&this->alarms){};
    75         (&this->lock){};
     73void ?{}(event_kernel_t & this) {
     74        (this.alarms){};
     75        (this.lock){};
    7676}
    7777
     
    240240        // Initialize the event kernel
    241241        event_kernel = (event_kernel_t *)&storage_event_kernel;
    242         event_kernel{};
     242        (*event_kernel){};
    243243
    244244        // Setup proper signal handlers
     
    276276// Raii ctor/dtor for the preemption_scope
    277277// Used by thread to control when they want to receive preemption signals
    278 void ?{}( preemption_scope * this, processor * proc ) {
    279         (&this->alarm){ proc, zero_time, zero_time };
    280         this->proc = proc;
    281         this->proc->preemption_alarm = &this->alarm;
    282 
    283         update_preemption( this->proc, from_us(this->proc->cltr->preemption) );
    284 }
    285 
    286 void ^?{}( preemption_scope * this ) {
     278void ?{}( preemption_scope & this, processor * proc ) {
     279        (this.alarm){ proc, zero_time, zero_time };
     280        this.proc = proc;
     281        this.proc->preemption_alarm = &this.alarm;
     282
     283        update_preemption( this.proc, from_us(this.proc->cltr->preemption) );
     284}
     285
     286void ^?{}( preemption_scope & this ) {
    287287        disable_interrupts();
    288288
    289         update_preemption( this->proc, zero_time );
     289        update_preemption( this.proc, zero_time );
    290290}
    291291
  • src/libcfa/concurrency/preemption.h

    r54cd58b0 r9236060  
    3030};
    3131
    32 void ?{}( preemption_scope * this, processor * proc );
    33 void ^?{}( preemption_scope * this );
     32void ?{}( preemption_scope & this, processor * proc );
     33void ^?{}( preemption_scope & this );
    3434
    3535// Local Variables: //
  • src/libcfa/concurrency/thread

    r54cd58b0 r9236060  
    2727// Anything that is resumed is a coroutine.
    2828trait is_thread(dtype T) {
    29       void ^?{}(T* mutex this);
    30       void main(T* this);
    31       thread_desc* get_thread(T* this);
     29      void ^?{}(T& mutex this);
     30      void main(T& this);
     31      thread_desc* get_thread(T& this);
    3232};
    3333
    34 #define DECL_THREAD(X) thread_desc* get_thread(X* this) { return &this->__thrd; } void main(X* this)
     34#define DECL_THREAD(X) thread_desc* get_thread(X& this) { return &this.__thrd; } void main(X& this)
    3535
    3636forall( dtype T | is_thread(T) )
    37 static inline coroutine_desc* get_coroutine(T* this) {
     37static inline coroutine_desc* get_coroutine(T & this) {
    3838        return &get_thread(this)->cor;
    3939}
    4040
    4141forall( dtype T | is_thread(T) )
    42 static inline monitor_desc* get_monitor(T * this) {
     42static inline monitor_desc* get_monitor(T & this) {
    4343        return &get_thread(this)->mon;
    4444}
     
    5555
    5656forall( dtype T | is_thread(T) )
    57 void __thrd_start( T* this );
     57void __thrd_start( T & this );
    5858
    5959//-----------------------------------------------------------------------------
    6060// Ctors and dtors
    61 void ?{}(thread_desc* this);
    62 void ^?{}(thread_desc* this);
     61void ?{}(thread_desc& this);
     62void ^?{}(thread_desc& this);
    6363
    6464//-----------------------------------------------------------------------------
     
    7070};
    7171
    72 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
    73 void ?{}( scoped(T)* this );
     72forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } )
     73void ?{}( scoped(T)& this );
    7474
    75 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
    76 void ?{}( scoped(T)* this, P params );
     75forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
     76void ?{}( scoped(T)& this, P params );
    7777
    7878forall( dtype T | sized(T) | is_thread(T) )
    79 void ^?{}( scoped(T)* this );
     79void ^?{}( scoped(T)& this );
    8080
    8181void yield();
  • src/libcfa/concurrency/thread.c

    r54cd58b0 r9236060  
    3232// Thread ctors and dtors
    3333
    34 void ?{}(thread_desc* this) {
    35         (&this->cor){};
    36         this->cor.name = "Anonymous Coroutine";
    37         this->mon.owner = this;
    38         this->mon.recursion = 1;
    39         this->next = NULL;
     34void ?{}(thread_desc& this) {
     35        (this.cor){};
     36        this.cor.name = "Anonymous Coroutine";
     37        this.mon.owner = &this;
     38        this.mon.recursion = 1;
     39        this.next = NULL;
    4040
    41         this->current_monitors      = &this->mon;
    42         this->current_monitor_count = 1;
     41        this.current_monitors      = &this.mon;
     42        this.current_monitor_count = 1;
    4343}
    4444
    45 void ^?{}(thread_desc* this) {
    46         ^(&this->cor){};
     45void ^?{}(thread_desc& this) {
     46        ^(this.cor){};
    4747}
    4848
    49 forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T*); } )
    50 void ?{}( scoped(T)* this ) {
    51         (&this->handle){};
    52         __thrd_start(&this->handle);
     49forall( dtype T | sized(T) | is_thread(T) | { void ?{}(T&); } )
     50void ?{}( scoped(T)& this ) {
     51        (this.handle){};
     52        __thrd_start(this.handle);
    5353}
    5454
    55 forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T*, P); } )
    56 void ?{}( scoped(T)* this, P params ) {
    57         (&this->handle){ params };
    58         __thrd_start(&this->handle);
     55forall( dtype T, ttype P | sized(T) | is_thread(T) | { void ?{}(T&, P); } )
     56void ?{}( scoped(T)& this, P params ) {
     57        (this.handle){ params };
     58        __thrd_start(this.handle);
    5959}
    6060
    6161forall( dtype T | sized(T) | is_thread(T) )
    62 void ^?{}( scoped(T)* this ) {
    63         ^(&this->handle){};
     62void ^?{}( scoped(T)& this ) {
     63        ^(this.handle){};
    6464}
    6565
     
    6767// Starting and stopping threads
    6868forall( dtype T | is_thread(T) )
    69 void __thrd_start( T* this ) {
     69void __thrd_start( T& this ) {
    7070        coroutine_desc* thrd_c = get_coroutine(this);
    7171        thread_desc*  thrd_h = get_thread   (this);
     
    7777        create_stack(&thrd_c->stack, thrd_c->stack.size);
    7878        this_coroutine = thrd_c;
    79         CtxStart(this, CtxInvokeThread);
     79        CtxStart(&this, CtxInvokeThread);
    8080        assert( thrd_c->last->stack.context );
    8181        CtxSwitch( thrd_c->last->stack.context, thrd_c->stack.context );
  • src/libcfa/containers/maybe

    r54cd58b0 r9236060  
    2727
    2828forall(otype T)
    29 void ?{}(maybe(T) * this);
     29void ?{}(maybe(T) & this);
    3030
    3131forall(otype T)
    32 void ?{}(maybe(T) * this, T value);
     32void ?{}(maybe(T) & this, T value);
    3333
    3434forall(otype T)
    35 void ?{}(maybe(T) * this, maybe(T) other);
     35void ?{}(maybe(T) & this, maybe(T) other);
    3636
    3737forall(otype T)
    38 void ^?{}(maybe(T) * this);
     38void ^?{}(maybe(T) & this);
    3939
    4040forall(otype T)
    41 maybe(T) ?=?(maybe(T) * this, maybe(T) other);
     41maybe(T) ?=?(maybe(T) & this, maybe(T) other);
    4242
    4343forall(otype T)
  • src/libcfa/containers/maybe.c

    r54cd58b0 r9236060  
    1919
    2020forall(otype T)
    21 void ?{}(maybe(T) * this) {
    22         this->has_value = false;
     21void ?{}(maybe(T) & this) {
     22        this.has_value = false;
    2323}
    2424
    2525forall(otype T)
    26 void ?{}(maybe(T) * this, T value) {
    27         this->has_value = true;
    28         (&this->value){value};
     26void ?{}(maybe(T) & this, T value) {
     27        this.has_value = true;
     28        (this.value){value};
    2929}
    3030
    3131forall(otype T)
    32 void ?{}(maybe(T) * this, maybe(T) other) {
    33         this->has_value = other.has_value;
     32void ?{}(maybe(T) & this, maybe(T) other) {
     33        this.has_value = other.has_value;
    3434        if (other.has_value) {
    35                 (&this->value){other.value};
     35                (this.value){other.value};
    3636        }
    3737}
    3838
    3939forall(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;
     40maybe(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;
    4646        } 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};
    4949        }
     50        return this;
    5051}
    5152
    5253forall(otype T)
    53 void ^?{}(maybe(T) * this) {
    54         if (this->has_value) {
    55                 ^(&this->value){};
     54void ^?{}(maybe(T) & this) {
     55        if (this.has_value) {
     56                ^(this.value){};
    5657        }
    5758}
     
    8990        } else {
    9091                this->has_value = true;
    91                 (&this->value){value};
     92                (this->value){value};
    9293        }
    9394}
     
    9798        if (this->has_value) {
    9899                this->has_value = false;
    99                 ^(&this->value){};
     100                ^(this->value){};
    100101        }
    101102}
  • src/libcfa/containers/result

    r54cd58b0 r9236060  
    3333
    3434forall(otype T, otype E)
    35 void ?{}(result(T, E) * this);
     35void ?{}(result(T, E) & this);
    3636
    3737forall(otype T, otype E)
    38 void ?{}(result(T, E) * this, one_t, T value);
     38void ?{}(result(T, E) & this, one_t, T value);
    3939
    4040forall(otype T, otype E)
    41 void ?{}(result(T, E) * this, zero_t, E error);
     41void ?{}(result(T, E) & this, zero_t, E error);
    4242
    4343forall(otype T, otype E)
    44 void ?{}(result(T, E) * this, result(T, E) other);
     44void ?{}(result(T, E) & this, result(T, E) other);
    4545
    4646forall(otype T, otype E)
    47 void ^?{}(result(T, E) * this);
     47void ^?{}(result(T, E) & this);
    4848
    4949forall(otype T, otype E)
    50 result(T, E) ?=?(result(T, E) * this, result(T, E) other);
     50result(T, E) ?=?(result(T, E) & this, result(T, E) other);
    5151
    5252forall(otype T, otype E)
  • src/libcfa/containers/result.c

    r54cd58b0 r9236060  
    1919
    2020forall(otype T, otype E)
    21 void ?{}(result(T, E) * this) {
    22         this->has_value = false;
    23         (&this->error){};
     21void ?{}(result(T, E) & this) {
     22        this.has_value = false;
     23        (this.error){};
    2424}
    2525
    2626forall(otype T, otype E)
    27 void ?{}(result(T, E) * this, one_t, T value) {
    28         this->has_value = true;
    29         (&this->value){value};
     27void ?{}(result(T, E) & this, one_t, T value) {
     28        this.has_value = true;
     29        (this.value){value};
    3030}
    3131
    3232forall(otype T, otype E)
    33 void ?{}(result(T, E) * this, zero_t, E error) {
    34         this->has_value = false;
    35         (&this->error){error};
     33void ?{}(result(T, E) & this, zero_t, E error) {
     34        this.has_value = false;
     35        (this.error){error};
    3636}
    3737
    3838forall(otype T, otype E)
    39 void ?{}(result(T, E) * this, result(T, E) other) {
    40         this->has_value = other.has_value;
     39void ?{}(result(T, E) & this, result(T, E) other) {
     40        this.has_value = other.has_value;
    4141        if (other.has_value) {
    42                 (&this->value){other.value};
     42                (this.value){other.value};
    4343        } else {
    44                 (&this->error){other.error};
     44                (this.error){other.error};
    4545        }
    4646}
    4747
    4848forall(otype T, otype E)
    49 result(T, E) ?=?(result(T, E) * this, result(T, E) that) {
    50         if (this->has_value & that.has_value) {
    51                 this->value = that.value;
    52         } else if (this->has_value) {
    53                 ^(&this->value){};
    54                 this->has_value = false;
    55                 (&this->error){that.error};
     49result(T, E) ?=?(result(T, E) & this, result(T, E) that) {
     50        if (this.has_value & that.has_value) {
     51                this.value = that.value;
     52        } else if (this.has_value) {
     53                ^(this.value){};
     54                this.has_value = false;
     55                (this.error){that.error};
    5656        } else if (that.has_value) {
    57                 ^(&this->error){};
    58                 this->has_value = true;
    59                 (&this->value){that.value};
     57                ^(this.error){};
     58                this.has_value = true;
     59                (this.value){that.value};
    6060        } else {
    61                 this->error = that.error;
     61                this.error = that.error;
    6262        }
    6363}
    6464
    6565forall(otype T, otype E)
    66 void ^?{}(result(T, E) * this) {
    67         if (this->has_value) {
    68                 ^(&this->value){};
     66void ^?{}(result(T, E) & this) {
     67        if (this.has_value) {
     68                ^(this.value){};
    6969        } else {
    70                 ^(&this->error){};
     70                ^(this.error){};
    7171        }
    7272}
     
    109109                this->value = value;
    110110        } else {
    111                 ^(&this->error){};
     111                ^(this->error){};
    112112                this->has_value = true;
    113                 (&this->value){value};
     113                (this->value){value};
    114114        }
    115115}
     
    118118void set_error(result(T, E) * this, E error) {
    119119        if (this->has_value) {
    120                 ^(&this->value){};
     120                ^(this->value){};
    121121                this->has_value = false;
    122                 (&this->error){error};
     122                (this->error){error};
    123123        } else {
    124124                this->error = error;
  • src/libcfa/containers/vector

    r54cd58b0 r9236060  
    3030
    3131forall(otype T)
    32 void ?{}(heap_allocator(T)* this);
     32void ?{}(heap_allocator(T)& this);
    3333
    3434forall(otype T)
    35 void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs);
     35void ?{}(heap_allocator(T)& this, heap_allocator(T) rhs);
    3636
    3737forall(otype T)
    38 heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs);
     38heap_allocator(T) ?=?(heap_allocator(T)& this, heap_allocator(T) rhs);
    3939
    4040forall(otype T)
    41 void ^?{}(heap_allocator(T)* this);
     41void ^?{}(heap_allocator(T)& this);
    4242
    4343forall(otype T)
     
    6464//Initialization
    6565forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    66 void ?{}(vector(T, allocator_t)* this);
     66void ?{}(vector(T, allocator_t)& this);
    6767
    6868forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    69 void ?{}(vector(T, allocator_t)* this, vector(T, allocator_t) rhs);
     69void ?{}(vector(T, allocator_t)& this, vector(T, allocator_t) rhs);
    7070
    7171forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    72 vector(T, allocator_t) ?=?(vector(T, allocator_t)* this, vector(T, allocator_t) rhs);
     72vector(T, allocator_t) ?=?(vector(T, allocator_t)& this, vector(T, allocator_t) rhs);
    7373
    7474forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    75 void ^?{}(vector(T, allocator_t)* this);
     75void ^?{}(vector(T, allocator_t)& this);
    7676
    7777forall(otype T, otype allocator_t = heap_allocator(T) | allocator_c(T, allocator_t))
  • src/libcfa/containers/vector.c

    r54cd58b0 r9236060  
    2424//Initialization
    2525forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    26 void ?{}(vector(T, allocator_t)* this)
     26void ?{}(vector(T, allocator_t)& this)
    2727{
    28         (&this->storage){};
    29         this->size = 0;
     28        (this.storage){};
     29        this.size = 0;
    3030}
    3131
    3232forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    33 void ?{}(vector(T, allocator_t)* this, vector(T, allocator_t) rhs)
     33void ?{}(vector(T, allocator_t)& this, vector(T, allocator_t) rhs)
    3434{
    35         (&this->storage){ rhs.storage };
    36         copy_internal(this, &rhs);
     35        (this.storage){ rhs.storage };
     36        copy_internal(&this, &rhs);
    3737}
    3838
     
    4646
    4747forall(otype T, otype allocator_t | allocator_c(T, allocator_t))
    48 void ^?{}(vector(T, allocator_t)* this)
     48void ^?{}(vector(T, allocator_t)& this)
    4949{
    50         clear(this);
    51         ^(&this->storage){};
     50        clear(&this);
     51        ^(this.storage){};
    5252}
    5353
     
    6666{
    6767        this->size--;
    68         ^(&data(&this->storage)[this->size]){};
     68        ^(data(&this->storage)[this->size]){};
    6969}
    7070
     
    7474        for(size_t i = 0; i < this->size; i++)
    7575        {
    76                 ^(&data(&this->storage)[this->size]){};
     76                ^(data(&this->storage)[this->size]){};
    7777        }
    7878        this->size = 0;
     
    8787        this->size = other->size;
    8888        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] };
    9090        }
    9191}
     
    9494//Allocator
    9595forall(otype T)
    96 void ?{}(heap_allocator(T)* this)
     96void ?{}(heap_allocator(T)& this)
    9797{
    98         this->storage = 0;
    99         this->capacity = 0;
     98        this.storage = 0;
     99        this.capacity = 0;
    100100}
    101101
    102102forall(otype T)
    103 void ?{}(heap_allocator(T)* this, heap_allocator(T) rhs)
     103void ?{}(heap_allocator(T)& this, heap_allocator(T) rhs)
    104104{
    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));
    107107}
    108108
    109109forall(otype T)
    110 heap_allocator(T) ?=?(heap_allocator(T)* this, heap_allocator(T) rhs)
     110heap_allocator(T) ?=?(heap_allocator(T)& this, heap_allocator(T) rhs)
    111111{
    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;
    115115}
    116116
    117117forall(otype T)
    118 void ^?{}(heap_allocator(T)* this)
     118void ^?{}(heap_allocator(T)& this)
    119119{
    120         free(this->storage);
     120        free(this.storage);
    121121}
    122122
  • src/libcfa/fstream

    r54cd58b0 r9236060  
    5656int fmt( ofstream *, const char fmt[], ... );
    5757
    58 void ?{}( ofstream * );
     58void ?{}( ofstream & );
    5959
    6060extern ofstream * sout, * serr;
  • src/libcfa/fstream.c

    r54cd58b0 r9236060  
    2727#define IO_MSG "I/O error: "
    2828
    29 void ?{}( ofstream * this, void * file, _Bool sepDefault, _Bool sepOnOff, const char * separator, const char * tupleSeparator ) {
    30         this->file = file;
    31         this->sepDefault = sepDefault;
    32         this->sepOnOff = sepOnOff;
    33         sepSet( this, separator );
    34         sepSetCur( this, sepGet( this ) );
    35         sepSetTuple( this, tupleSeparator );
     29void ?{}( ofstream & this, void * file, _Bool sepDefault, _Bool sepOnOff, const char * separator, const char * tupleSeparator ) {
     30        this.file = file;
     31        this.sepDefault = sepDefault;
     32        this.sepOnOff = sepOnOff;
     33        sepSet( &this, separator );
     34        sepSetCur( &this, sepGet( &this ) );
     35        sepSetTuple( &this, tupleSeparator );
    3636}
    3737
     
    9292                exit( EXIT_FAILURE );
    9393        } // if
    94         ?{}( os, file, true, false, " ", ", " );
     94        ?{}( *os, file, true, false, " ", ", " );
    9595} // open
    9696
  • src/libcfa/gmp

    r54cd58b0 r9236060  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // gmp -- 
    8 // 
     6//
     7// gmp --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Tue Apr 19 08:43:43 2016
     
    1212// Last Modified On : Fri Jul  7 09:33:20 2017
    1313// Update Count     : 15
    14 // 
     14//
    1515
    1616// https://gmplib.org/gmp-man-6.1.1.pdf
     
    2424
    2525// constructor
    26 static inline void ?{}( Int * this ) { mpz_init( this->mpz ); }
    27 static inline void ?{}( Int * this, Int init ) { mpz_init_set( this->mpz, init.mpz ); }
    28 static inline void ?{}( Int * this, zero_t ) { mpz_init_set_si( this->mpz, 0 ); }
    29 static inline void ?{}( Int * this, one_t ) { mpz_init_set_si( this->mpz, 1 ); }
    30 static inline void ?{}( Int * this, signed long int init ) { mpz_init_set_si( this->mpz, init ); }
    31 static inline void ?{}( Int * this, unsigned long int init ) { mpz_init_set_ui( this->mpz, init ); }
    32 static inline void ?{}( Int * this, const char * val ) { if ( mpz_init_set_str( this->mpz, val, 0 ) ) abort(); }
    33 static inline void ^?{}( Int * this ) { mpz_clear( this->mpz ); }
     26static inline void ?{}( Int & this ) { mpz_init( this.mpz ); }
     27static inline void ?{}( Int & this, Int init ) { mpz_init_set( this.mpz, init.mpz ); }
     28static inline void ?{}( Int & this, zero_t ) { mpz_init_set_si( this.mpz, 0 ); }
     29static inline void ?{}( Int & this, one_t ) { mpz_init_set_si( this.mpz, 1 ); }
     30static inline void ?{}( Int & this, signed long int init ) { mpz_init_set_si( this.mpz, init ); }
     31static inline void ?{}( Int & this, unsigned long int init ) { mpz_init_set_ui( this.mpz, init ); }
     32static inline void ?{}( Int & this, const char * val ) { if ( mpz_init_set_str( this.mpz, val, 0 ) ) abort(); }
     33static inline void ^?{}( Int & this ) { mpz_clear( this.mpz ); }
    3434
    3535// assignment
    36 static inline Int ?=?( Int * lhs, Int rhs ) { mpz_set( lhs->mpz, rhs.mpz ); return *lhs; }
    37 static inline Int ?=?( Int * lhs, long int rhs ) { mpz_set_si( lhs->mpz, rhs ); return *lhs; }
    38 static inline Int ?=?( Int * lhs, unsigned long int rhs ) { mpz_set_ui( lhs->mpz, rhs ); return *lhs; }
    39 static inline Int ?=?( Int * lhs, const char * rhs ) { if ( mpz_set_str( lhs->mpz, rhs, 0 ) ) { printf( "invalid string conversion\n" ); abort(); } return *lhs; }
    40 
    41 static inline char ?=?( char * lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
    42 static inline short int ?=?( short int * lhs, Int rhs ) { short int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
    43 static inline int ?=?( int * lhs, Int rhs ) { int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
    44 static inline long int ?=?( long int * lhs, Int rhs ) { long int val = mpz_get_si( rhs.mpz ); *lhs = val; return val; }
    45 static inline unsigned char ?=?( unsigned char * lhs, Int rhs ) { unsigned char val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
    46 static inline unsigned short int ?=?( unsigned short int * lhs, Int rhs ) { unsigned short int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
    47 static inline unsigned int ?=?( unsigned int * lhs, Int rhs ) { unsigned int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
    48 static inline unsigned long int ?=?( unsigned long int * lhs, Int rhs ) { unsigned long int val = mpz_get_ui( rhs.mpz ); *lhs = val; return val; }
     36static inline Int ?=?( Int & lhs, Int rhs ) { mpz_set( lhs.mpz, rhs.mpz ); return lhs; }
     37static inline Int ?=?( Int & lhs, long int rhs ) { mpz_set_si( lhs.mpz, rhs ); return lhs; }
     38static inline Int ?=?( Int & lhs, unsigned long int rhs ) { mpz_set_ui( lhs.mpz, rhs ); return lhs; }
     39static inline Int ?=?( Int & lhs, const char * rhs ) { if ( mpz_set_str( lhs.mpz, rhs, 0 ) ) { printf( "invalid string conversion\n" ); abort(); } return lhs; }
     40
     41static inline char ?=?( char & lhs, Int rhs ) { char val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }
     42static inline short int ?=?( short int & lhs, Int rhs ) { short int val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }
     43static inline int ?=?( int & lhs, Int rhs ) { int val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }
     44static inline long int ?=?( long int & lhs, Int rhs ) { long int val = mpz_get_si( rhs.mpz ); lhs = val; return lhs; }
     45static inline unsigned char ?=?( unsigned char & lhs, Int rhs ) { unsigned char val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }
     46static inline unsigned short int ?=?( unsigned short int & lhs, Int rhs ) { unsigned short int val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }
     47static inline unsigned int ?=?( unsigned int & lhs, Int rhs ) { unsigned int val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }
     48static inline unsigned long int ?=?( unsigned long int & lhs, Int rhs ) { unsigned long int val = mpz_get_ui( rhs.mpz ); lhs = val; return lhs; }
    4949
    5050// conversions
     
    9999static inline Int ?&?( Int oper1, unsigned long int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_and( conjunction.mpz, oper1.mpz, temp.mpz ); return conjunction; }
    100100static inline Int ?&?( unsigned long int oper1, Int oper2 ) { Int conjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_and( conjunction.mpz, temp.mpz, oper2.mpz ); return conjunction; }
    101 static inline Int ?&=?( Int * lhs, Int rhs ) { return *lhs = *lhs & rhs; }
     101static inline Int ?&=?( Int & lhs, Int rhs ) { return lhs = lhs & rhs; }
    102102
    103103static inline Int ?|?( Int oper1, Int oper2 ) { Int disjunction; mpz_ior( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; }
     
    106106static inline Int ?|?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
    107107static inline Int ?|?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
    108 static inline Int ?|=?( Int * lhs, Int rhs ) { return *lhs = *lhs | rhs; }
     108static inline Int ?|=?( Int & lhs, Int rhs ) { return lhs = lhs | rhs; }
    109109
    110110static inline Int ?^?( Int oper1, Int oper2 ) { Int disjunction; mpz_xor( disjunction.mpz, oper1.mpz, oper2.mpz ); return disjunction; }
     
    113113static inline Int ?^?( Int oper1, unsigned long int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper2 ); mpz_ior( disjunction.mpz, oper1.mpz, temp.mpz ); return disjunction; }
    114114static inline Int ?^?( unsigned long int oper1, Int oper2 ) { Int disjunction, temp; mpz_set_ui( temp.mpz, oper1 ); mpz_ior( disjunction.mpz, temp.mpz, oper2.mpz ); return disjunction; }
    115 static inline Int ?^=?( Int * lhs, Int rhs ) { return *lhs = *lhs ^ rhs; }
     115static inline Int ?^=?( Int & lhs, Int rhs ) { return lhs = lhs ^ rhs; }
    116116
    117117static inline Int ?+?( Int addend1, Int addend2 ) { Int sum; mpz_add( sum.mpz, addend1.mpz, addend2.mpz ); return sum; }
     
    120120static inline Int ?+?( Int addend1, unsigned long int addend2 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; }
    121121static inline Int ?+?( unsigned long int addend2, Int addend1 ) { Int sum; mpz_add_ui( sum.mpz, addend1.mpz, addend2 ); return sum; }
    122 static inline Int ?+=?( Int * lhs, Int rhs ) { return *lhs = *lhs + rhs; }
    123 static inline Int ?+=?( Int * lhs, long int rhs ) { return *lhs = *lhs + rhs; }
    124 static inline Int ?+=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs + rhs; }
    125 static inline Int ++?( Int * lhs ) { return *lhs += 1; }
    126 static inline Int ?++( Int * lhs ) { Int ret = *lhs; *lhs += 1; return ret; }
     122static inline Int ?+=?( Int & lhs, Int rhs ) { return lhs = lhs + rhs; }
     123static inline Int ?+=?( Int & lhs, long int rhs ) { return lhs = lhs + rhs; }
     124static inline Int ?+=?( Int & lhs, unsigned long int rhs ) { return lhs = lhs + rhs; }
     125static inline Int ++?( Int & lhs ) { return lhs += 1; }
     126static inline Int ?++( Int & lhs ) { Int ret = lhs; lhs += 1; return ret; }
    127127
    128128static inline Int ?-?( Int minuend, Int subtrahend ) { Int diff; mpz_sub( diff.mpz, minuend.mpz, subtrahend.mpz ); return diff; }
     
    131131static inline Int ?-?( Int minuend, unsigned long int subtrahend ) { Int diff; mpz_sub_ui( diff.mpz, minuend.mpz, subtrahend ); return diff; }
    132132static inline Int ?-?( unsigned long int minuend, Int subtrahend ) { Int diff; mpz_ui_sub( diff.mpz, minuend, subtrahend.mpz ); return diff; }
    133 static inline Int ?-=?( Int * lhs, Int rhs ) { return *lhs = *lhs - rhs; }
    134 static inline Int ?-=?( Int * lhs, long int rhs ) { return *lhs = *lhs - rhs; }
    135 static inline Int ?-=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs - rhs; }
    136 static inline Int --?( Int * lhs ) { return *lhs -= 1; }
    137 static inline Int ?--( Int * lhs ) { Int ret = *lhs; *lhs -= 1; return ret; }
     133static inline Int ?-=?( Int & lhs, Int rhs ) { return lhs = lhs - rhs; }
     134static inline Int ?-=?( Int & lhs, long int rhs ) { return lhs = lhs - rhs; }
     135static inline Int ?-=?( Int & lhs, unsigned long int rhs ) { return lhs = lhs - rhs; }
     136static inline Int --?( Int & lhs ) { return lhs -= 1; }
     137static inline Int ?--( Int & lhs ) { Int ret = lhs; lhs -= 1; return ret; }
    138138
    139139static inline Int ?*?( Int multiplicator, Int multiplicand ) { Int product; mpz_mul( product.mpz, multiplicator.mpz, multiplicand.mpz ); return product; }
     
    142142static inline Int ?*?( Int multiplicator, unsigned long int multiplicand ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; }
    143143static inline Int ?*?( unsigned long int multiplicand, Int multiplicator ) { Int product; mpz_mul_ui( product.mpz, multiplicator.mpz, multiplicand ); return product; }
    144 static inline Int ?*=?( Int * lhs, Int rhs ) { return *lhs = *lhs * rhs; }
    145 static inline Int ?*=?( Int * lhs, long int rhs ) { return *lhs = *lhs * rhs; }
    146 static inline Int ?*=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs * rhs; }
     144static inline Int ?*=?( Int & lhs, Int rhs ) { return lhs = lhs * rhs; }
     145static inline Int ?*=?( Int & lhs, long int rhs ) { return lhs = lhs * rhs; }
     146static inline Int ?*=?( Int & lhs, unsigned long int rhs ) { return lhs = lhs * rhs; }
    147147
    148148// some code for operators "/" and "%" taken from g++ gmpxx.h
     
    187187        return quotient;
    188188} // ?/?
    189 static inline Int ?/=?( Int * lhs, Int rhs ) { return *lhs = *lhs / rhs; }
    190 static inline Int ?/=?( Int * lhs, long int rhs ) { return *lhs = *lhs / rhs; }
    191 static inline Int ?/=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs / rhs; }
     189static inline Int ?/=?( Int & lhs, Int rhs ) { return lhs = lhs / rhs; }
     190static inline Int ?/=?( Int & lhs, long int rhs ) { return lhs = lhs / rhs; }
     191static inline Int ?/=?( Int & lhs, unsigned long int rhs ) { return lhs = lhs / rhs; }
    192192
    193193static inline [ Int, Int ] div( Int dividend, Int divisor ) { Int quotient, remainder; mpz_fdiv_qr( quotient.mpz, remainder.mpz, dividend.mpz, divisor.mpz ); return [ quotient, remainder ]; }
     
    228228        return remainder;
    229229} // ?%?
    230 static inline Int ?%=?( Int * lhs, Int rhs ) { return *lhs = *lhs % rhs; }
    231 static inline Int ?%=?( Int * lhs, long int rhs ) { return *lhs = *lhs % rhs; }
    232 static inline Int ?%=?( Int * lhs, unsigned long int rhs ) { return *lhs = *lhs % rhs; }
     230static inline Int ?%=?( Int & lhs, Int rhs ) { return lhs = lhs % rhs; }
     231static inline Int ?%=?( Int & lhs, long int rhs ) { return lhs = lhs % rhs; }
     232static inline Int ?%=?( Int & lhs, unsigned long int rhs ) { return lhs = lhs % rhs; }
    233233
    234234static inline Int ?<<?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_mul_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; }
    235 static inline Int ?<<=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs << shift; }
     235static inline Int ?<<=?( Int & lhs, mp_bitcnt_t shift ) { return lhs = lhs << shift; }
    236236static inline Int ?>>?( Int shiften, mp_bitcnt_t shift ) { Int shifted; mpz_fdiv_q_2exp( shifted.mpz, shiften.mpz, shift ); return shifted; }
    237 static inline Int ?>>=?( Int * lhs, mp_bitcnt_t shift ) { return *lhs = *lhs >> shift; }
     237static inline Int ?>>=?( Int & lhs, mp_bitcnt_t shift ) { return lhs = lhs >> shift; }
    238238
    239239// number functions
  • src/libcfa/interpose.c

    r54cd58b0 r9236060  
    4949
    5050        union { generic_fptr_t fptr; void* ptr; } originalFunc;
    51        
     51
    5252        #if defined( _GNU_SOURCE )
    5353                if ( version ) {
     
    5959                originalFunc.ptr = dlsym( library, symbol );
    6060        #endif // _GNU_SOURCE
    61        
     61
    6262        error = dlerror();
    63         if ( error ) abortf( "interpose_symbol : internal error, %s\n", error ); 
     63        if ( error ) abortf( "interpose_symbol : internal error, %s\n", error );
    6464
    6565        return originalFunc.fptr;
     
    7474forall(dtype T)
    7575static inline void assign_ptr( T** symbol_ptr, const char * symbol_name, const char * version) {
    76         union { 
     76        union {
    7777                generic_fptr_t gp;
    78                 T* tp; 
     78                T* tp;
    7979        } u;
    8080
  • src/libcfa/iterator

    r54cd58b0 r9236060  
    1919trait iterator( otype iterator_type, otype elt_type ) {
    2020        // point to the next element
    21 //      iterator_type ?++( iterator_type * );
    22         iterator_type ++?( iterator_type * );
    23         iterator_type --?( iterator_type * );
     21//      iterator_type ?++( iterator_type & );
     22        iterator_type ++?( iterator_type & );
     23        iterator_type --?( iterator_type & );
    2424
    2525        // can be tested for equality with other iterators
     
    2828
    2929        // dereference to get the pointed-at element
    30         lvalue elt_type *?( iterator_type );
     30        elt_type & *?( iterator_type );
    3131};
    3232
  • src/libcfa/rational

    r54cd58b0 r9236060  
    3131        int ?>?( T, T );
    3232        int ?>=?( T, T );
    33         void ?{}( T *, zero_t );
    34         void ?{}( T *, one_t );
     33        void ?{}( T &, zero_t );
     34        void ?{}( T &, one_t );
    3535        T +?( T );
    3636        T -?( T );
     
    4040        T ?/?( T, T );
    4141        T ?%?( T, T );
    42         T ?/=?( T *, T );
     42        T ?/=?( T &, T );
    4343        T abs( T );
    4444};
     
    5454
    5555forall( otype RationalImpl | arithmetic( RationalImpl ) )
    56 void ?{}( Rational(RationalImpl) * r );
     56void ?{}( Rational(RationalImpl) & r );
    5757
    5858forall( otype RationalImpl | arithmetic( RationalImpl ) )
    59 void ?{}( Rational(RationalImpl) * r, RationalImpl n );
     59void ?{}( Rational(RationalImpl) & r, RationalImpl n );
    6060
    6161forall( otype RationalImpl | arithmetic( RationalImpl ) )
    62 void ?{}( Rational(RationalImpl) * r, RationalImpl n, RationalImpl d );
     62void ?{}( Rational(RationalImpl) & r, RationalImpl n, RationalImpl d );
    6363
    6464forall( otype RationalImpl | arithmetic( RationalImpl ) )
    65 void ?{}( Rational(RationalImpl) * r, zero_t );
     65void ?{}( Rational(RationalImpl) & r, zero_t );
    6666
    6767forall( otype RationalImpl | arithmetic( RationalImpl ) )
    68 void ?{}( Rational(RationalImpl) * r, one_t );
     68void ?{}( Rational(RationalImpl) & r, one_t );
    6969
    7070// numerator/denominator getter
     
    7777
    7878forall( otype RationalImpl | arithmetic( RationalImpl ) )
    79 [ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src );
     79[ RationalImpl, RationalImpl ] ?=?( & [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src );
    8080
    8181// numerator/denominator setter
  • src/libcfa/rational.c

    r54cd58b0 r9236060  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // rational.c -- 
    8 // 
     6//
     7// rational.c --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Apr  6 17:54:28 2016
     
    1212// Last Modified On : Tue May 16 18:35:36 2017
    1313// Update Count     : 150
    14 // 
     14//
    1515
    1616#include "rational"
     
    4747
    4848forall( otype RationalImpl | arithmetic( RationalImpl ) )
    49 void ?{}( Rational(RationalImpl) * r ) {
     49void ?{}( Rational(RationalImpl) & r ) {
    5050        r{ (RationalImpl){0}, (RationalImpl){1} };
    5151} // rational
    5252
    5353forall( otype RationalImpl | arithmetic( RationalImpl ) )
    54 void ?{}( Rational(RationalImpl) * r, RationalImpl n ) {
     54void ?{}( Rational(RationalImpl) & r, RationalImpl n ) {
    5555        r{ n, (RationalImpl){1} };
    5656} // rational
    5757
    5858forall( otype RationalImpl | arithmetic( RationalImpl ) )
    59 void ?{}( Rational(RationalImpl) * r, RationalImpl n, RationalImpl d ) {
     59void ?{}( Rational(RationalImpl) & r, RationalImpl n, RationalImpl d ) {
    6060        RationalImpl t = simplify( &n, &d );                            // simplify
    61         r->numerator = n / t;
    62         r->denominator = d / t;
     61        r.numerator = n / t;
     62        r.denominator = d / t;
    6363} // rational
    6464
     
    7777
    7878forall( otype RationalImpl | arithmetic( RationalImpl ) )
    79 [ RationalImpl, RationalImpl ] ?=?( * [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) {
    80         return *dest = src.[ numerator, denominator ];
     79[ RationalImpl, RationalImpl ] ?=?( & [ RationalImpl, RationalImpl ] dest, Rational(RationalImpl) src ) {
     80        return dest = src.[ numerator, denominator ];
    8181}
    8282
  • src/libcfa/stdlib

    r54cd58b0 r9236060  
    132132
    133133// allocation/deallocation and constructor/destructor, non-array types
    134 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) T * new( Params p );
    135 forall( dtype T | { void ^?{}( T * ); } ) void delete( T * ptr );
    136 forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } ) void delete( T * ptr, Params rest );
     134forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * new( Params p );
     135forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void delete( T * ptr );
     136forall( dtype T, ttype Params | sized(T) | { void ^?{}( T & ); void delete( Params ); } ) void delete( T * ptr, Params rest );
    137137
    138138// allocation/deallocation and constructor/destructor, array types
    139 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } ) T * anew( size_t dim, Params p );
    140 forall( dtype T | sized(T) | { void ^?{}( T * ); } ) void adelete( size_t dim, T arr[] );
    141 forall( dtype T | sized(T) | { void ^?{}( T * ); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest );
     139forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } ) T * anew( size_t dim, Params p );
     140forall( dtype T | sized(T) | { void ^?{}( T & ); } ) void adelete( size_t dim, T arr[] );
     141forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } ) void adelete( size_t dim, T arr[], Params rest );
    142142
    143143//---------------------------------------
     
    201201double abs( double _Complex );
    202202long double abs( long double _Complex );
    203 forall( otype T | { void ?{}( T *, zero_t ); int ?<?( T, T ); T -?( T ); } )
     203forall( otype T | { void ?{}( T &, zero_t ); int ?<?( T, T ); T -?( T ); } )
    204204T abs( T );
    205205
  • src/libcfa/stdlib.c

    r54cd58b0 r9236060  
    3232        if ( nlen > olen ) {                                                            // larger ?
    3333                memset( nptr + olen, (int)fill, nlen - olen );  // initialize added storage
    34         } // 
     34        } //
    3535    return (T *)nptr;
    3636} // alloc
    3737
    3838// allocation/deallocation and constructor/destructor, non-array types
    39 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } )
     39forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } )
    4040T * new( Params p ) {
    41         return (malloc()){ p };                                                         // run constructor
     41        return &(*malloc()){ p };                                                               // run constructor
    4242} // new
    4343
    44 forall( dtype T | { void ^?{}( T * ); } )
     44forall( dtype T | sized(T) | { void ^?{}( T & ); } )
    4545void delete( T * ptr ) {
    4646        if ( ptr ) {                                                                            // ignore null
    47                 ^ptr{};                                                                                 // run destructor
     47                ^(*ptr){};                                                                                      // run destructor
    4848                free( ptr );
    4949        } // if
    5050} // delete
    5151
    52 forall( dtype T, ttype Params | { void ^?{}( T * ); void delete( Params ); } )
     52forall( dtype T, ttype Params | sized(T) | { void ^?{}( T & ); void delete( Params ); } )
    5353void delete( T * ptr, Params rest ) {
    5454        if ( ptr ) {                                                                            // ignore null
    55                 ^ptr{};                                                                                 // run destructor
     55                ^(*ptr){};                                                                                      // run destructor
    5656                free( ptr );
    5757        } // if
     
    6161
    6262// allocation/deallocation and constructor/destructor, array types
    63 forall( dtype T | sized(T), ttype Params | { void ?{}( T *, Params ); } )
     63forall( dtype T | sized(T), ttype Params | { void ?{}( T &, Params ); } )
    6464T * anew( size_t dim, Params p ) {
    6565        T *arr = alloc( dim );
    6666        for ( unsigned int i = 0; i < dim; i += 1 ) {
    67                 (&arr[i]){ p };                                                                 // run constructor
     67                (arr[i]){ p };                                                                  // run constructor
    6868        } // for
    6969        return arr;
    7070} // anew
    7171
    72 forall( dtype T | sized(T) | { void ^?{}( T * ); } )
     72forall( dtype T | sized(T) | { void ^?{}( T & ); } )
    7373void adelete( size_t dim, T arr[] ) {
    7474        if ( arr ) {                                                                            // ignore null
    7575                for ( int i = dim - 1; i >= 0; i -= 1 ) {               // reverse allocation order, must be unsigned
    76                         ^(&arr[i]){};                                                           // run destructor
     76                        ^(arr[i]){};                                                            // run destructor
    7777                } // for
    7878                free( arr );
     
    8080} // adelete
    8181
    82 forall( dtype T | sized(T) | { void ^?{}( T * ); }, ttype Params | { void adelete( Params ); } )
     82forall( dtype T | sized(T) | { void ^?{}( T & ); }, ttype Params | { void adelete( Params ); } )
    8383void adelete( size_t dim, T arr[], Params rest ) {
    8484        if ( arr ) {                                                                            // ignore null
    8585                for ( int i = dim - 1; i >= 0; i -= 1 ) {               // reverse allocation order, must be unsigned
    86                         ^(&arr[i]){};                                                           // run destructor
     86                        ^(arr[i]){};                                                            // run destructor
    8787                } // for
    8888                free( arr );
  • src/prelude/builtins.c

    r54cd58b0 r9236060  
    8080} // ?\?
    8181
    82 static inline forall( otype T | { void ?{}( T * this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } )
     82static inline forall( otype T | { void ?{}( T & this, one_t ); T ?*?( T, T ); double ?/?( double, T ); } )
    8383double ?\?( T x, signed long int y ) {
    8484    if ( y >=  0 ) return (double)(x \ (unsigned long int)y);
  • src/prelude/prelude.cf

    r54cd58b0 r9236060  
    3030// ------------------------------------------------------------
    3131
    32 _Bool                   ?++( _Bool * ),                         ?++( volatile _Bool * );
    33 _Bool                   ?--( _Bool * ),                         ?--( volatile _Bool * );
    34 unsigned char           ?++( unsigned char * ),                 ?++( volatile unsigned char * );
    35 signed int              ?++( signed int * ),                    ?++( volatile signed int * );
    36 signed int              ?--( signed int * ),                    ?--( volatile signed int * );
    37 unsigned int            ?++( unsigned int * ),                  ?++( volatile unsigned int * );
    38 unsigned int            ?--( unsigned int * ),                  ?--( volatile unsigned int * );
    39 signed long int         ?++( signed long int * ),               ?++( volatile signed long int * );
    40 signed long int         ?--( signed long int * ),               ?--( volatile signed long int * );
    41 unsigned long int       ?++( unsigned long int * ),             ?++( volatile unsigned long int * );
    42 unsigned long int       ?--( unsigned long int * ),             ?--( volatile unsigned long int * );
    43 signed long long int    ?++( signed long long int * ),          ?++( volatile signed long long int * );
    44 signed long long int    ?--( signed long long int * ),          ?--( volatile signed long long int * );
    45 unsigned long long int  ?++( unsigned long long int * ),        ?++( volatile unsigned long long int * );
    46 unsigned long long int  ?--( unsigned long long int * ),        ?--( volatile unsigned long long int * );
    47 float                   ?++( float * ),                         ?++( volatile float * );
    48 float                   ?--( float * ),                         ?--( volatile float * );
    49 double                  ?++( double * ),                        ?++( volatile double * );
    50 double                  ?--( double * ),                        ?--( volatile double * );
    51 long double             ?++( long double * ),                   ?++( volatile long double * );
    52 long double             ?--( long double * ),                   ?--( volatile long double * );
    53 float _Complex          ?++( float _Complex * ),                ?++( volatile float _Complex * );
    54 float _Complex          ?--( float _Complex * ),                ?--( volatile float _Complex * );
    55 double _Complex         ?++( double _Complex * ),               ?++( volatile double _Complex * );
    56 double _Complex         ?--( double _Complex * ),               ?--( volatile double _Complex * );
    57 long double _Complex    ?++( long double _Complex * ),          ?++( volatile long double _Complex * );
    58 long double _Complex    ?--( long double _Complex * ),          ?--( volatile long double _Complex * );
    59 
    60 forall( dtype T | sized(T) ) T *                         ?++(                T ** );
    61 forall( dtype T | sized(T) ) const T *           ?++( const          T ** );
    62 forall( dtype T | sized(T) ) volatile T *                ?++(       volatile T ** );
    63 forall( dtype T | sized(T) ) const volatile T *  ?++( const volatile T ** );
    64 forall( dtype T | sized(T) ) T *                         ?--(                T ** );
    65 forall( dtype T | sized(T) ) const T *           ?--( const          T ** );
    66 forall( dtype T | sized(T) ) volatile T *                ?--(       volatile T ** );
    67 forall( dtype T | sized(T) ) const volatile T *  ?--( const volatile T ** );
    68 
    69 forall( dtype T | sized(T) ) lvalue T            ?[?](                T *,          ptrdiff_t );
    70 forall( dtype T | sized(T) ) const lvalue T      ?[?]( const          T *,          ptrdiff_t );
    71 forall( dtype T | sized(T) ) volatile lvalue T   ?[?](       volatile T *,          ptrdiff_t );
    72 forall( dtype T | sized(T) ) const volatile lvalue T ?[?]( const volatile T *,      ptrdiff_t );
    73 forall( dtype T | sized(T) ) lvalue T            ?[?](          ptrdiff_t,                T * );
    74 forall( dtype T | sized(T) ) const lvalue T      ?[?](          ptrdiff_t, const          T * );
    75 forall( dtype T | sized(T) ) volatile lvalue T   ?[?](          ptrdiff_t,       volatile T * );
    76 forall( dtype T | sized(T) ) const volatile lvalue T ?[?](              ptrdiff_t, const volatile T * );
     32_Bool                   ?++( _Bool & ),                         ?++( volatile _Bool & );
     33_Bool                   ?--( _Bool & ),                         ?--( volatile _Bool & );
     34unsigned char           ?++( unsigned char & ),                 ?++( volatile unsigned char & );
     35signed int              ?++( signed int & ),                    ?++( volatile signed int & );
     36signed int              ?--( signed int & ),                    ?--( volatile signed int & );
     37unsigned int            ?++( unsigned int & ),                  ?++( volatile unsigned int & );
     38unsigned int            ?--( unsigned int & ),                  ?--( volatile unsigned int & );
     39signed long int         ?++( signed long int & ),               ?++( volatile signed long int & );
     40signed long int         ?--( signed long int & ),               ?--( volatile signed long int & );
     41unsigned long int       ?++( unsigned long int & ),             ?++( volatile unsigned long int & );
     42unsigned long int       ?--( unsigned long int & ),             ?--( volatile unsigned long int & );
     43signed long long int    ?++( signed long long int & ),          ?++( volatile signed long long int & );
     44signed long long int    ?--( signed long long int & ),          ?--( volatile signed long long int & );
     45unsigned long long int  ?++( unsigned long long int & ),        ?++( volatile unsigned long long int & );
     46unsigned long long int  ?--( unsigned long long int & ),        ?--( volatile unsigned long long int & );
     47float                   ?++( float & ),                         ?++( volatile float & );
     48float                   ?--( float & ),                         ?--( volatile float & );
     49double                  ?++( double & ),                        ?++( volatile double & );
     50double                  ?--( double & ),                        ?--( volatile double & );
     51long double             ?++( long double & ),                   ?++( volatile long double & );
     52long double             ?--( long double & ),                   ?--( volatile long double & );
     53float _Complex          ?++( float _Complex & ),                ?++( volatile float _Complex & );
     54float _Complex          ?--( float _Complex & ),                ?--( volatile float _Complex & );
     55double _Complex         ?++( double _Complex & ),               ?++( volatile double _Complex & );
     56double _Complex         ?--( double _Complex & ),               ?--( volatile double _Complex & );
     57long double _Complex    ?++( long double _Complex & ),          ?++( volatile long double _Complex & );
     58long double _Complex    ?--( long double _Complex & ),          ?--( volatile long double _Complex & );
     59
     60forall( dtype T | sized(T) ) T *                         ?++(                T *& );
     61forall( dtype T | sized(T) ) const T *           ?++( const          T *& );
     62forall( dtype T | sized(T) ) volatile T *                ?++(       volatile T *& );
     63forall( dtype T | sized(T) ) const volatile T *  ?++( const volatile T *& );
     64forall( dtype T | sized(T) ) T *                         ?--(                T *& );
     65forall( dtype T | sized(T) ) const T *           ?--( const          T *& );
     66forall( dtype T | sized(T) ) volatile T *                ?--(       volatile T *& );
     67forall( dtype T | sized(T) ) const volatile T *  ?--( const volatile T *& );
     68
     69forall( dtype T | sized(T) ) T &                 ?[?](                T *,          ptrdiff_t );
     70forall( dtype T | sized(T) ) const T &   ?[?]( const          T *,          ptrdiff_t );
     71forall( dtype T | sized(T) ) volatile T &        ?[?](       volatile T *,          ptrdiff_t );
     72forall( dtype T | sized(T) ) const volatile T & ?[?]( const volatile T *,           ptrdiff_t );
     73forall( dtype T | sized(T) ) T &                 ?[?](          ptrdiff_t,                T * );
     74forall( dtype T | sized(T) ) const T &   ?[?](          ptrdiff_t, const          T * );
     75forall( dtype T | sized(T) ) volatile T &        ?[?](          ptrdiff_t,       volatile T * );
     76forall( dtype T | sized(T) ) const volatile T & ?[?](           ptrdiff_t, const volatile T * );
    7777
    7878// ------------------------------------------------------------
     
    8282// ------------------------------------------------------------
    8383
    84 _Bool                   ++?( _Bool * ),                         --?( _Bool * );
    85 signed int              ++?( signed int * ),                    --?( signed int * );
    86 unsigned int            ++?( unsigned int * ),                  --?( unsigned int * );
    87 signed long int         ++?( signed long int * ),               --?( signed long int * );
    88 unsigned long int       ++?( unsigned long int * ),             --?( unsigned long int * );
    89 signed long long int    ++?( signed long long int * ),          --?( signed long long int * );
    90 unsigned long long int  ++?( unsigned long long int * ),        --?( unsigned long long int * );
    91 float                   ++?( float * ),                         --?( float * );
    92 double                  ++?( double * ),                        --?( double * );
    93 long double             ++?( long double * ),                   --?( long double * );
    94 float _Complex          ++?( float _Complex * ),                --?( float _Complex * );
    95 double _Complex         ++?( double _Complex * ),               --?( double _Complex * );
    96 long double _Complex    ++?( long double _Complex * ),          --?( long double _Complex * );
    97 
    98 forall( dtype T | sized(T) ) T *                         ++?(                T ** );
    99 forall( dtype T | sized(T) ) const T *           ++?( const          T ** );
    100 forall( dtype T | sized(T) ) volatile T *                ++?(       volatile T ** );
    101 forall( dtype T | sized(T) ) const volatile T *  ++?( const volatile T ** );
    102 forall( dtype T | sized(T) ) T *                         --?(                T ** );
    103 forall( dtype T | sized(T) ) const T *           --?( const          T ** );
    104 forall( dtype T | sized(T) ) volatile T *                --?(       volatile T ** );
    105 forall( dtype T | sized(T) ) const volatile T *  --?( const volatile T ** );
    106 
    107 forall( dtype T | sized(T) ) lvalue T            *?(                 T * );
    108 forall( dtype T | sized(T) ) const lvalue T              *?( const           T * );
    109 forall( dtype T | sized(T) ) volatile lvalue T   *?(       volatile  T * );
    110 forall( dtype T | sized(T) ) const volatile lvalue T *?( const volatile  T * );
    111 forall( ftype FT ) lvalue FT             *?( FT * );
     84_Bool                   ++?( _Bool & ),                         --?( _Bool & );
     85signed int              ++?( signed int & ),                    --?( signed int & );
     86unsigned int            ++?( unsigned int & ),                  --?( unsigned int & );
     87signed long int         ++?( signed long int & ),               --?( signed long int & );
     88unsigned long int       ++?( unsigned long int & ),             --?( unsigned long int & );
     89signed long long int    ++?( signed long long int & ),          --?( signed long long int & );
     90unsigned long long int  ++?( unsigned long long int & ),        --?( unsigned long long int & );
     91float                   ++?( float & ),                         --?( float & );
     92double                  ++?( double & ),                        --?( double & );
     93long double             ++?( long double & ),                   --?( long double & );
     94float _Complex          ++?( float _Complex & ),                --?( float _Complex & );
     95double _Complex         ++?( double _Complex & ),               --?( double _Complex & );
     96long double _Complex    ++?( long double _Complex & ),          --?( long double _Complex & );
     97
     98forall( dtype T | sized(T) ) T *                         ++?(                T *& );
     99forall( dtype T | sized(T) ) const T *           ++?( const          T *& );
     100forall( dtype T | sized(T) ) volatile T *                ++?(       volatile T *& );
     101forall( dtype T | sized(T) ) const volatile T *  ++?( const volatile T *& );
     102forall( dtype T | sized(T) ) T *                         --?(                T *& );
     103forall( dtype T | sized(T) ) const T *           --?( const          T *& );
     104forall( dtype T | sized(T) ) volatile T *                --?(       volatile T *& );
     105forall( dtype T | sized(T) ) const volatile T *  --?( const volatile T *& );
     106
     107forall( dtype T | sized(T) ) T &                 *?(                 T * );
     108forall( dtype T | sized(T) ) const T &           *?( const           T * );
     109forall( dtype T | sized(T) ) volatile T &        *?(       volatile  T * );
     110forall( dtype T | sized(T) ) const volatile T & *?( const volatile  T * );
     111forall( ftype FT ) FT &          *?( FT * );
    112112
    113113_Bool                   +?( _Bool ),                    -?( _Bool ),                    ~?( _Bool );
     
    366366// ------------------------------------------------------------
    367367
    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 );
     368forall( ftype FT ) FT *                 ?=?( FT *&, FT * );
     369forall( ftype FT ) FT *                 ?=?( FT * volatile &, FT * );
     370
     371forall( dtype DT ) DT *                 ?=?(                 DT *          &,                   DT * );
     372forall( dtype DT ) DT *                 ?=?(                 DT * volatile &,                   DT * );
     373forall( dtype DT ) const DT *           ?=?( const           DT *          &,                   DT * );
     374forall( dtype DT ) const DT *           ?=?( const           DT * volatile &,                   DT * );
     375forall( dtype DT ) const DT *           ?=?( const           DT *          &, const             DT * );
     376forall( dtype DT ) const DT *           ?=?( const           DT * volatile &, const             DT * );
     377forall( dtype DT ) volatile DT *        ?=?(       volatile  DT *          &,                   DT * );
     378forall( dtype DT ) volatile DT *        ?=?(       volatile  DT * volatile &,                   DT * );
     379forall( dtype DT ) volatile DT *        ?=?(       volatile  DT *          &,       volatile    DT * );
     380forall( dtype DT ) volatile DT *        ?=?(       volatile  DT * volatile &,       volatile    DT * );
     381
     382forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &,                   DT * );
     383forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &,                   DT * );
     384forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &, const             DT * );
     385forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &, const             DT * );
     386forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &,       volatile    DT * );
     387forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &,       volatile    DT * );
     388forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &, const volatile    DT * );
     389forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &, const volatile    DT * );
     390
     391forall( dtype DT ) DT *                 ?=?(                 DT *          &,                   void * );
     392forall( dtype DT ) DT *                 ?=?(                 DT * volatile &,                   void * );
     393forall( dtype DT ) const DT *           ?=?( const           DT *          &,                   void * );
     394forall( dtype DT ) const DT *           ?=?( const           DT * volatile &,                   void * );
     395forall( dtype DT ) const DT *           ?=?( const           DT *          &, const             void * );
     396forall( dtype DT ) const DT *           ?=?( const           DT * volatile &, const             void * );
     397forall( dtype DT ) volatile DT *        ?=?(       volatile  DT *          &,                   void * );
     398forall( dtype DT ) volatile DT *        ?=?(       volatile  DT * volatile &,                   void * );
     399forall( dtype DT ) volatile DT *        ?=?(       volatile  DT *          &,       volatile    void * );
     400forall( dtype DT ) volatile DT *        ?=?(       volatile  DT * volatile &,       volatile    void * );
     401
     402forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &,                   void * );
     403forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &,                   void * );
     404forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &, const             void * );
     405forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &, const             void * );
     406forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &,       volatile    void * );
     407forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &,       volatile    void * );
     408forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT *          &, const volatile    void * );
     409forall( dtype DT ) const volatile DT *  ?=?( const volatile  DT * volatile &, const volatile    void * );
     410
     411forall( dtype DT ) void *                ?=?(                void *          &,                 DT * );
     412forall( dtype DT ) void *                ?=?(                void * volatile &,                 DT * );
     413forall( dtype DT ) const void *          ?=?( const          void *          &,                 DT * );
     414forall( dtype DT ) const void *          ?=?( const          void * volatile &,                 DT * );
     415forall( dtype DT ) const void *          ?=?( const          void *          &, const           DT * );
     416forall( dtype DT ) const void *          ?=?( const          void * volatile &, const           DT * );
     417forall( dtype DT ) volatile void *       ?=?(       volatile void *          &,                 DT * );
     418forall( dtype DT ) volatile void *       ?=?(       volatile void * volatile &,                 DT * );
     419forall( dtype DT ) volatile void *       ?=?(       volatile void *          &,       volatile  DT * );
     420forall( dtype DT ) volatile void *       ?=?(       volatile void * volatile &,       volatile  DT * );
     421forall( dtype DT ) const volatile void * ?=?( const volatile void *          &,                 DT * );
     422forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &,                 DT * );
     423forall( dtype DT ) const volatile void * ?=?( const volatile void *          &, const           DT * );
     424forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, const           DT * );
     425forall( dtype DT ) const volatile void * ?=?( const volatile void *          &,       volatile  DT * );
     426forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &,       volatile  DT * );
     427forall( dtype DT ) const volatile void * ?=?( const volatile void *          &, const volatile  DT * );
     428forall( dtype DT ) const volatile void * ?=?( const volatile void * volatile &, const volatile  DT * );
     429
     430void *                  ?=?(                void *          &,                void * );
     431void *                  ?=?(                void * volatile &,                void * );
     432const void *            ?=?( const          void *          &,                void * );
     433const void *            ?=?( const          void * volatile &,                void * );
     434const void *            ?=?( const          void *          &, const          void * );
     435const void *            ?=?( const          void * volatile &, const          void * );
     436volatile void *         ?=?(       volatile void *          &,                void * );
     437volatile void *         ?=?(       volatile void * volatile &,                void * );
     438volatile void *         ?=?(       volatile void *          &,       volatile void * );
     439volatile void *         ?=?(       volatile void * volatile &,       volatile void * );
     440const volatile void *   ?=?( const volatile void *          &,                void * );
     441const volatile void *   ?=?( const volatile void * volatile &,                void * );
     442const volatile void *   ?=?( const volatile void *          &, const          void * );
     443const volatile void *   ?=?( const volatile void * volatile &, const          void * );
     444const volatile void *   ?=?( const volatile void *          &,       volatile void * );
     445const volatile void *   ?=?( const volatile void * volatile &,       volatile void * );
     446const volatile void *   ?=?( const volatile void *          &, const volatile void * );
     447const 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 );
     451forall( dtype DT ) const DT *           ?=?( const          DT *          &, zero_t );
     452forall( dtype DT ) const DT *           ?=?( const          DT * volatile &, zero_t );
     453//forall( dtype DT ) volatile DT *      ?=?( volatile       DT *          &, zero_t );
     454//forall( dtype DT ) volatile DT *      ?=?( volatile       DT * volatile &, zero_t );
     455forall( dtype DT ) const volatile DT *  ?=?( const volatile DT *          &, zero_t );
     456forall( dtype DT ) const volatile DT *  ?=?( const volatile DT * volatile &, zero_t );
     457
     458forall( ftype FT ) FT *                 ?=?( FT *          &, forall( ftype FT2 ) FT2 * );
     459forall( ftype FT ) FT *                 ?=?( FT * volatile &, forall( ftype FT2 ) FT2 * );
     460
     461forall( dtype T | sized(T) ) T *                        ?+=?(                T *          &, ptrdiff_t );
     462forall( dtype T | sized(T) ) T *                        ?+=?(                T * volatile &, ptrdiff_t );
     463forall( dtype T | sized(T) ) const T *          ?+=?( const          T *          &, ptrdiff_t );
     464forall( dtype T | sized(T) ) const T *          ?+=?( const          T * volatile &, ptrdiff_t );
     465forall( dtype T | sized(T) ) volatile T *               ?+=?(       volatile T *          &, ptrdiff_t );
     466forall( dtype T | sized(T) ) volatile T *               ?+=?(       volatile T * volatile &, ptrdiff_t );
     467forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T *          &, ptrdiff_t );
     468forall( dtype T | sized(T) ) const volatile T * ?+=?( const volatile T * volatile &, ptrdiff_t );
     469forall( dtype T | sized(T) ) T *                        ?-=?(                T *          &, ptrdiff_t );
     470forall( dtype T | sized(T) ) T *                        ?-=?(                T * volatile &, ptrdiff_t );
     471forall( dtype T | sized(T) ) const T *          ?-=?( const          T *          &, ptrdiff_t );
     472forall( dtype T | sized(T) ) const T *          ?-=?( const          T * volatile &, ptrdiff_t );
     473forall( dtype T | sized(T) ) volatile T *               ?-=?(       volatile T *          &, ptrdiff_t );
     474forall( dtype T | sized(T) ) volatile T *               ?-=?(       volatile T * volatile &, ptrdiff_t );
     475forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T *          &, ptrdiff_t );
     476forall( dtype T | sized(T) ) const volatile T * ?-=?( const volatile T * volatile &, ptrdiff_t );
     477
     478_Bool                   ?=?( _Bool &, _Bool ),                                  ?=?( volatile _Bool &, _Bool );
     479char                    ?=?( char &, char ),                                    ?=?( volatile char &, char );
     480char signed             ?=?( char signed &, char signed ),                      ?=?( volatile char signed &, char signed );
     481char unsigned           ?=?( char unsigned &, char unsigned ),                  ?=?( volatile char unsigned &, char unsigned );
     482int short               ?=?( int short &, int short ),                          ?=?( volatile int short &, int short );
     483int short unsigned      ?=?( int short unsigned &, int short unsigned ),        ?=?( volatile int short unsigned &, int short unsigned );
     484signed int              ?=?( signed int &, signed int ),                        ?=?( volatile signed int &, signed int );
     485unsigned int            ?=?( unsigned &, unsigned ),                            ?=?( volatile unsigned &, unsigned );
     486signed long int         ?=?( signed long int &, signed long int ),              ?=?( volatile signed long int &, signed long int );
     487unsigned long int       ?=?( unsigned long int &, unsigned long int ),          ?=?( volatile unsigned long int &, unsigned long int );
     488signed long long int    ?=?( signed long long int &, signed long long int ),    ?=?( volatile signed long long int &, signed long long int );
     489unsigned long long int  ?=?( unsigned long long int &, unsigned long long int ), ?=?( volatile unsigned long long int &, unsigned long long int );
     490zero_t          ?=?( zero_t &, zero_t );
     491one_t                   ?=?( one_t &, one_t );
     492
     493
     494_Bool                   ?*=?( _Bool &, _Bool ),                                 ?*=?( volatile _Bool &, _Bool );
     495char                    ?*=?( char &, char ),                                   ?*=?( volatile char &, char );
     496char signed             ?*=?( char signed &, char signed ),                     ?*=?( volatile char signed &, char signed );
     497char unsigned           ?*=?( char unsigned &, char unsigned ),                 ?*=?( volatile char unsigned &, char unsigned );
     498int short               ?*=?( int short &, int short ),                         ?*=?( volatile int short &, int short );
     499int short unsigned      ?*=?( int short unsigned &, int short unsigned ),       ?*=?( volatile int short unsigned &, int short unsigned );
     500signed int              ?*=?( signed int &, signed int ),                       ?*=?( volatile signed int &, signed int );
     501unsigned int            ?*=?( unsigned &, unsigned ),                           ?*=?( volatile unsigned &, unsigned );
     502signed long int         ?*=?( signed long int &, signed long int ),             ?*=?( volatile signed long int &, signed long int );
     503unsigned long int       ?*=?( unsigned long int &, unsigned long int ),         ?*=?( volatile unsigned long int &, unsigned long int );
     504signed long long int    ?*=?( signed long long int &, signed long long int ),   ?*=?( volatile signed long long int &, signed long long int );
     505unsigned 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 );
     508char                    ?/=?( char &, char ),                                   ?/=?( volatile char &, char );
     509char signed             ?/=?( char signed &, char signed ),                     ?/=?( volatile char signed &, char signed );
     510char unsigned           ?/=?( char unsigned &, char unsigned ),                 ?/=?( volatile char unsigned &, char unsigned );
     511int short               ?/=?( int short &, int short ),                         ?/=?( volatile int short &, int short );
     512int short unsigned      ?/=?( int short unsigned &, int short unsigned ),       ?/=?( volatile int short unsigned &, int short unsigned );
     513signed int              ?/=?( signed int &, signed int ),                       ?/=?( volatile signed int &, signed int );
     514unsigned int            ?/=?( unsigned &, unsigned ),                           ?/=?( volatile unsigned &, unsigned );
     515signed long int         ?/=?( signed long int &, signed long int ),             ?/=?( volatile signed long int &, signed long int );
     516unsigned long int       ?/=?( unsigned long int &, unsigned long int ),         ?/=?( volatile unsigned long int &, unsigned long int );
     517signed long long int    ?/=?( signed long long int &, signed long long int ),   ?/=?( volatile signed long long int &, signed long long int );
     518unsigned 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 );
     521char                    ?%=?( char &, char ),                                   ?%=?( volatile char &, char );
     522char signed             ?%=?( char signed &, char signed ),                     ?%=?( volatile char signed &, char signed );
     523char unsigned           ?%=?( char unsigned &, char unsigned ),                 ?%=?( volatile char unsigned &, char unsigned );
     524int short               ?%=?( int short &, int short ),                         ?%=?( volatile int short &, int short );
     525int short unsigned      ?%=?( int short unsigned &, int short unsigned ),       ?%=?( volatile int short unsigned &, int short unsigned );
     526signed int              ?%=?( signed int &, signed int ),                       ?%=?( volatile signed int &, signed int );
     527unsigned int            ?%=?( unsigned &, unsigned ),                           ?%=?( volatile unsigned &, unsigned );
     528signed long int         ?%=?( signed long int &, signed long int ),             ?%=?( volatile signed long int &, signed long int );
     529unsigned long int       ?%=?( unsigned long int &, unsigned long int ),         ?%=?( volatile unsigned long int &, unsigned long int );
     530signed long long int    ?%=?( signed long long int &, signed long long int ),   ?%=?( volatile signed long long int &, signed long long int );
     531unsigned 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 );
     534char                    ?+=?( char &, char ),                                   ?+=?( volatile char &, char );
     535char signed             ?+=?( char signed &, char signed ),                     ?+=?( volatile char signed &, char signed );
     536char unsigned           ?+=?( char unsigned &, char unsigned ),                 ?+=?( volatile char unsigned &, char unsigned );
     537int short               ?+=?( int short &, int short ),                         ?+=?( volatile int short &, int short );
     538int short unsigned      ?+=?( int short unsigned &, int short unsigned ),       ?+=?( volatile int short unsigned &, int short unsigned );
     539signed int              ?+=?( signed int &, signed int ),                       ?+=?( volatile signed int &, signed int );
     540unsigned int            ?+=?( unsigned &, unsigned ),                           ?+=?( volatile unsigned &, unsigned );
     541signed long int         ?+=?( signed long int &, signed long int ),             ?+=?( volatile signed long int &, signed long int );
     542unsigned long int       ?+=?( unsigned long int &, unsigned long int ),         ?+=?( volatile unsigned long int &, unsigned long int );
     543signed long long int    ?+=?( signed long long int &, signed long long int ),   ?+=?( volatile signed long long int &, signed long long int );
     544unsigned 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 );
     547char                    ?-=?( char &, char ),                                   ?-=?( volatile char &, char );
     548char signed             ?-=?( char signed &, char signed ),                     ?-=?( volatile char signed &, char signed );
     549char unsigned           ?-=?( char unsigned &, char unsigned ),                 ?-=?( volatile char unsigned &, char unsigned );
     550int short               ?-=?( int short &, int short ),                         ?-=?( volatile int short &, int short );
     551int short unsigned      ?-=?( int short unsigned &, int short unsigned ),       ?-=?( volatile int short unsigned &, int short unsigned );
     552signed int              ?-=?( signed int &, signed int ),                       ?-=?( volatile signed int &, signed int );
     553unsigned int            ?-=?( unsigned &, unsigned ),                           ?-=?( volatile unsigned &, unsigned );
     554signed long int         ?-=?( signed long int &, signed long int ),             ?-=?( volatile signed long int &, signed long int );
     555unsigned long int       ?-=?( unsigned long int &, unsigned long int ),         ?-=?( volatile unsigned long int &, unsigned long int );
     556signed long long int    ?-=?( signed long long int &, signed long long int ),   ?-=?( volatile signed long long int &, signed long long int );
     557unsigned 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 );
     560char                    ?<<=?( char &, char ),                                  ?<<=?( volatile char &, char );
     561char signed             ?<<=?( char signed &, char signed ),                    ?<<=?( volatile char signed &, char signed );
     562char unsigned           ?<<=?( char unsigned &, char unsigned ),                ?<<=?( volatile char unsigned &, char unsigned );
     563int short               ?<<=?( int short &, int short ),                        ?<<=?( volatile int short &, int short );
     564int short unsigned      ?<<=?( int short unsigned &, int short unsigned ),      ?<<=?( volatile int short unsigned &, int short unsigned );
     565signed int              ?<<=?( signed int &, signed int ),                      ?<<=?( volatile signed int &, signed int );
     566unsigned int            ?<<=?( unsigned &, unsigned ),                          ?<<=?( volatile unsigned &, unsigned );
     567signed long int         ?<<=?( signed long int &, signed long int ),            ?<<=?( volatile signed long int &, signed long int );
     568unsigned long int       ?<<=?( unsigned long int &, unsigned long int ),        ?<<=?( volatile unsigned long int &, unsigned long int );
     569signed long long int    ?<<=?( signed long long int &, signed long long int ),  ?<<=?( volatile signed long long int &, signed long long int );
     570unsigned 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 );
     573char                    ?>>=?( char &, char ),                                  ?>>=?( volatile char &, char );
     574char signed             ?>>=?( char signed &, char signed ),                    ?>>=?( volatile char signed &, char signed );
     575char unsigned           ?>>=?( char unsigned &, char unsigned ),                ?>>=?( volatile char unsigned &, char unsigned );
     576int short               ?>>=?( int short &, int short ),                        ?>>=?( volatile int short &, int short );
     577int short unsigned      ?>>=?( int short unsigned &, int short unsigned ),      ?>>=?( volatile int short unsigned &, int short unsigned );
     578signed int              ?>>=?( signed int &, signed int ),                      ?>>=?( volatile signed int &, signed int );
     579unsigned int            ?>>=?( unsigned &, unsigned ),                          ?>>=?( volatile unsigned &, unsigned );
     580signed long int         ?>>=?( signed long int &, signed long int ),            ?>>=?( volatile signed long int &, signed long int );
     581unsigned long int       ?>>=?( unsigned long int &, unsigned long int ),        ?>>=?( volatile unsigned long int &, unsigned long int );
     582signed long long int    ?>>=?( signed long long int &, signed long long int ),  ?>>=?( volatile signed long long int &, signed long long int );
     583unsigned 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 );
     586char                    ?&=?( char &, char ),                                   ?&=?( volatile char &, char );
     587char signed             ?&=?( char signed &, char signed ),                     ?&=?( volatile char signed &, char signed );
     588char unsigned           ?&=?( char unsigned &, char unsigned ),                 ?&=?( volatile char unsigned &, char unsigned );
     589int short               ?&=?( int short &, int short ),                         ?&=?( volatile int short &, int short );
     590int short unsigned      ?&=?( int short unsigned &, int short unsigned ),       ?&=?( volatile int short unsigned &, int short unsigned );
     591signed int              ?&=?( signed int &, signed int ),                       ?&=?( volatile signed int &, signed int );
     592unsigned int            ?&=?( unsigned &, unsigned ),                           ?&=?( volatile unsigned &, unsigned );
     593signed long int         ?&=?( signed long int &, signed long int ),             ?&=?( volatile signed long int &, signed long int );
     594unsigned long int       ?&=?( unsigned long int &, unsigned long int ),         ?&=?( volatile unsigned long int &, unsigned long int );
     595signed long long int    ?&=?( signed long long int &, signed long long int ),   ?&=?( volatile signed long long int &, signed long long int );
     596unsigned 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 );
     599char                    ?|=?( char &, char ),                                   ?|=?( volatile char &, char );
     600char signed             ?|=?( char signed &, char signed ),                     ?|=?( volatile char signed &, char signed );
     601char unsigned           ?|=?( char unsigned &, char unsigned ),                 ?|=?( volatile char unsigned &, char unsigned );
     602int short               ?|=?( int short &, int short ),                         ?|=?( volatile int short &, int short );
     603int short unsigned      ?|=?( int short unsigned &, int short unsigned ),       ?|=?( volatile int short unsigned &, int short unsigned );
     604signed int              ?|=?( signed int &, signed int ),                       ?|=?( volatile signed int &, signed int );
     605unsigned int            ?|=?( unsigned &, unsigned ),                           ?|=?( volatile unsigned &, unsigned );
     606signed long int         ?|=?( signed long int &, signed long int ),             ?|=?( volatile signed long int &, signed long int );
     607unsigned long int       ?|=?( unsigned long int &, unsigned long int ),         ?|=?( volatile unsigned long int &, unsigned long int );
     608signed long long int    ?|=?( signed long long int &, signed long long int ),   ?|=?( volatile signed long long int &, signed long long int );
     609unsigned 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 );
     612char                    ?^=?( char &, char ),                                   ?^=?( volatile char &, char );
     613char signed             ?^=?( char signed &, char signed ),                     ?^=?( volatile char signed &, char signed );
     614char unsigned           ?^=?( char unsigned &, char unsigned ),                 ?^=?( volatile char unsigned &, char unsigned );
     615int short               ?^=?( int short &, int short ),                         ?^=?( volatile int short &, int short );
     616int short unsigned      ?^=?( int short unsigned &, int short unsigned ),       ?^=?( volatile int short unsigned &, int short unsigned );
     617signed int              ?^=?( signed int &, signed int ),                       ?^=?( volatile signed int &, signed int );
     618unsigned int            ?^=?( unsigned &, unsigned ),                           ?^=?( volatile unsigned &, unsigned );
     619signed long int         ?^=?( signed long int &, signed long int ),             ?^=?( volatile signed long int &, signed long int );
     620unsigned long int       ?^=?( unsigned long int &, unsigned long int ),         ?^=?( volatile unsigned long int &, unsigned long int );
     621signed long long int    ?^=?( signed long long int &, signed long long int ),   ?^=?( volatile signed long long int &, signed long long int );
     622unsigned long long int  ?^=?( unsigned long long int &, unsigned long long int ), ?^=?( volatile unsigned long long int &, unsigned long long int );
     623
     624float                   ?=?(  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
     630double                  ?=?(  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
     636long 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
     642float _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
     648double _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
     654long 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 );
    659659
    660660
     
    669669
    670670// 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 * );
     671void    ?{}( _Bool & );
     672void    ?{}( char & );
     673void    ?{}( unsigned char & );
     674void    ?{}( char signed & );
     675void    ?{}( int short & );
     676void    ?{}( int short unsigned & );
     677void    ?{}( signed int & );
     678void    ?{}( unsigned int & );
     679void    ?{}( signed long int & );
     680void    ?{}( unsigned long int & );
     681void    ?{}( signed long long int & );
     682void    ?{}( unsigned long long int & );
     683void    ?{}( float & );
     684void    ?{}( double & );
     685void    ?{}( long double & );
     686void    ?{}( float _Complex & );
     687void    ?{}( double _Complex & );
     688void    ?{}( long double _Complex & );
     689void    ?{}( zero_t & );
     690void    ?{}( one_t & );
    691691
    692692// 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 );
     693void    ?{}( _Bool &, _Bool );
     694void    ?{}( char &, char );
     695void    ?{}( unsigned char &, unsigned char );
     696void    ?{}( char signed &, char signed );
     697void    ?{}( int short &, int short );
     698void    ?{}( int short unsigned &, int short unsigned );
     699void    ?{}( signed int &, signed int);
     700void    ?{}( unsigned int &, unsigned int);
     701void    ?{}( signed long int &, signed long int);
     702void    ?{}( unsigned long int &, unsigned long int);
     703void    ?{}( signed long long int &, signed long long int);
     704void    ?{}( unsigned long long int &, unsigned long long int);
     705void    ?{}( float &, float);
     706void    ?{}( double &, double);
     707void    ?{}( long double &, long double);
     708void    ?{}( float _Complex &, float _Complex);
     709void    ?{}( double _Complex &, double _Complex);
     710void    ?{}( long double _Complex &, long double _Complex);
     711void    ?{}( zero_t &, zero_t );
     712void    ?{}( one_t &, one_t );
    713713
    714714// 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 * );
     715void    ^?{}( _Bool & );
     716void    ^?{}( char & );
     717void    ^?{}( char unsigned & );
     718void    ^?{}( char signed & );
     719void    ^?{}( int short & );
     720void    ^?{}( int short unsigned & );
     721void    ^?{}( signed int & );
     722void    ^?{}( unsigned int & );
     723void    ^?{}( signed long int & );
     724void    ^?{}( unsigned long int & );
     725void    ^?{}( signed long long int & );
     726void    ^?{}( unsigned long long int & );
     727void    ^?{}( float & );
     728void    ^?{}( double & );
     729void    ^?{}( long double & );
     730void    ^?{}( float _Complex & );
     731void    ^?{}( double _Complex & );
     732void    ^?{}( long double _Complex & );
     733void    ^?{}( zero_t & );
     734void    ^?{}( one_t & );
    735735
    736736// // default ctor
     
    754754// copied from assignment section
    755755// copy constructors
    756 forall( ftype FT ) void ?{}( FT **, FT * );
    757 forall( ftype FT ) void ?{}( FT * volatile *, FT * );
    758 
    759 forall( dtype DT ) void ?{}(                 DT *          *,                   DT * );
    760 forall( dtype DT ) void ?{}( const           DT *          *,                   DT * );
    761 forall( dtype DT ) void ?{}( const           DT *          *, const             DT * );
    762 forall( dtype DT ) void ?{}(       volatile  DT *          *,                   DT * );
    763 forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    DT * );
    764 
    765 forall( dtype DT ) void ?{}( const volatile  DT *          *,                   DT * );
    766 forall( dtype DT ) void ?{}( const volatile  DT *          *, const             DT * );
    767 forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    DT * );
    768 forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    DT * );
    769 
    770 forall( dtype DT ) void ?{}(                 DT *          *,                   void * );
    771 forall( dtype DT ) void ?{}( const           DT *          *,                   void * );
    772 forall( dtype DT ) void ?{}( const           DT *          *, const             void * );
    773 forall( dtype DT ) void ?{}(       volatile  DT *          *,                   void * );
    774 forall( dtype DT ) void ?{}(       volatile  DT *          *,       volatile    void * );
    775 
    776 forall( dtype DT ) void ?{}( const volatile  DT *          *,                   void * );
    777 forall( dtype DT ) void ?{}( const volatile  DT *          *, const             void * );
    778 forall( dtype DT ) void ?{}( const volatile  DT *          *,       volatile    void * );
    779 forall( dtype DT ) void ?{}( const volatile  DT *          *, const volatile    void * );
    780 
    781 forall( dtype DT ) void ?{}(                 void *          *,                 DT * );
    782 forall( dtype DT ) void ?{}( const           void *          *,                 DT * );
    783 forall( dtype DT ) void ?{}( const           void *          *, const           DT * );
    784 forall( dtype DT ) void ?{}(        volatile void *          *,                 DT * );
    785 forall( dtype DT ) void ?{}(        volatile void *          *,       volatile  DT * );
    786 forall( dtype DT ) void ?{}( const volatile void *           *,                 DT * );
    787 forall( dtype DT ) void ?{}( const volatile void *           *, const           DT * );
    788 forall( dtype DT ) void ?{}( const volatile void *           *,       volatile  DT * );
    789 forall( dtype DT ) void ?{}( const volatile void *           *, const volatile  DT * );
    790 
    791 void    ?{}(                void *          *,                void * );
    792 void    ?{}( const          void *          *,                void * );
    793 void    ?{}( const          void *          *, const          void * );
    794 void    ?{}(       volatile void *          *,                void * );
    795 void    ?{}(       volatile void *          *,       volatile void * );
    796 void    ?{}( const volatile void *          *,                void * );
    797 void    ?{}( const volatile void *          *, const          void * );
    798 void    ?{}( const volatile void *          *,       volatile void * );
    799 void    ?{}( const volatile void *          *, const volatile void * );
    800 
    801 // //forall( dtype DT ) void ?{}(                   DT *          *, zero_t );
    802 // //forall( dtype DT ) void ?{}(                   DT * volatile *, zero_t );
    803 // forall( dtype DT ) void ?{}( const       DT *          *, zero_t );
    804 // //forall( dtype DT ) void ?{}( volatile          DT *          *, zero_t );
    805 // //forall( dtype DT ) void ?{}( volatile          DT * volatile *, zero_t );
    806 // forall( dtype DT ) void ?{}( const volatile DT *       *, zero_t );
    807 
    808 // forall( ftype FT ) void      ?{}( FT *          *, zero_t );
     756forall( ftype FT ) void ?{}( FT *&, FT * );
     757forall( ftype FT ) void ?{}( FT * volatile &, FT * );
     758
     759forall( dtype DT ) void ?{}(                 DT *          &,                   DT * );
     760forall( dtype DT ) void ?{}( const           DT *          &,                   DT * );
     761forall( dtype DT ) void ?{}( const           DT *          &, const             DT * );
     762forall( dtype DT ) void ?{}(       volatile  DT *          &,                   DT * );
     763forall( dtype DT ) void ?{}(       volatile  DT *          &,       volatile    DT * );
     764
     765forall( dtype DT ) void ?{}( const volatile  DT *          &,                   DT * );
     766forall( dtype DT ) void ?{}( const volatile  DT *          &, const             DT * );
     767forall( dtype DT ) void ?{}( const volatile  DT *          &,       volatile    DT * );
     768forall( dtype DT ) void ?{}( const volatile  DT *          &, const volatile    DT * );
     769
     770forall( dtype DT ) void ?{}(                 DT *          &,                   void * );
     771forall( dtype DT ) void ?{}( const           DT *          &,                   void * );
     772forall( dtype DT ) void ?{}( const           DT *          &, const             void * );
     773forall( dtype DT ) void ?{}(       volatile  DT *          &,                   void * );
     774forall( dtype DT ) void ?{}(       volatile  DT *          &,       volatile    void * );
     775
     776forall( dtype DT ) void ?{}( const volatile  DT *          &,                   void * );
     777forall( dtype DT ) void ?{}( const volatile  DT *          &, const             void * );
     778forall( dtype DT ) void ?{}( const volatile  DT *          &,       volatile    void * );
     779forall( dtype DT ) void ?{}( const volatile  DT *          &, const volatile    void * );
     780
     781forall( dtype DT ) void ?{}(                 void *          &,                 DT * );
     782forall( dtype DT ) void ?{}( const           void *          &,                 DT * );
     783forall( dtype DT ) void ?{}( const           void *          &, const           DT * );
     784forall( dtype DT ) void ?{}(        volatile void *          &,                 DT * );
     785forall( dtype DT ) void ?{}(        volatile void *          &,       volatile  DT * );
     786forall( dtype DT ) void ?{}( const volatile void *           &,                 DT * );
     787forall( dtype DT ) void ?{}( const volatile void *           &, const           DT * );
     788forall( dtype DT ) void ?{}( const volatile void *           &,       volatile  DT * );
     789forall( dtype DT ) void ?{}( const volatile void *           &, const volatile  DT * );
     790
     791void    ?{}(                void *          &,                void * );
     792void    ?{}( const          void *          &,                void * );
     793void    ?{}( const          void *          &, const          void * );
     794void    ?{}(       volatile void *          &,                void * );
     795void    ?{}(       volatile void *          &,       volatile void * );
     796void    ?{}( const volatile void *          &,                void * );
     797void    ?{}( const volatile void *          &, const          void * );
     798void    ?{}( const volatile void *          &,       volatile void * );
     799void    ?{}( const volatile void *          &, const volatile void * );
     800
     801//forall( dtype DT ) void ?{}(              DT *          &, zero_t );
     802//forall( dtype DT ) void ?{}(              DT * volatile &, zero_t );
     803forall( 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 );
     806forall( dtype DT ) void ?{}( const volatile DT *          &, zero_t );
     807
     808forall( ftype FT ) void ?{}( FT *          &, forall( ftype FT2 ) FT2 * );
    809809
    810810// 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 *          *);
     811forall( ftype FT ) void ?{}( FT *          & );
     812
     813forall( dtype DT ) void ?{}(                 DT *          &);
     814forall( dtype DT ) void ?{}( const           DT *          &);
     815forall( dtype DT ) void ?{}(       volatile  DT *          &);
     816forall( dtype DT ) void ?{}( const volatile  DT *          &);
     817
     818void    ?{}(                void *          &);
     819void    ?{}( const          void *          &);
     820void    ?{}(       volatile void *          &);
     821void    ?{}( const volatile void *          &);
    822822
    823823// 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 *         *);
     824forall( ftype FT ) void ^?{}( FT *         & );
     825
     826forall( dtype DT ) void ^?{}(                DT *          &);
     827forall( dtype DT ) void ^?{}( const          DT *          &);
     828forall( dtype DT ) void ^?{}(      volatile  DT *          &);
     829forall( dtype DT ) void ^?{}( const volatile  DT *         &);
     830
     831void    ^?{}(               void *          &);
     832void    ^?{}( const         void *          &);
     833void    ^?{}(      volatile void *          &);
     834void    ^?{}( const volatile void *         &);
    835835
    836836// Local Variables: //
  • src/tests/.expect/64/KRfunctions.txt

    r54cd58b0 r9236060  
    1717    int __i__i_1;
    1818};
    19 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1);
    20 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1);
    21 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1);
    22 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1);
    23 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){
    24     ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))) /* ?{} */);
     19static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
     20static inline void ___constructor__F_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
     21static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
     22static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
     23static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
     24    ((void)((*___dst__R2sS_1).__i__i_1) /* ?{} */);
    2525}
    26 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){
    27     ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))=___src__2sS_1.__i__i_1) /* ?{} */);
     26static inline void ___constructor__F_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){
     27    ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1) /* ?{} */);
    2828}
    29 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){
    30     ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))) /* ^?{} */);
     29static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
     30    ((void)((*___dst__R2sS_1).__i__i_1) /* ^?{} */);
    3131}
    32 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){
     32static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){
    3333    struct S ___ret__2sS_1;
    34     ((void)((*___dst__P2sS_1).__i__i_1=___src__2sS_1.__i__i_1));
    35     ((void)___constructor__F_P2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
     34    ((void)((*___dst__R2sS_1).__i__i_1=___src__2sS_1.__i__i_1));
     35    ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
    3636    return ((struct S )___ret__2sS_1);
    3737}
    38 static inline void ___constructor__F_P2sSi_autogen___1(struct S *___dst__P2sS_1, int __i__i_1){
    39     ((void)((*((int *)(&(*___dst__P2sS_1).__i__i_1)))=__i__i_1) /* ?{} */);
     38static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, int __i__i_1){
     39    ((void)((*___dst__R2sS_1).__i__i_1=__i__i_1) /* ?{} */);
    4040}
    4141int __f3__Fi_2sS2sSPi__1(struct S __a__2sS_1, struct S __b__2sS_1, int *__c__Pi_1){
     
    8585    int __b__i_2;
    8686    int *(*_tmp_cp_ret0)(int __x__i_1, int __y__i_1);
    87     ((void)(__x__PFPi_ii__2=((_tmp_cp_ret0=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5)) , _tmp_cp_ret0)));
    88     ((void)((*((int *(**)(int __x__i_1, int __y__i_1))(&_tmp_cp_ret0)))) /* ^?{} */);
     87    ((void)(__x__PFPi_ii__2=(((void)(_tmp_cp_ret0=__f10__FPFPi_ii__iPiPid__1(3, (&__a__i_2), (&__b__i_2), 3.5))) , _tmp_cp_ret0)));
     88    ((void)(_tmp_cp_ret0) /* ^?{} */);
    8989    const int __f1__FCi_iPiPi__2(int __a__i_2, int *__b__Pi_2, int *__c__Pi_2){
    9090        __attribute__ ((unused)) const int ___retval_f1__Ci_2;
  • src/tests/.expect/64/attributes.txt

    r54cd58b0 r9236060  
    1111__attribute__ ((unused)) struct __anonymous0 {
    1212};
    13 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1);
    14 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
    15 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1);
    16 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
    17 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){
    18 }
    19 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
    20 }
    21 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){
    22 }
    23 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
     13static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
     14static inline void ___constructor__F_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
     15static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
     16static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
     17static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){
     18}
     19static inline void ___constructor__F_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
     20}
     21static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){
     22}
     23static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
    2424    struct __anonymous0 ___ret__13s__anonymous0_1;
    25     ((void)___constructor__F_P13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
     25    ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
    2626    return ((struct __anonymous0 )___ret__13s__anonymous0_1);
    2727}
     
    2929__attribute__ ((unused)) struct Agn2 {
    3030};
    31 static inline void ___constructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1);
    32 static inline void ___constructor__F_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1);
    33 static inline void ___destructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1);
    34 static inline struct Agn2 ___operator_assign__F5sAgn2_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1);
    35 static inline void ___constructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1){
    36 }
    37 static inline void ___constructor__F_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1){
    38 }
    39 static inline void ___destructor__F_P5sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1){
    40 }
    41 static inline struct Agn2 ___operator_assign__F5sAgn2_P5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__P5sAgn2_1, struct Agn2 ___src__5sAgn2_1){
     31static inline void ___constructor__F_R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1);
     32static inline void ___constructor__F_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1);
     33static inline void ___destructor__F_R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1);
     34static inline struct Agn2 ___operator_assign__F5sAgn2_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1);
     35static inline void ___constructor__F_R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1){
     36}
     37static inline void ___constructor__F_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){
     38}
     39static inline void ___destructor__F_R5sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1){
     40}
     41static inline struct Agn2 ___operator_assign__F5sAgn2_R5sAgn25sAgn2_autogen___1(struct Agn2 *___dst__R5sAgn2_1, struct Agn2 ___src__5sAgn2_1){
    4242    struct Agn2 ___ret__5sAgn2_1;
    43     ((void)___constructor__F_P5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));
     43    ((void)___constructor__F_R5sAgn25sAgn2_autogen___1((&___ret__5sAgn2_1), ___src__5sAgn2_1));
    4444    return ((struct Agn2 )___ret__5sAgn2_1);
    4545}
     
    6565    __attribute__ ((unused,unused)) int *__f9__Pi_1;
    6666};
    67 static inline void ___constructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1);
    68 static inline void ___constructor__F_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1);
    69 static inline void ___destructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1);
    70 static inline struct Fdl ___operator_assign__F4sFdl_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1);
    71 static inline void ___constructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1){
    72     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))) /* ?{} */);
    73     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))) /* ?{} */);
    74     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ?{} */);
    75     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */);
    76     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */);
    77     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */);
    78     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    79     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    80     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    81 }
    82 static inline void ___constructor__F_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1){
    83     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=___src__4sFdl_1.__f1__i_1) /* ?{} */);
    84     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=___src__4sFdl_1.__f2__i_1) /* ?{} */);
    85     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=___src__4sFdl_1.__f3__i_1) /* ?{} */);
    86     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=___src__4sFdl_1.__f4__i_1) /* ?{} */);
    87     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=___src__4sFdl_1.__f5__i_1) /* ?{} */);
    88     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=___src__4sFdl_1.__f6__i_1) /* ?{} */);
    89     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=___src__4sFdl_1.__f7__i_1) /* ?{} */);
    90     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))=___src__4sFdl_1.__f8__i_1) /* ?{} */);
    91     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))=___src__4sFdl_1.__f9__Pi_1) /* ?{} */);
    92 }
    93 static inline void ___destructor__F_P4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1){
    94     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ^?{} */);
    95     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ^?{} */);
    96     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ^?{} */);
    97     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ^?{} */);
    98     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ^?{} */);
    99     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ^?{} */);
    100     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ^?{} */);
    101     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))) /* ^?{} */);
    102     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))) /* ^?{} */);
    103 }
    104 static inline struct Fdl ___operator_assign__F4sFdl_P4sFdl4sFdl_autogen___1(struct Fdl *___dst__P4sFdl_1, struct Fdl ___src__4sFdl_1){
     67static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);
     68static inline void ___constructor__F_R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1);
     69static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1);
     70static inline struct Fdl ___operator_assign__F4sFdl_R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1);
     71static inline void ___constructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){
     72    ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ?{} */);
     73    ((void)((*___dst__R4sFdl_1).__f2__i_1) /* ?{} */);
     74    ((void)((*___dst__R4sFdl_1).__f3__i_1) /* ?{} */);
     75    ((void)((*___dst__R4sFdl_1).__f4__i_1) /* ?{} */);
     76    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
     77    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
     78    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     79    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     80    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     81}
     82static inline void ___constructor__F_R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1){
     83    ((void)((*___dst__R4sFdl_1).__f1__i_1=___src__4sFdl_1.__f1__i_1) /* ?{} */);
     84    ((void)((*___dst__R4sFdl_1).__f2__i_1=___src__4sFdl_1.__f2__i_1) /* ?{} */);
     85    ((void)((*___dst__R4sFdl_1).__f3__i_1=___src__4sFdl_1.__f3__i_1) /* ?{} */);
     86    ((void)((*___dst__R4sFdl_1).__f4__i_1=___src__4sFdl_1.__f4__i_1) /* ?{} */);
     87    ((void)((*___dst__R4sFdl_1).__f5__i_1=___src__4sFdl_1.__f5__i_1) /* ?{} */);
     88    ((void)((*___dst__R4sFdl_1).__f6__i_1=___src__4sFdl_1.__f6__i_1) /* ?{} */);
     89    ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1) /* ?{} */);
     90    ((void)((*___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1) /* ?{} */);
     91    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1) /* ?{} */);
     92}
     93static inline void ___destructor__F_R4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1){
     94    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ^?{} */);
     95    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ^?{} */);
     96    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ^?{} */);
     97    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ^?{} */);
     98    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ^?{} */);
     99    ((void)((*___dst__R4sFdl_1).__f4__i_1) /* ^?{} */);
     100    ((void)((*___dst__R4sFdl_1).__f3__i_1) /* ^?{} */);
     101    ((void)((*___dst__R4sFdl_1).__f2__i_1) /* ^?{} */);
     102    ((void)((*___dst__R4sFdl_1).__f1__i_1) /* ^?{} */);
     103}
     104static inline struct Fdl ___operator_assign__F4sFdl_R4sFdl4sFdl_autogen___1(struct Fdl *___dst__R4sFdl_1, struct Fdl ___src__4sFdl_1){
    105105    struct Fdl ___ret__4sFdl_1;
    106     ((void)((*___dst__P4sFdl_1).__f1__i_1=___src__4sFdl_1.__f1__i_1));
    107     ((void)((*___dst__P4sFdl_1).__f2__i_1=___src__4sFdl_1.__f2__i_1));
    108     ((void)((*___dst__P4sFdl_1).__f3__i_1=___src__4sFdl_1.__f3__i_1));
    109     ((void)((*___dst__P4sFdl_1).__f4__i_1=___src__4sFdl_1.__f4__i_1));
    110     ((void)((*___dst__P4sFdl_1).__f5__i_1=___src__4sFdl_1.__f5__i_1));
    111     ((void)((*___dst__P4sFdl_1).__f6__i_1=___src__4sFdl_1.__f6__i_1));
    112     ((void)((*___dst__P4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1));
    113     ((void)((*___dst__P4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1));
    114     ((void)((*___dst__P4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1));
    115     ((void)___constructor__F_P4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));
     106    ((void)((*___dst__R4sFdl_1).__f1__i_1=___src__4sFdl_1.__f1__i_1));
     107    ((void)((*___dst__R4sFdl_1).__f2__i_1=___src__4sFdl_1.__f2__i_1));
     108    ((void)((*___dst__R4sFdl_1).__f3__i_1=___src__4sFdl_1.__f3__i_1));
     109    ((void)((*___dst__R4sFdl_1).__f4__i_1=___src__4sFdl_1.__f4__i_1));
     110    ((void)((*___dst__R4sFdl_1).__f5__i_1=___src__4sFdl_1.__f5__i_1));
     111    ((void)((*___dst__R4sFdl_1).__f6__i_1=___src__4sFdl_1.__f6__i_1));
     112    ((void)((*___dst__R4sFdl_1).__f7__i_1=___src__4sFdl_1.__f7__i_1));
     113    ((void)((*___dst__R4sFdl_1).__f8__i_1=___src__4sFdl_1.__f8__i_1));
     114    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=___src__4sFdl_1.__f9__Pi_1));
     115    ((void)___constructor__F_R4sFdl4sFdl_autogen___1((&___ret__4sFdl_1), ___src__4sFdl_1));
    116116    return ((struct Fdl )___ret__4sFdl_1);
    117117}
    118 static inline void ___constructor__F_P4sFdli_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1){
    119     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    120     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))) /* ?{} */);
    121     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ?{} */);
    122     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */);
    123     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */);
    124     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */);
    125     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    126     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    127     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    128 }
    129 static inline void ___constructor__F_P4sFdlii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1){
    130     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    131     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    132     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))) /* ?{} */);
    133     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */);
    134     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */);
    135     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */);
    136     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    137     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    138     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    139 }
    140 static inline void ___constructor__F_P4sFdliii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1){
    141     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    142     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    143     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    144     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))) /* ?{} */);
    145     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */);
    146     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */);
    147     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    148     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    149     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    150 }
    151 static inline void ___constructor__F_P4sFdliiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1){
    152     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    153     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    154     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    155     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */);
    156     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))) /* ?{} */);
    157     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */);
    158     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    159     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    160     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    161 }
    162 static inline void ___constructor__F_P4sFdliiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1){
    163     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    164     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    165     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    166     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */);
    167     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */);
    168     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))) /* ?{} */);
    169     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    170     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    171     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    172 }
    173 static inline void ___constructor__F_P4sFdliiiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1){
    174     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    175     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    176     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    177     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */);
    178     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */);
    179     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */);
    180     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))) /* ?{} */);
    181     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    182     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    183 }
    184 static inline void ___constructor__F_P4sFdliiiiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1){
    185     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    186     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    187     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    188     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */);
    189     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */);
    190     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */);
    191     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=__f7__i_1) /* ?{} */);
    192     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))) /* ?{} */);
    193     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    194 }
    195 static inline void ___constructor__F_P4sFdliiiiiiii_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1){
    196     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    197     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    198     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    199     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */);
    200     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */);
    201     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */);
    202     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=__f7__i_1) /* ?{} */);
    203     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))=__f8__i_1) /* ?{} */);
    204     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))) /* ?{} */);
    205 }
    206 static inline void ___constructor__F_P4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__P4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1, int *__f9__Pi_1){
    207     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f1__i_1)))=__f1__i_1) /* ?{} */);
    208     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f2__i_1)))=__f2__i_1) /* ?{} */);
    209     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f3__i_1)))=__f3__i_1) /* ?{} */);
    210     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f4__i_1)))=__f4__i_1) /* ?{} */);
    211     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f5__i_1)))=__f5__i_1) /* ?{} */);
    212     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f6__i_1)))=__f6__i_1) /* ?{} */);
    213     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f7__i_1)))=__f7__i_1) /* ?{} */);
    214     ((void)((*((int *)(&(*___dst__P4sFdl_1).__f8__i_1)))=__f8__i_1) /* ?{} */);
    215     ((void)((*((int **)(&(*___dst__P4sFdl_1).__f9__Pi_1)))=__f9__Pi_1) /* ?{} */);
     118static inline void ___constructor__F_R4sFdli_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1){
     119    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     120    ((void)((*___dst__R4sFdl_1).__f2__i_1) /* ?{} */);
     121    ((void)((*___dst__R4sFdl_1).__f3__i_1) /* ?{} */);
     122    ((void)((*___dst__R4sFdl_1).__f4__i_1) /* ?{} */);
     123    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
     124    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
     125    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     126    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     127    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     128}
     129static inline void ___constructor__F_R4sFdlii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1){
     130    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     131    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     132    ((void)((*___dst__R4sFdl_1).__f3__i_1) /* ?{} */);
     133    ((void)((*___dst__R4sFdl_1).__f4__i_1) /* ?{} */);
     134    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
     135    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
     136    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     137    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     138    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     139}
     140static inline void ___constructor__F_R4sFdliii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1){
     141    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     142    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     143    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     144    ((void)((*___dst__R4sFdl_1).__f4__i_1) /* ?{} */);
     145    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
     146    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
     147    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     148    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     149    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     150}
     151static inline void ___constructor__F_R4sFdliiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1){
     152    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     153    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     154    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     155    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
     156    ((void)((*___dst__R4sFdl_1).__f5__i_1) /* ?{} */);
     157    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
     158    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     159    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     160    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     161}
     162static inline void ___constructor__F_R4sFdliiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1){
     163    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     164    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     165    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     166    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
     167    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
     168    ((void)((*___dst__R4sFdl_1).__f6__i_1) /* ?{} */);
     169    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     170    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     171    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     172}
     173static inline void ___constructor__F_R4sFdliiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1){
     174    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     175    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     176    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     177    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
     178    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
     179    ((void)((*___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
     180    ((void)((*___dst__R4sFdl_1).__f7__i_1) /* ?{} */);
     181    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     182    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     183}
     184static inline void ___constructor__F_R4sFdliiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1){
     185    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     186    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     187    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     188    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
     189    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
     190    ((void)((*___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
     191    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
     192    ((void)((*___dst__R4sFdl_1).__f8__i_1) /* ?{} */);
     193    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     194}
     195static inline void ___constructor__F_R4sFdliiiiiiii_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1){
     196    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     197    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     198    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     199    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
     200    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
     201    ((void)((*___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
     202    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
     203    ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
     204    ((void)((*___dst__R4sFdl_1).__f9__Pi_1) /* ?{} */);
     205}
     206static inline void ___constructor__F_R4sFdliiiiiiiiPi_autogen___1(struct Fdl *___dst__R4sFdl_1, int __f1__i_1, int __f2__i_1, int __f3__i_1, int __f4__i_1, int __f5__i_1, int __f6__i_1, int __f7__i_1, int __f8__i_1, int *__f9__Pi_1){
     207    ((void)((*___dst__R4sFdl_1).__f1__i_1=__f1__i_1) /* ?{} */);
     208    ((void)((*___dst__R4sFdl_1).__f2__i_1=__f2__i_1) /* ?{} */);
     209    ((void)((*___dst__R4sFdl_1).__f3__i_1=__f3__i_1) /* ?{} */);
     210    ((void)((*___dst__R4sFdl_1).__f4__i_1=__f4__i_1) /* ?{} */);
     211    ((void)((*___dst__R4sFdl_1).__f5__i_1=__f5__i_1) /* ?{} */);
     212    ((void)((*___dst__R4sFdl_1).__f6__i_1=__f6__i_1) /* ?{} */);
     213    ((void)((*___dst__R4sFdl_1).__f7__i_1=__f7__i_1) /* ?{} */);
     214    ((void)((*___dst__R4sFdl_1).__f8__i_1=__f8__i_1) /* ?{} */);
     215    ((void)((*___dst__R4sFdl_1).__f9__Pi_1=__f9__Pi_1) /* ?{} */);
    216216}
    217217__attribute__ ((unused)) int __f__Fi___1() asm ( "xyz" );
     
    288288        int __i__i_2;
    289289    };
    290     inline void ___constructor__F_P13s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2){
    291         ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))) /* ?{} */);
    292     }
    293     inline void ___constructor__F_P13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){
    294         ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))=___src__13s__anonymous4_2.__i__i_2) /* ?{} */);
    295     }
    296     inline void ___destructor__F_P13s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2){
    297         ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))) /* ^?{} */);
    298     }
    299     inline struct __anonymous4 ___operator_assign__F13s__anonymous4_P13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){
     290    inline void ___constructor__F_R13s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2){
     291        ((void)((*___dst__R13s__anonymous4_2).__i__i_2) /* ?{} */);
     292    }
     293    inline void ___constructor__F_R13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){
     294        ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2) /* ?{} */);
     295    }
     296    inline void ___destructor__F_R13s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2){
     297        ((void)((*___dst__R13s__anonymous4_2).__i__i_2) /* ^?{} */);
     298    }
     299    inline struct __anonymous4 ___operator_assign__F13s__anonymous4_R13s__anonymous413s__anonymous4_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, struct __anonymous4 ___src__13s__anonymous4_2){
    300300        struct __anonymous4 ___ret__13s__anonymous4_2;
    301         ((void)((*___dst__P13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2));
    302         ((void)___constructor__F_P13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2));
     301        ((void)((*___dst__R13s__anonymous4_2).__i__i_2=___src__13s__anonymous4_2.__i__i_2));
     302        ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___2((&___ret__13s__anonymous4_2), ___src__13s__anonymous4_2));
    303303        return ((struct __anonymous4 )___ret__13s__anonymous4_2);
    304304    }
    305     inline void ___constructor__F_P13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__P13s__anonymous4_2, int __i__i_2){
    306         ((void)((*((int *)(&(*___dst__P13s__anonymous4_2).__i__i_2)))=__i__i_2) /* ?{} */);
     305    inline void ___constructor__F_R13s__anonymous4i_autogen___2(struct __anonymous4 *___dst__R13s__anonymous4_2, int __i__i_2){
     306        ((void)((*___dst__R13s__anonymous4_2).__i__i_2=__i__i_2) /* ?{} */);
    307307    }
    308308    ((void)sizeof(struct __anonymous4 ));
     
    310310        __R__C13e__anonymous5_2,
    311311    };
    312     inline void ___constructor__F_P13e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2){
    313     }
    314     inline void ___constructor__F_P13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
    315         ((void)((*___dst__P13e__anonymous5_2)=___src__13e__anonymous5_2));
    316     }
    317     inline void ___destructor__F_P13e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2){
    318     }
    319     inline enum __anonymous5 ___operator_assign__F13e__anonymous5_P13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__P13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
     312    inline void ___constructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){
     313    }
     314    inline void ___constructor__F_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
     315        ((void)((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2));
     316    }
     317    inline void ___destructor__F_R13e__anonymous5_intrinsic___2(__attribute__ ((unused)) enum __anonymous5 *___dst__R13e__anonymous5_2){
     318    }
     319    inline enum __anonymous5 ___operator_assign__F13e__anonymous5_R13e__anonymous513e__anonymous5_intrinsic___2(enum __anonymous5 *___dst__R13e__anonymous5_2, enum __anonymous5 ___src__13e__anonymous5_2){
    320320        enum __anonymous5 ___ret__13e__anonymous5_2;
    321         ((void)(___ret__13e__anonymous5_2=((*___dst__P13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */);
     321        ((void)(___ret__13e__anonymous5_2=((*___dst__R13e__anonymous5_2)=___src__13e__anonymous5_2)) /* ?{} */);
    322322        return ((enum __anonymous5 )___ret__13e__anonymous5_2);
    323323    }
     
    337337    __attribute__ ((unused,unused)) int (*__anonymous_object31)();
    338338};
    339 static inline void ___constructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1);
    340 static inline void ___constructor__F_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1);
    341 static inline void ___destructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1);
    342 static inline struct Vad ___operator_assign__F4sVad_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1);
    343 static inline void ___constructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1){
    344 }
    345 static inline void ___constructor__F_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1){
    346 }
    347 static inline void ___destructor__F_P4sVad_autogen___1(struct Vad *___dst__P4sVad_1){
    348 }
    349 static inline struct Vad ___operator_assign__F4sVad_P4sVad4sVad_autogen___1(struct Vad *___dst__P4sVad_1, struct Vad ___src__4sVad_1){
     339static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
     340static inline void ___constructor__F_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1);
     341static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1);
     342static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1);
     343static inline void ___constructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){
     344}
     345static inline void ___constructor__F_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){
     346}
     347static inline void ___destructor__F_R4sVad_autogen___1(struct Vad *___dst__R4sVad_1){
     348}
     349static inline struct Vad ___operator_assign__F4sVad_R4sVad4sVad_autogen___1(struct Vad *___dst__R4sVad_1, struct Vad ___src__4sVad_1){
    350350    struct Vad ___ret__4sVad_1;
    351     ((void)___constructor__F_P4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1));
     351    ((void)___constructor__F_R4sVad4sVad_autogen___1((&___ret__4sVad_1), ___src__4sVad_1));
    352352    return ((struct Vad )___ret__4sVad_1);
    353353}
  • src/tests/.expect/64/declarationSpecifier.txt

    r54cd58b0 r9236060  
    1616    int __i__i_1;
    1717};
    18 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1);
    19 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
    20 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1);
    21 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
    22 static inline void ___constructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){
    23     ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))) /* ?{} */);
    24 }
    25 static inline void ___constructor__F_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
    26     ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))=___src__13s__anonymous0_1.__i__i_1) /* ?{} */);
    27 }
    28 static inline void ___destructor__F_P13s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1){
    29     ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))) /* ^?{} */);
    30 }
    31 static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_P13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
     18static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
     19static inline void ___constructor__F_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
     20static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1);
     21static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1);
     22static inline void ___constructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){
     23    ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ?{} */);
     24}
     25static inline void ___constructor__F_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
     26    ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1) /* ?{} */);
     27}
     28static inline void ___destructor__F_R13s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1){
     29    ((void)((*___dst__R13s__anonymous0_1).__i__i_1) /* ^?{} */);
     30}
     31static inline struct __anonymous0 ___operator_assign__F13s__anonymous0_R13s__anonymous013s__anonymous0_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, struct __anonymous0 ___src__13s__anonymous0_1){
    3232    struct __anonymous0 ___ret__13s__anonymous0_1;
    33     ((void)((*___dst__P13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1));
    34     ((void)___constructor__F_P13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
     33    ((void)((*___dst__R13s__anonymous0_1).__i__i_1=___src__13s__anonymous0_1.__i__i_1));
     34    ((void)___constructor__F_R13s__anonymous013s__anonymous0_autogen___1((&___ret__13s__anonymous0_1), ___src__13s__anonymous0_1));
    3535    return ((struct __anonymous0 )___ret__13s__anonymous0_1);
    3636}
    37 static inline void ___constructor__F_P13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__P13s__anonymous0_1, int __i__i_1){
    38     ((void)((*((int *)(&(*___dst__P13s__anonymous0_1).__i__i_1)))=__i__i_1) /* ?{} */);
     37static inline void ___constructor__F_R13s__anonymous0i_autogen___1(struct __anonymous0 *___dst__R13s__anonymous0_1, int __i__i_1){
     38    ((void)((*___dst__R13s__anonymous0_1).__i__i_1=__i__i_1) /* ?{} */);
    3939}
    4040volatile const struct __anonymous0 __x10__CV13s__anonymous0_1;
     
    4242    int __i__i_1;
    4343};
    44 static inline void ___constructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1);
    45 static inline void ___constructor__F_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);
    46 static inline void ___destructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1);
    47 static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);
    48 static inline void ___constructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1){
    49     ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))) /* ?{} */);
    50 }
    51 static inline void ___constructor__F_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){
    52     ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))=___src__13s__anonymous1_1.__i__i_1) /* ?{} */);
    53 }
    54 static inline void ___destructor__F_P13s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1){
    55     ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))) /* ^?{} */);
    56 }
    57 static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_P13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){
     44static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);
     45static inline void ___constructor__F_R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);
     46static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1);
     47static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1);
     48static inline void ___constructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){
     49    ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ?{} */);
     50}
     51static inline void ___constructor__F_R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){
     52    ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1) /* ?{} */);
     53}
     54static inline void ___destructor__F_R13s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1){
     55    ((void)((*___dst__R13s__anonymous1_1).__i__i_1) /* ^?{} */);
     56}
     57static inline struct __anonymous1 ___operator_assign__F13s__anonymous1_R13s__anonymous113s__anonymous1_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, struct __anonymous1 ___src__13s__anonymous1_1){
    5858    struct __anonymous1 ___ret__13s__anonymous1_1;
    59     ((void)((*___dst__P13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1));
    60     ((void)___constructor__F_P13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1));
     59    ((void)((*___dst__R13s__anonymous1_1).__i__i_1=___src__13s__anonymous1_1.__i__i_1));
     60    ((void)___constructor__F_R13s__anonymous113s__anonymous1_autogen___1((&___ret__13s__anonymous1_1), ___src__13s__anonymous1_1));
    6161    return ((struct __anonymous1 )___ret__13s__anonymous1_1);
    6262}
    63 static inline void ___constructor__F_P13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__P13s__anonymous1_1, int __i__i_1){
    64     ((void)((*((int *)(&(*___dst__P13s__anonymous1_1).__i__i_1)))=__i__i_1) /* ?{} */);
     63static inline void ___constructor__F_R13s__anonymous1i_autogen___1(struct __anonymous1 *___dst__R13s__anonymous1_1, int __i__i_1){
     64    ((void)((*___dst__R13s__anonymous1_1).__i__i_1=__i__i_1) /* ?{} */);
    6565}
    6666volatile const struct __anonymous1 __x11__CV13s__anonymous1_1;
     
    6868    int __i__i_1;
    6969};
    70 static inline void ___constructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1);
    71 static inline void ___constructor__F_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);
    72 static inline void ___destructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1);
    73 static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);
    74 static inline void ___constructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1){
    75     ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))) /* ?{} */);
    76 }
    77 static inline void ___constructor__F_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){
    78     ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))=___src__13s__anonymous2_1.__i__i_1) /* ?{} */);
    79 }
    80 static inline void ___destructor__F_P13s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1){
    81     ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))) /* ^?{} */);
    82 }
    83 static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_P13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){
     70static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);
     71static inline void ___constructor__F_R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);
     72static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1);
     73static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1);
     74static inline void ___constructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){
     75    ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ?{} */);
     76}
     77static inline void ___constructor__F_R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){
     78    ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1) /* ?{} */);
     79}
     80static inline void ___destructor__F_R13s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1){
     81    ((void)((*___dst__R13s__anonymous2_1).__i__i_1) /* ^?{} */);
     82}
     83static inline struct __anonymous2 ___operator_assign__F13s__anonymous2_R13s__anonymous213s__anonymous2_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, struct __anonymous2 ___src__13s__anonymous2_1){
    8484    struct __anonymous2 ___ret__13s__anonymous2_1;
    85     ((void)((*___dst__P13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1));
    86     ((void)___constructor__F_P13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1));
     85    ((void)((*___dst__R13s__anonymous2_1).__i__i_1=___src__13s__anonymous2_1.__i__i_1));
     86    ((void)___constructor__F_R13s__anonymous213s__anonymous2_autogen___1((&___ret__13s__anonymous2_1), ___src__13s__anonymous2_1));
    8787    return ((struct __anonymous2 )___ret__13s__anonymous2_1);
    8888}
    89 static inline void ___constructor__F_P13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__P13s__anonymous2_1, int __i__i_1){
    90     ((void)((*((int *)(&(*___dst__P13s__anonymous2_1).__i__i_1)))=__i__i_1) /* ?{} */);
     89static inline void ___constructor__F_R13s__anonymous2i_autogen___1(struct __anonymous2 *___dst__R13s__anonymous2_1, int __i__i_1){
     90    ((void)((*___dst__R13s__anonymous2_1).__i__i_1=__i__i_1) /* ?{} */);
    9191}
    9292volatile const struct __anonymous2 __x12__CV13s__anonymous2_1;
     
    9494    int __i__i_1;
    9595};
    96 static inline void ___constructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1);
    97 static inline void ___constructor__F_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);
    98 static inline void ___destructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1);
    99 static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);
    100 static inline void ___constructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1){
    101     ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))) /* ?{} */);
    102 }
    103 static inline void ___constructor__F_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){
    104     ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))=___src__13s__anonymous3_1.__i__i_1) /* ?{} */);
    105 }
    106 static inline void ___destructor__F_P13s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1){
    107     ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))) /* ^?{} */);
    108 }
    109 static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_P13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){
     96static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);
     97static inline void ___constructor__F_R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);
     98static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1);
     99static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1);
     100static inline void ___constructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){
     101    ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ?{} */);
     102}
     103static inline void ___constructor__F_R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){
     104    ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1) /* ?{} */);
     105}
     106static inline void ___destructor__F_R13s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1){
     107    ((void)((*___dst__R13s__anonymous3_1).__i__i_1) /* ^?{} */);
     108}
     109static inline struct __anonymous3 ___operator_assign__F13s__anonymous3_R13s__anonymous313s__anonymous3_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, struct __anonymous3 ___src__13s__anonymous3_1){
    110110    struct __anonymous3 ___ret__13s__anonymous3_1;
    111     ((void)((*___dst__P13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1));
    112     ((void)___constructor__F_P13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1));
     111    ((void)((*___dst__R13s__anonymous3_1).__i__i_1=___src__13s__anonymous3_1.__i__i_1));
     112    ((void)___constructor__F_R13s__anonymous313s__anonymous3_autogen___1((&___ret__13s__anonymous3_1), ___src__13s__anonymous3_1));
    113113    return ((struct __anonymous3 )___ret__13s__anonymous3_1);
    114114}
    115 static inline void ___constructor__F_P13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__P13s__anonymous3_1, int __i__i_1){
    116     ((void)((*((int *)(&(*___dst__P13s__anonymous3_1).__i__i_1)))=__i__i_1) /* ?{} */);
     115static inline void ___constructor__F_R13s__anonymous3i_autogen___1(struct __anonymous3 *___dst__R13s__anonymous3_1, int __i__i_1){
     116    ((void)((*___dst__R13s__anonymous3_1).__i__i_1=__i__i_1) /* ?{} */);
    117117}
    118118static volatile const struct __anonymous3 __x13__CV13s__anonymous3_1;
     
    120120    int __i__i_1;
    121121};
    122 static inline void ___constructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1);
    123 static inline void ___constructor__F_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);
    124 static inline void ___destructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1);
    125 static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);
    126 static inline void ___constructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1){
    127     ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))) /* ?{} */);
    128 }
    129 static inline void ___constructor__F_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){
    130     ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))=___src__13s__anonymous4_1.__i__i_1) /* ?{} */);
    131 }
    132 static inline void ___destructor__F_P13s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1){
    133     ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))) /* ^?{} */);
    134 }
    135 static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_P13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){
     122static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);
     123static inline void ___constructor__F_R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);
     124static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1);
     125static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1);
     126static inline void ___constructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){
     127    ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ?{} */);
     128}
     129static inline void ___constructor__F_R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){
     130    ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1) /* ?{} */);
     131}
     132static inline void ___destructor__F_R13s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1){
     133    ((void)((*___dst__R13s__anonymous4_1).__i__i_1) /* ^?{} */);
     134}
     135static inline struct __anonymous4 ___operator_assign__F13s__anonymous4_R13s__anonymous413s__anonymous4_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, struct __anonymous4 ___src__13s__anonymous4_1){
    136136    struct __anonymous4 ___ret__13s__anonymous4_1;
    137     ((void)((*___dst__P13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1));
    138     ((void)___constructor__F_P13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1));
     137    ((void)((*___dst__R13s__anonymous4_1).__i__i_1=___src__13s__anonymous4_1.__i__i_1));
     138    ((void)___constructor__F_R13s__anonymous413s__anonymous4_autogen___1((&___ret__13s__anonymous4_1), ___src__13s__anonymous4_1));
    139139    return ((struct __anonymous4 )___ret__13s__anonymous4_1);
    140140}
    141 static inline void ___constructor__F_P13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__P13s__anonymous4_1, int __i__i_1){
    142     ((void)((*((int *)(&(*___dst__P13s__anonymous4_1).__i__i_1)))=__i__i_1) /* ?{} */);
     141static inline void ___constructor__F_R13s__anonymous4i_autogen___1(struct __anonymous4 *___dst__R13s__anonymous4_1, int __i__i_1){
     142    ((void)((*___dst__R13s__anonymous4_1).__i__i_1=__i__i_1) /* ?{} */);
    143143}
    144144static volatile const struct __anonymous4 __x14__CV13s__anonymous4_1;
     
    146146    int __i__i_1;
    147147};
    148 static inline void ___constructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1);
    149 static inline void ___constructor__F_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);
    150 static inline void ___destructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1);
    151 static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);
    152 static inline void ___constructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1){
    153     ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))) /* ?{} */);
    154 }
    155 static inline void ___constructor__F_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){
    156     ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))=___src__13s__anonymous5_1.__i__i_1) /* ?{} */);
    157 }
    158 static inline void ___destructor__F_P13s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1){
    159     ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))) /* ^?{} */);
    160 }
    161 static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_P13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){
     148static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);
     149static inline void ___constructor__F_R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);
     150static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1);
     151static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1);
     152static inline void ___constructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){
     153    ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ?{} */);
     154}
     155static inline void ___constructor__F_R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){
     156    ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1) /* ?{} */);
     157}
     158static inline void ___destructor__F_R13s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1){
     159    ((void)((*___dst__R13s__anonymous5_1).__i__i_1) /* ^?{} */);
     160}
     161static inline struct __anonymous5 ___operator_assign__F13s__anonymous5_R13s__anonymous513s__anonymous5_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, struct __anonymous5 ___src__13s__anonymous5_1){
    162162    struct __anonymous5 ___ret__13s__anonymous5_1;
    163     ((void)((*___dst__P13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1));
    164     ((void)___constructor__F_P13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1));
     163    ((void)((*___dst__R13s__anonymous5_1).__i__i_1=___src__13s__anonymous5_1.__i__i_1));
     164    ((void)___constructor__F_R13s__anonymous513s__anonymous5_autogen___1((&___ret__13s__anonymous5_1), ___src__13s__anonymous5_1));
    165165    return ((struct __anonymous5 )___ret__13s__anonymous5_1);
    166166}
    167 static inline void ___constructor__F_P13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__P13s__anonymous5_1, int __i__i_1){
    168     ((void)((*((int *)(&(*___dst__P13s__anonymous5_1).__i__i_1)))=__i__i_1) /* ?{} */);
     167static inline void ___constructor__F_R13s__anonymous5i_autogen___1(struct __anonymous5 *___dst__R13s__anonymous5_1, int __i__i_1){
     168    ((void)((*___dst__R13s__anonymous5_1).__i__i_1=__i__i_1) /* ?{} */);
    169169}
    170170static volatile const struct __anonymous5 __x15__CV13s__anonymous5_1;
     
    172172    int __i__i_1;
    173173};
    174 static inline void ___constructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1);
    175 static inline void ___constructor__F_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);
    176 static inline void ___destructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1);
    177 static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);
    178 static inline void ___constructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1){
    179     ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))) /* ?{} */);
    180 }
    181 static inline void ___constructor__F_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){
    182     ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))=___src__13s__anonymous6_1.__i__i_1) /* ?{} */);
    183 }
    184 static inline void ___destructor__F_P13s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1){
    185     ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))) /* ^?{} */);
    186 }
    187 static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_P13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){
     174static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);
     175static inline void ___constructor__F_R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);
     176static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1);
     177static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1);
     178static inline void ___constructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){
     179    ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ?{} */);
     180}
     181static inline void ___constructor__F_R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){
     182    ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1) /* ?{} */);
     183}
     184static inline void ___destructor__F_R13s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1){
     185    ((void)((*___dst__R13s__anonymous6_1).__i__i_1) /* ^?{} */);
     186}
     187static inline struct __anonymous6 ___operator_assign__F13s__anonymous6_R13s__anonymous613s__anonymous6_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, struct __anonymous6 ___src__13s__anonymous6_1){
    188188    struct __anonymous6 ___ret__13s__anonymous6_1;
    189     ((void)((*___dst__P13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1));
    190     ((void)___constructor__F_P13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1));
     189    ((void)((*___dst__R13s__anonymous6_1).__i__i_1=___src__13s__anonymous6_1.__i__i_1));
     190    ((void)___constructor__F_R13s__anonymous613s__anonymous6_autogen___1((&___ret__13s__anonymous6_1), ___src__13s__anonymous6_1));
    191191    return ((struct __anonymous6 )___ret__13s__anonymous6_1);
    192192}
    193 static inline void ___constructor__F_P13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__P13s__anonymous6_1, int __i__i_1){
    194     ((void)((*((int *)(&(*___dst__P13s__anonymous6_1).__i__i_1)))=__i__i_1) /* ?{} */);
     193static inline void ___constructor__F_R13s__anonymous6i_autogen___1(struct __anonymous6 *___dst__R13s__anonymous6_1, int __i__i_1){
     194    ((void)((*___dst__R13s__anonymous6_1).__i__i_1=__i__i_1) /* ?{} */);
    195195}
    196196static volatile const struct __anonymous6 __x16__CV13s__anonymous6_1;
     
    198198    int __i__i_1;
    199199};
    200 static inline void ___constructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1);
    201 static inline void ___constructor__F_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);
    202 static inline void ___destructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1);
    203 static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);
    204 static inline void ___constructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1){
    205     ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))) /* ?{} */);
    206 }
    207 static inline void ___constructor__F_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){
    208     ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))=___src__13s__anonymous7_1.__i__i_1) /* ?{} */);
    209 }
    210 static inline void ___destructor__F_P13s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1){
    211     ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))) /* ^?{} */);
    212 }
    213 static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_P13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){
     200static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);
     201static inline void ___constructor__F_R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);
     202static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1);
     203static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1);
     204static inline void ___constructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){
     205    ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ?{} */);
     206}
     207static inline void ___constructor__F_R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){
     208    ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1) /* ?{} */);
     209}
     210static inline void ___destructor__F_R13s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1){
     211    ((void)((*___dst__R13s__anonymous7_1).__i__i_1) /* ^?{} */);
     212}
     213static inline struct __anonymous7 ___operator_assign__F13s__anonymous7_R13s__anonymous713s__anonymous7_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, struct __anonymous7 ___src__13s__anonymous7_1){
    214214    struct __anonymous7 ___ret__13s__anonymous7_1;
    215     ((void)((*___dst__P13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1));
    216     ((void)___constructor__F_P13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1));
     215    ((void)((*___dst__R13s__anonymous7_1).__i__i_1=___src__13s__anonymous7_1.__i__i_1));
     216    ((void)___constructor__F_R13s__anonymous713s__anonymous7_autogen___1((&___ret__13s__anonymous7_1), ___src__13s__anonymous7_1));
    217217    return ((struct __anonymous7 )___ret__13s__anonymous7_1);
    218218}
    219 static inline void ___constructor__F_P13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__P13s__anonymous7_1, int __i__i_1){
    220     ((void)((*((int *)(&(*___dst__P13s__anonymous7_1).__i__i_1)))=__i__i_1) /* ?{} */);
     219static inline void ___constructor__F_R13s__anonymous7i_autogen___1(struct __anonymous7 *___dst__R13s__anonymous7_1, int __i__i_1){
     220    ((void)((*___dst__R13s__anonymous7_1).__i__i_1=__i__i_1) /* ?{} */);
    221221}
    222222static volatile const struct __anonymous7 __x17__CV13s__anonymous7_1;
     
    232232    short __i__s_1;
    233233};
    234 static inline void ___constructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1);
    235 static inline void ___constructor__F_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);
    236 static inline void ___destructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1);
    237 static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);
    238 static inline void ___constructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1){
    239     ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))) /* ?{} */);
    240 }
    241 static inline void ___constructor__F_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){
    242     ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))=___src__13s__anonymous8_1.__i__s_1) /* ?{} */);
    243 }
    244 static inline void ___destructor__F_P13s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1){
    245     ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))) /* ^?{} */);
    246 }
    247 static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_P13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){
     234static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);
     235static inline void ___constructor__F_R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);
     236static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1);
     237static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1);
     238static inline void ___constructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){
     239    ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ?{} */);
     240}
     241static inline void ___constructor__F_R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){
     242    ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1) /* ?{} */);
     243}
     244static inline void ___destructor__F_R13s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1){
     245    ((void)((*___dst__R13s__anonymous8_1).__i__s_1) /* ^?{} */);
     246}
     247static inline struct __anonymous8 ___operator_assign__F13s__anonymous8_R13s__anonymous813s__anonymous8_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, struct __anonymous8 ___src__13s__anonymous8_1){
    248248    struct __anonymous8 ___ret__13s__anonymous8_1;
    249     ((void)((*___dst__P13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1));
    250     ((void)___constructor__F_P13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1));
     249    ((void)((*___dst__R13s__anonymous8_1).__i__s_1=___src__13s__anonymous8_1.__i__s_1));
     250    ((void)___constructor__F_R13s__anonymous813s__anonymous8_autogen___1((&___ret__13s__anonymous8_1), ___src__13s__anonymous8_1));
    251251    return ((struct __anonymous8 )___ret__13s__anonymous8_1);
    252252}
    253 static inline void ___constructor__F_P13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__P13s__anonymous8_1, short __i__s_1){
    254     ((void)((*((short *)(&(*___dst__P13s__anonymous8_1).__i__s_1)))=__i__s_1) /* ?{} */);
     253static inline void ___constructor__F_R13s__anonymous8s_autogen___1(struct __anonymous8 *___dst__R13s__anonymous8_1, short __i__s_1){
     254    ((void)((*___dst__R13s__anonymous8_1).__i__s_1=__i__s_1) /* ?{} */);
    255255}
    256256volatile const struct __anonymous8 __x29__CV13s__anonymous8_1;
     
    258258    short __i__s_1;
    259259};
    260 static inline void ___constructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1);
    261 static inline void ___constructor__F_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);
    262 static inline void ___destructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1);
    263 static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);
    264 static inline void ___constructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1){
    265     ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))) /* ?{} */);
    266 }
    267 static inline void ___constructor__F_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){
    268     ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))=___src__13s__anonymous9_1.__i__s_1) /* ?{} */);
    269 }
    270 static inline void ___destructor__F_P13s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1){
    271     ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))) /* ^?{} */);
    272 }
    273 static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_P13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){
     260static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);
     261static inline void ___constructor__F_R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);
     262static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1);
     263static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1);
     264static inline void ___constructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){
     265    ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ?{} */);
     266}
     267static inline void ___constructor__F_R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){
     268    ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1) /* ?{} */);
     269}
     270static inline void ___destructor__F_R13s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1){
     271    ((void)((*___dst__R13s__anonymous9_1).__i__s_1) /* ^?{} */);
     272}
     273static inline struct __anonymous9 ___operator_assign__F13s__anonymous9_R13s__anonymous913s__anonymous9_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, struct __anonymous9 ___src__13s__anonymous9_1){
    274274    struct __anonymous9 ___ret__13s__anonymous9_1;
    275     ((void)((*___dst__P13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1));
    276     ((void)___constructor__F_P13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1));
     275    ((void)((*___dst__R13s__anonymous9_1).__i__s_1=___src__13s__anonymous9_1.__i__s_1));
     276    ((void)___constructor__F_R13s__anonymous913s__anonymous9_autogen___1((&___ret__13s__anonymous9_1), ___src__13s__anonymous9_1));
    277277    return ((struct __anonymous9 )___ret__13s__anonymous9_1);
    278278}
    279 static inline void ___constructor__F_P13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__P13s__anonymous9_1, short __i__s_1){
    280     ((void)((*((short *)(&(*___dst__P13s__anonymous9_1).__i__s_1)))=__i__s_1) /* ?{} */);
     279static inline void ___constructor__F_R13s__anonymous9s_autogen___1(struct __anonymous9 *___dst__R13s__anonymous9_1, short __i__s_1){
     280    ((void)((*___dst__R13s__anonymous9_1).__i__s_1=__i__s_1) /* ?{} */);
    281281}
    282282volatile const struct __anonymous9 __x30__CV13s__anonymous9_1;
     
    284284    short __i__s_1;
    285285};
    286 static inline void ___constructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1);
    287 static inline void ___constructor__F_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);
    288 static inline void ___destructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1);
    289 static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);
    290 static inline void ___constructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1){
    291     ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))) /* ?{} */);
    292 }
    293 static inline void ___constructor__F_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){
    294     ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))=___src__14s__anonymous10_1.__i__s_1) /* ?{} */);
    295 }
    296 static inline void ___destructor__F_P14s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1){
    297     ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))) /* ^?{} */);
    298 }
    299 static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_P14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){
     286static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);
     287static inline void ___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);
     288static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1);
     289static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1);
     290static inline void ___constructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){
     291    ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ?{} */);
     292}
     293static inline void ___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){
     294    ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1) /* ?{} */);
     295}
     296static inline void ___destructor__F_R14s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1){
     297    ((void)((*___dst__R14s__anonymous10_1).__i__s_1) /* ^?{} */);
     298}
     299static inline struct __anonymous10 ___operator_assign__F14s__anonymous10_R14s__anonymous1014s__anonymous10_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, struct __anonymous10 ___src__14s__anonymous10_1){
    300300    struct __anonymous10 ___ret__14s__anonymous10_1;
    301     ((void)((*___dst__P14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1));
    302     ((void)___constructor__F_P14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1));
     301    ((void)((*___dst__R14s__anonymous10_1).__i__s_1=___src__14s__anonymous10_1.__i__s_1));
     302    ((void)___constructor__F_R14s__anonymous1014s__anonymous10_autogen___1((&___ret__14s__anonymous10_1), ___src__14s__anonymous10_1));
    303303    return ((struct __anonymous10 )___ret__14s__anonymous10_1);
    304304}
    305 static inline void ___constructor__F_P14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__P14s__anonymous10_1, short __i__s_1){
    306     ((void)((*((short *)(&(*___dst__P14s__anonymous10_1).__i__s_1)))=__i__s_1) /* ?{} */);
     305static inline void ___constructor__F_R14s__anonymous10s_autogen___1(struct __anonymous10 *___dst__R14s__anonymous10_1, short __i__s_1){
     306    ((void)((*___dst__R14s__anonymous10_1).__i__s_1=__i__s_1) /* ?{} */);
    307307}
    308308volatile const struct __anonymous10 __x31__CV14s__anonymous10_1;
     
    310310    short __i__s_1;
    311311};
    312 static inline void ___constructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1);
    313 static inline void ___constructor__F_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);
    314 static inline void ___destructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1);
    315 static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);
    316 static inline void ___constructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1){
    317     ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))) /* ?{} */);
    318 }
    319 static inline void ___constructor__F_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){
    320     ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))=___src__14s__anonymous11_1.__i__s_1) /* ?{} */);
    321 }
    322 static inline void ___destructor__F_P14s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1){
    323     ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))) /* ^?{} */);
    324 }
    325 static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_P14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){
     312static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);
     313static inline void ___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);
     314static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1);
     315static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1);
     316static inline void ___constructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){
     317    ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ?{} */);
     318}
     319static inline void ___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){
     320    ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1) /* ?{} */);
     321}
     322static inline void ___destructor__F_R14s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1){
     323    ((void)((*___dst__R14s__anonymous11_1).__i__s_1) /* ^?{} */);
     324}
     325static inline struct __anonymous11 ___operator_assign__F14s__anonymous11_R14s__anonymous1114s__anonymous11_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, struct __anonymous11 ___src__14s__anonymous11_1){
    326326    struct __anonymous11 ___ret__14s__anonymous11_1;
    327     ((void)((*___dst__P14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1));
    328     ((void)___constructor__F_P14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1));
     327    ((void)((*___dst__R14s__anonymous11_1).__i__s_1=___src__14s__anonymous11_1.__i__s_1));
     328    ((void)___constructor__F_R14s__anonymous1114s__anonymous11_autogen___1((&___ret__14s__anonymous11_1), ___src__14s__anonymous11_1));
    329329    return ((struct __anonymous11 )___ret__14s__anonymous11_1);
    330330}
    331 static inline void ___constructor__F_P14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__P14s__anonymous11_1, short __i__s_1){
    332     ((void)((*((short *)(&(*___dst__P14s__anonymous11_1).__i__s_1)))=__i__s_1) /* ?{} */);
     331static inline void ___constructor__F_R14s__anonymous11s_autogen___1(struct __anonymous11 *___dst__R14s__anonymous11_1, short __i__s_1){
     332    ((void)((*___dst__R14s__anonymous11_1).__i__s_1=__i__s_1) /* ?{} */);
    333333}
    334334static volatile const struct __anonymous11 __x32__CV14s__anonymous11_1;
     
    336336    short __i__s_1;
    337337};
    338 static inline void ___constructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1);
    339 static inline void ___constructor__F_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);
    340 static inline void ___destructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1);
    341 static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);
    342 static inline void ___constructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1){
    343     ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))) /* ?{} */);
    344 }
    345 static inline void ___constructor__F_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){
    346     ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))=___src__14s__anonymous12_1.__i__s_1) /* ?{} */);
    347 }
    348 static inline void ___destructor__F_P14s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1){
    349     ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))) /* ^?{} */);
    350 }
    351 static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_P14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){
     338static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);
     339static inline void ___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);
     340static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1);
     341static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1);
     342static inline void ___constructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){
     343    ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ?{} */);
     344}
     345static inline void ___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){
     346    ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1) /* ?{} */);
     347}
     348static inline void ___destructor__F_R14s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1){
     349    ((void)((*___dst__R14s__anonymous12_1).__i__s_1) /* ^?{} */);
     350}
     351static inline struct __anonymous12 ___operator_assign__F14s__anonymous12_R14s__anonymous1214s__anonymous12_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, struct __anonymous12 ___src__14s__anonymous12_1){
    352352    struct __anonymous12 ___ret__14s__anonymous12_1;
    353     ((void)((*___dst__P14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1));
    354     ((void)___constructor__F_P14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1));
     353    ((void)((*___dst__R14s__anonymous12_1).__i__s_1=___src__14s__anonymous12_1.__i__s_1));
     354    ((void)___constructor__F_R14s__anonymous1214s__anonymous12_autogen___1((&___ret__14s__anonymous12_1), ___src__14s__anonymous12_1));
    355355    return ((struct __anonymous12 )___ret__14s__anonymous12_1);
    356356}
    357 static inline void ___constructor__F_P14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__P14s__anonymous12_1, short __i__s_1){
    358     ((void)((*((short *)(&(*___dst__P14s__anonymous12_1).__i__s_1)))=__i__s_1) /* ?{} */);
     357static inline void ___constructor__F_R14s__anonymous12s_autogen___1(struct __anonymous12 *___dst__R14s__anonymous12_1, short __i__s_1){
     358    ((void)((*___dst__R14s__anonymous12_1).__i__s_1=__i__s_1) /* ?{} */);
    359359}
    360360static volatile const struct __anonymous12 __x33__CV14s__anonymous12_1;
     
    362362    short __i__s_1;
    363363};
    364 static inline void ___constructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1);
    365 static inline void ___constructor__F_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);
    366 static inline void ___destructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1);
    367 static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);
    368 static inline void ___constructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1){
    369     ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))) /* ?{} */);
    370 }
    371 static inline void ___constructor__F_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){
    372     ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))=___src__14s__anonymous13_1.__i__s_1) /* ?{} */);
    373 }
    374 static inline void ___destructor__F_P14s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1){
    375     ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))) /* ^?{} */);
    376 }
    377 static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_P14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){
     364static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);
     365static inline void ___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);
     366static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1);
     367static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1);
     368static inline void ___constructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){
     369    ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ?{} */);
     370}
     371static inline void ___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){
     372    ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1) /* ?{} */);
     373}
     374static inline void ___destructor__F_R14s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1){
     375    ((void)((*___dst__R14s__anonymous13_1).__i__s_1) /* ^?{} */);
     376}
     377static inline struct __anonymous13 ___operator_assign__F14s__anonymous13_R14s__anonymous1314s__anonymous13_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, struct __anonymous13 ___src__14s__anonymous13_1){
    378378    struct __anonymous13 ___ret__14s__anonymous13_1;
    379     ((void)((*___dst__P14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1));
    380     ((void)___constructor__F_P14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1));
     379    ((void)((*___dst__R14s__anonymous13_1).__i__s_1=___src__14s__anonymous13_1.__i__s_1));
     380    ((void)___constructor__F_R14s__anonymous1314s__anonymous13_autogen___1((&___ret__14s__anonymous13_1), ___src__14s__anonymous13_1));
    381381    return ((struct __anonymous13 )___ret__14s__anonymous13_1);
    382382}
    383 static inline void ___constructor__F_P14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__P14s__anonymous13_1, short __i__s_1){
    384     ((void)((*((short *)(&(*___dst__P14s__anonymous13_1).__i__s_1)))=__i__s_1) /* ?{} */);
     383static inline void ___constructor__F_R14s__anonymous13s_autogen___1(struct __anonymous13 *___dst__R14s__anonymous13_1, short __i__s_1){
     384    ((void)((*___dst__R14s__anonymous13_1).__i__s_1=__i__s_1) /* ?{} */);
    385385}
    386386static volatile const struct __anonymous13 __x34__CV14s__anonymous13_1;
     
    388388    short __i__s_1;
    389389};
    390 static inline void ___constructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1);
    391 static inline void ___constructor__F_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);
    392 static inline void ___destructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1);
    393 static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);
    394 static inline void ___constructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1){
    395     ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))) /* ?{} */);
    396 }
    397 static inline void ___constructor__F_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){
    398     ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))=___src__14s__anonymous14_1.__i__s_1) /* ?{} */);
    399 }
    400 static inline void ___destructor__F_P14s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1){
    401     ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))) /* ^?{} */);
    402 }
    403 static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_P14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){
     390static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);
     391static inline void ___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);
     392static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1);
     393static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1);
     394static inline void ___constructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){
     395    ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ?{} */);
     396}
     397static inline void ___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){
     398    ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1) /* ?{} */);
     399}
     400static inline void ___destructor__F_R14s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1){
     401    ((void)((*___dst__R14s__anonymous14_1).__i__s_1) /* ^?{} */);
     402}
     403static inline struct __anonymous14 ___operator_assign__F14s__anonymous14_R14s__anonymous1414s__anonymous14_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, struct __anonymous14 ___src__14s__anonymous14_1){
    404404    struct __anonymous14 ___ret__14s__anonymous14_1;
    405     ((void)((*___dst__P14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1));
    406     ((void)___constructor__F_P14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1));
     405    ((void)((*___dst__R14s__anonymous14_1).__i__s_1=___src__14s__anonymous14_1.__i__s_1));
     406    ((void)___constructor__F_R14s__anonymous1414s__anonymous14_autogen___1((&___ret__14s__anonymous14_1), ___src__14s__anonymous14_1));
    407407    return ((struct __anonymous14 )___ret__14s__anonymous14_1);
    408408}
    409 static inline void ___constructor__F_P14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__P14s__anonymous14_1, short __i__s_1){
    410     ((void)((*((short *)(&(*___dst__P14s__anonymous14_1).__i__s_1)))=__i__s_1) /* ?{} */);
     409static inline void ___constructor__F_R14s__anonymous14s_autogen___1(struct __anonymous14 *___dst__R14s__anonymous14_1, short __i__s_1){
     410    ((void)((*___dst__R14s__anonymous14_1).__i__s_1=__i__s_1) /* ?{} */);
    411411}
    412412static volatile const struct __anonymous14 __x35__CV14s__anonymous14_1;
     
    414414    short __i__s_1;
    415415};
    416 static inline void ___constructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1);
    417 static inline void ___constructor__F_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);
    418 static inline void ___destructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1);
    419 static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);
    420 static inline void ___constructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1){
    421     ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))) /* ?{} */);
    422 }
    423 static inline void ___constructor__F_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){
    424     ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))=___src__14s__anonymous15_1.__i__s_1) /* ?{} */);
    425 }
    426 static inline void ___destructor__F_P14s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1){
    427     ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))) /* ^?{} */);
    428 }
    429 static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_P14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){
     416static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);
     417static inline void ___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);
     418static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1);
     419static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1);
     420static inline void ___constructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){
     421    ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ?{} */);
     422}
     423static inline void ___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){
     424    ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1) /* ?{} */);
     425}
     426static inline void ___destructor__F_R14s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1){
     427    ((void)((*___dst__R14s__anonymous15_1).__i__s_1) /* ^?{} */);
     428}
     429static inline struct __anonymous15 ___operator_assign__F14s__anonymous15_R14s__anonymous1514s__anonymous15_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, struct __anonymous15 ___src__14s__anonymous15_1){
    430430    struct __anonymous15 ___ret__14s__anonymous15_1;
    431     ((void)((*___dst__P14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1));
    432     ((void)___constructor__F_P14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1));
     431    ((void)((*___dst__R14s__anonymous15_1).__i__s_1=___src__14s__anonymous15_1.__i__s_1));
     432    ((void)___constructor__F_R14s__anonymous1514s__anonymous15_autogen___1((&___ret__14s__anonymous15_1), ___src__14s__anonymous15_1));
    433433    return ((struct __anonymous15 )___ret__14s__anonymous15_1);
    434434}
    435 static inline void ___constructor__F_P14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__P14s__anonymous15_1, short __i__s_1){
    436     ((void)((*((short *)(&(*___dst__P14s__anonymous15_1).__i__s_1)))=__i__s_1) /* ?{} */);
     435static inline void ___constructor__F_R14s__anonymous15s_autogen___1(struct __anonymous15 *___dst__R14s__anonymous15_1, short __i__s_1){
     436    ((void)((*___dst__R14s__anonymous15_1).__i__s_1=__i__s_1) /* ?{} */);
    437437}
    438438static volatile const struct __anonymous15 __x36__CV14s__anonymous15_1;
     
    456456    int __i__i_1;
    457457};
    458 static inline void ___constructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1);
    459 static inline void ___constructor__F_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);
    460 static inline void ___destructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1);
    461 static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);
    462 static inline void ___constructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1){
    463     ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))) /* ?{} */);
    464 }
    465 static inline void ___constructor__F_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){
    466     ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))=___src__14s__anonymous16_1.__i__i_1) /* ?{} */);
    467 }
    468 static inline void ___destructor__F_P14s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1){
    469     ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))) /* ^?{} */);
    470 }
    471 static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_P14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){
     458static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);
     459static inline void ___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);
     460static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1);
     461static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1);
     462static inline void ___constructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){
     463    ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ?{} */);
     464}
     465static inline void ___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){
     466    ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1) /* ?{} */);
     467}
     468static inline void ___destructor__F_R14s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1){
     469    ((void)((*___dst__R14s__anonymous16_1).__i__i_1) /* ^?{} */);
     470}
     471static inline struct __anonymous16 ___operator_assign__F14s__anonymous16_R14s__anonymous1614s__anonymous16_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, struct __anonymous16 ___src__14s__anonymous16_1){
    472472    struct __anonymous16 ___ret__14s__anonymous16_1;
    473     ((void)((*___dst__P14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1));
    474     ((void)___constructor__F_P14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1));
     473    ((void)((*___dst__R14s__anonymous16_1).__i__i_1=___src__14s__anonymous16_1.__i__i_1));
     474    ((void)___constructor__F_R14s__anonymous1614s__anonymous16_autogen___1((&___ret__14s__anonymous16_1), ___src__14s__anonymous16_1));
    475475    return ((struct __anonymous16 )___ret__14s__anonymous16_1);
    476476}
    477 static inline void ___constructor__F_P14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__P14s__anonymous16_1, int __i__i_1){
    478     ((void)((*((int *)(&(*___dst__P14s__anonymous16_1).__i__i_1)))=__i__i_1) /* ?{} */);
     477static inline void ___constructor__F_R14s__anonymous16i_autogen___1(struct __anonymous16 *___dst__R14s__anonymous16_1, int __i__i_1){
     478    ((void)((*___dst__R14s__anonymous16_1).__i__i_1=__i__i_1) /* ?{} */);
    479479}
    480480static inline volatile const struct __anonymous16 __f31__FCV14s__anonymous16___1();
     
    482482    int __i__i_1;
    483483};
    484 static inline void ___constructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1);
    485 static inline void ___constructor__F_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);
    486 static inline void ___destructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1);
    487 static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);
    488 static inline void ___constructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1){
    489     ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))) /* ?{} */);
    490 }
    491 static inline void ___constructor__F_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){
    492     ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))=___src__14s__anonymous17_1.__i__i_1) /* ?{} */);
    493 }
    494 static inline void ___destructor__F_P14s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1){
    495     ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))) /* ^?{} */);
    496 }
    497 static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_P14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){
     484static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);
     485static inline void ___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);
     486static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1);
     487static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1);
     488static inline void ___constructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){
     489    ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ?{} */);
     490}
     491static inline void ___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){
     492    ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1) /* ?{} */);
     493}
     494static inline void ___destructor__F_R14s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1){
     495    ((void)((*___dst__R14s__anonymous17_1).__i__i_1) /* ^?{} */);
     496}
     497static inline struct __anonymous17 ___operator_assign__F14s__anonymous17_R14s__anonymous1714s__anonymous17_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, struct __anonymous17 ___src__14s__anonymous17_1){
    498498    struct __anonymous17 ___ret__14s__anonymous17_1;
    499     ((void)((*___dst__P14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1));
    500     ((void)___constructor__F_P14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1));
     499    ((void)((*___dst__R14s__anonymous17_1).__i__i_1=___src__14s__anonymous17_1.__i__i_1));
     500    ((void)___constructor__F_R14s__anonymous1714s__anonymous17_autogen___1((&___ret__14s__anonymous17_1), ___src__14s__anonymous17_1));
    501501    return ((struct __anonymous17 )___ret__14s__anonymous17_1);
    502502}
    503 static inline void ___constructor__F_P14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__P14s__anonymous17_1, int __i__i_1){
    504     ((void)((*((int *)(&(*___dst__P14s__anonymous17_1).__i__i_1)))=__i__i_1) /* ?{} */);
     503static inline void ___constructor__F_R14s__anonymous17i_autogen___1(struct __anonymous17 *___dst__R14s__anonymous17_1, int __i__i_1){
     504    ((void)((*___dst__R14s__anonymous17_1).__i__i_1=__i__i_1) /* ?{} */);
    505505}
    506506static inline volatile const struct __anonymous17 __f32__FCV14s__anonymous17___1();
     
    508508    int __i__i_1;
    509509};
    510 static inline void ___constructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1);
    511 static inline void ___constructor__F_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);
    512 static inline void ___destructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1);
    513 static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);
    514 static inline void ___constructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1){
    515     ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))) /* ?{} */);
    516 }
    517 static inline void ___constructor__F_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){
    518     ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))=___src__14s__anonymous18_1.__i__i_1) /* ?{} */);
    519 }
    520 static inline void ___destructor__F_P14s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1){
    521     ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))) /* ^?{} */);
    522 }
    523 static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_P14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){
     510static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);
     511static inline void ___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);
     512static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1);
     513static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1);
     514static inline void ___constructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){
     515    ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ?{} */);
     516}
     517static inline void ___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){
     518    ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1) /* ?{} */);
     519}
     520static inline void ___destructor__F_R14s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1){
     521    ((void)((*___dst__R14s__anonymous18_1).__i__i_1) /* ^?{} */);
     522}
     523static inline struct __anonymous18 ___operator_assign__F14s__anonymous18_R14s__anonymous1814s__anonymous18_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, struct __anonymous18 ___src__14s__anonymous18_1){
    524524    struct __anonymous18 ___ret__14s__anonymous18_1;
    525     ((void)((*___dst__P14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1));
    526     ((void)___constructor__F_P14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1));
     525    ((void)((*___dst__R14s__anonymous18_1).__i__i_1=___src__14s__anonymous18_1.__i__i_1));
     526    ((void)___constructor__F_R14s__anonymous1814s__anonymous18_autogen___1((&___ret__14s__anonymous18_1), ___src__14s__anonymous18_1));
    527527    return ((struct __anonymous18 )___ret__14s__anonymous18_1);
    528528}
    529 static inline void ___constructor__F_P14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__P14s__anonymous18_1, int __i__i_1){
    530     ((void)((*((int *)(&(*___dst__P14s__anonymous18_1).__i__i_1)))=__i__i_1) /* ?{} */);
     529static inline void ___constructor__F_R14s__anonymous18i_autogen___1(struct __anonymous18 *___dst__R14s__anonymous18_1, int __i__i_1){
     530    ((void)((*___dst__R14s__anonymous18_1).__i__i_1=__i__i_1) /* ?{} */);
    531531}
    532532static inline volatile const struct __anonymous18 __f33__FCV14s__anonymous18___1();
     
    534534    int __i__i_1;
    535535};
    536 static inline void ___constructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1);
    537 static inline void ___constructor__F_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);
    538 static inline void ___destructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1);
    539 static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);
    540 static inline void ___constructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1){
    541     ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))) /* ?{} */);
    542 }
    543 static inline void ___constructor__F_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){
    544     ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))=___src__14s__anonymous19_1.__i__i_1) /* ?{} */);
    545 }
    546 static inline void ___destructor__F_P14s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1){
    547     ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))) /* ^?{} */);
    548 }
    549 static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_P14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){
     536static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);
     537static inline void ___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);
     538static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1);
     539static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1);
     540static inline void ___constructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){
     541    ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ?{} */);
     542}
     543static inline void ___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){
     544    ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1) /* ?{} */);
     545}
     546static inline void ___destructor__F_R14s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1){
     547    ((void)((*___dst__R14s__anonymous19_1).__i__i_1) /* ^?{} */);
     548}
     549static inline struct __anonymous19 ___operator_assign__F14s__anonymous19_R14s__anonymous1914s__anonymous19_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, struct __anonymous19 ___src__14s__anonymous19_1){
    550550    struct __anonymous19 ___ret__14s__anonymous19_1;
    551     ((void)((*___dst__P14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1));
    552     ((void)___constructor__F_P14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1));
     551    ((void)((*___dst__R14s__anonymous19_1).__i__i_1=___src__14s__anonymous19_1.__i__i_1));
     552    ((void)___constructor__F_R14s__anonymous1914s__anonymous19_autogen___1((&___ret__14s__anonymous19_1), ___src__14s__anonymous19_1));
    553553    return ((struct __anonymous19 )___ret__14s__anonymous19_1);
    554554}
    555 static inline void ___constructor__F_P14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__P14s__anonymous19_1, int __i__i_1){
    556     ((void)((*((int *)(&(*___dst__P14s__anonymous19_1).__i__i_1)))=__i__i_1) /* ?{} */);
     555static inline void ___constructor__F_R14s__anonymous19i_autogen___1(struct __anonymous19 *___dst__R14s__anonymous19_1, int __i__i_1){
     556    ((void)((*___dst__R14s__anonymous19_1).__i__i_1=__i__i_1) /* ?{} */);
    557557}
    558558static inline volatile const struct __anonymous19 __f34__FCV14s__anonymous19___1();
     
    560560    int __i__i_1;
    561561};
    562 static inline void ___constructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1);
    563 static inline void ___constructor__F_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);
    564 static inline void ___destructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1);
    565 static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);
    566 static inline void ___constructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1){
    567     ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))) /* ?{} */);
    568 }
    569 static inline void ___constructor__F_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){
    570     ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))=___src__14s__anonymous20_1.__i__i_1) /* ?{} */);
    571 }
    572 static inline void ___destructor__F_P14s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1){
    573     ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))) /* ^?{} */);
    574 }
    575 static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_P14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){
     562static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);
     563static inline void ___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);
     564static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1);
     565static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1);
     566static inline void ___constructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){
     567    ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ?{} */);
     568}
     569static inline void ___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){
     570    ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1) /* ?{} */);
     571}
     572static inline void ___destructor__F_R14s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1){
     573    ((void)((*___dst__R14s__anonymous20_1).__i__i_1) /* ^?{} */);
     574}
     575static inline struct __anonymous20 ___operator_assign__F14s__anonymous20_R14s__anonymous2014s__anonymous20_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, struct __anonymous20 ___src__14s__anonymous20_1){
    576576    struct __anonymous20 ___ret__14s__anonymous20_1;
    577     ((void)((*___dst__P14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1));
    578     ((void)___constructor__F_P14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1));
     577    ((void)((*___dst__R14s__anonymous20_1).__i__i_1=___src__14s__anonymous20_1.__i__i_1));
     578    ((void)___constructor__F_R14s__anonymous2014s__anonymous20_autogen___1((&___ret__14s__anonymous20_1), ___src__14s__anonymous20_1));
    579579    return ((struct __anonymous20 )___ret__14s__anonymous20_1);
    580580}
    581 static inline void ___constructor__F_P14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__P14s__anonymous20_1, int __i__i_1){
    582     ((void)((*((int *)(&(*___dst__P14s__anonymous20_1).__i__i_1)))=__i__i_1) /* ?{} */);
     581static inline void ___constructor__F_R14s__anonymous20i_autogen___1(struct __anonymous20 *___dst__R14s__anonymous20_1, int __i__i_1){
     582    ((void)((*___dst__R14s__anonymous20_1).__i__i_1=__i__i_1) /* ?{} */);
    583583}
    584584static inline volatile const struct __anonymous20 __f35__FCV14s__anonymous20___1();
     
    586586    int __i__i_1;
    587587};
    588 static inline void ___constructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1);
    589 static inline void ___constructor__F_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);
    590 static inline void ___destructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1);
    591 static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);
    592 static inline void ___constructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1){
    593     ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))) /* ?{} */);
    594 }
    595 static inline void ___constructor__F_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){
    596     ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))=___src__14s__anonymous21_1.__i__i_1) /* ?{} */);
    597 }
    598 static inline void ___destructor__F_P14s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1){
    599     ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))) /* ^?{} */);
    600 }
    601 static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_P14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){
     588static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);
     589static inline void ___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);
     590static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1);
     591static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1);
     592static inline void ___constructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){
     593    ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ?{} */);
     594}
     595static inline void ___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){
     596    ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1) /* ?{} */);
     597}
     598static inline void ___destructor__F_R14s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1){
     599    ((void)((*___dst__R14s__anonymous21_1).__i__i_1) /* ^?{} */);
     600}
     601static inline struct __anonymous21 ___operator_assign__F14s__anonymous21_R14s__anonymous2114s__anonymous21_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, struct __anonymous21 ___src__14s__anonymous21_1){
    602602    struct __anonymous21 ___ret__14s__anonymous21_1;
    603     ((void)((*___dst__P14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1));
    604     ((void)___constructor__F_P14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1));
     603    ((void)((*___dst__R14s__anonymous21_1).__i__i_1=___src__14s__anonymous21_1.__i__i_1));
     604    ((void)___constructor__F_R14s__anonymous2114s__anonymous21_autogen___1((&___ret__14s__anonymous21_1), ___src__14s__anonymous21_1));
    605605    return ((struct __anonymous21 )___ret__14s__anonymous21_1);
    606606}
    607 static inline void ___constructor__F_P14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__P14s__anonymous21_1, int __i__i_1){
    608     ((void)((*((int *)(&(*___dst__P14s__anonymous21_1).__i__i_1)))=__i__i_1) /* ?{} */);
     607static inline void ___constructor__F_R14s__anonymous21i_autogen___1(struct __anonymous21 *___dst__R14s__anonymous21_1, int __i__i_1){
     608    ((void)((*___dst__R14s__anonymous21_1).__i__i_1=__i__i_1) /* ?{} */);
    609609}
    610610static inline volatile const struct __anonymous21 __f36__FCV14s__anonymous21___1();
     
    612612    int __i__i_1;
    613613};
    614 static inline void ___constructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1);
    615 static inline void ___constructor__F_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);
    616 static inline void ___destructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1);
    617 static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);
    618 static inline void ___constructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1){
    619     ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))) /* ?{} */);
    620 }
    621 static inline void ___constructor__F_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){
    622     ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))=___src__14s__anonymous22_1.__i__i_1) /* ?{} */);
    623 }
    624 static inline void ___destructor__F_P14s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1){
    625     ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))) /* ^?{} */);
    626 }
    627 static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_P14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){
     614static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);
     615static inline void ___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);
     616static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1);
     617static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1);
     618static inline void ___constructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){
     619    ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ?{} */);
     620}
     621static inline void ___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){
     622    ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1) /* ?{} */);
     623}
     624static inline void ___destructor__F_R14s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1){
     625    ((void)((*___dst__R14s__anonymous22_1).__i__i_1) /* ^?{} */);
     626}
     627static inline struct __anonymous22 ___operator_assign__F14s__anonymous22_R14s__anonymous2214s__anonymous22_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, struct __anonymous22 ___src__14s__anonymous22_1){
    628628    struct __anonymous22 ___ret__14s__anonymous22_1;
    629     ((void)((*___dst__P14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1));
    630     ((void)___constructor__F_P14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1));
     629    ((void)((*___dst__R14s__anonymous22_1).__i__i_1=___src__14s__anonymous22_1.__i__i_1));
     630    ((void)___constructor__F_R14s__anonymous2214s__anonymous22_autogen___1((&___ret__14s__anonymous22_1), ___src__14s__anonymous22_1));
    631631    return ((struct __anonymous22 )___ret__14s__anonymous22_1);
    632632}
    633 static inline void ___constructor__F_P14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__P14s__anonymous22_1, int __i__i_1){
    634     ((void)((*((int *)(&(*___dst__P14s__anonymous22_1).__i__i_1)))=__i__i_1) /* ?{} */);
     633static inline void ___constructor__F_R14s__anonymous22i_autogen___1(struct __anonymous22 *___dst__R14s__anonymous22_1, int __i__i_1){
     634    ((void)((*___dst__R14s__anonymous22_1).__i__i_1=__i__i_1) /* ?{} */);
    635635}
    636636static inline volatile const struct __anonymous22 __f37__FCV14s__anonymous22___1();
     
    638638    int __i__i_1;
    639639};
    640 static inline void ___constructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1);
    641 static inline void ___constructor__F_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);
    642 static inline void ___destructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1);
    643 static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);
    644 static inline void ___constructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1){
    645     ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))) /* ?{} */);
    646 }
    647 static inline void ___constructor__F_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){
    648     ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))=___src__14s__anonymous23_1.__i__i_1) /* ?{} */);
    649 }
    650 static inline void ___destructor__F_P14s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1){
    651     ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))) /* ^?{} */);
    652 }
    653 static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_P14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){
     640static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);
     641static inline void ___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);
     642static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1);
     643static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1);
     644static inline void ___constructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){
     645    ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ?{} */);
     646}
     647static inline void ___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){
     648    ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1) /* ?{} */);
     649}
     650static inline void ___destructor__F_R14s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1){
     651    ((void)((*___dst__R14s__anonymous23_1).__i__i_1) /* ^?{} */);
     652}
     653static inline struct __anonymous23 ___operator_assign__F14s__anonymous23_R14s__anonymous2314s__anonymous23_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, struct __anonymous23 ___src__14s__anonymous23_1){
    654654    struct __anonymous23 ___ret__14s__anonymous23_1;
    655     ((void)((*___dst__P14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1));
    656     ((void)___constructor__F_P14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1));
     655    ((void)((*___dst__R14s__anonymous23_1).__i__i_1=___src__14s__anonymous23_1.__i__i_1));
     656    ((void)___constructor__F_R14s__anonymous2314s__anonymous23_autogen___1((&___ret__14s__anonymous23_1), ___src__14s__anonymous23_1));
    657657    return ((struct __anonymous23 )___ret__14s__anonymous23_1);
    658658}
    659 static inline void ___constructor__F_P14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__P14s__anonymous23_1, int __i__i_1){
    660     ((void)((*((int *)(&(*___dst__P14s__anonymous23_1).__i__i_1)))=__i__i_1) /* ?{} */);
     659static inline void ___constructor__F_R14s__anonymous23i_autogen___1(struct __anonymous23 *___dst__R14s__anonymous23_1, int __i__i_1){
     660    ((void)((*___dst__R14s__anonymous23_1).__i__i_1=__i__i_1) /* ?{} */);
    661661}
    662662static inline volatile const struct __anonymous23 __f38__FCV14s__anonymous23___1();
     
    687687    __attribute__ ((unused)) int ___retval_main__i_1;
    688688    int _tmp_cp_ret0;
    689     ((void)(___retval_main__i_1=((_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1)) , _tmp_cp_ret0)) /* ?{} */);
    690     ((void)((*((int *)(&_tmp_cp_ret0)))) /* ^?{} */);
     689    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
     690    ((void)(_tmp_cp_ret0) /* ^?{} */);
    691691    return ((int )___retval_main__i_1);
    692692}
  • src/tests/.expect/64/extension.txt

    r54cd58b0 r9236060  
    1313    __extension__ int __c__i_1;
    1414};
    15 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1);
    16 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1);
    17 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1);
    18 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1);
    19 static inline void ___constructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){
    20     ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))) /* ?{} */);
    21     ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))) /* ?{} */);
    22     ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ?{} */);
     15static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
     16static inline void ___constructor__F_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
     17static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1);
     18static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1);
     19static inline void ___constructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
     20    ((void)((*___dst__R2sS_1).__a__i_1) /* ?{} */);
     21    ((void)((*___dst__R2sS_1).__b__i_1) /* ?{} */);
     22    ((void)((*___dst__R2sS_1).__c__i_1) /* ?{} */);
    2323}
    24 static inline void ___constructor__F_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){
    25     ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=___src__2sS_1.__a__i_1) /* ?{} */);
    26     ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))=___src__2sS_1.__b__i_1) /* ?{} */);
    27     ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))=___src__2sS_1.__c__i_1) /* ?{} */);
     24static inline void ___constructor__F_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){
     25    ((void)((*___dst__R2sS_1).__a__i_1=___src__2sS_1.__a__i_1) /* ?{} */);
     26    ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1) /* ?{} */);
     27    ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1) /* ?{} */);
    2828}
    29 static inline void ___destructor__F_P2sS_autogen___1(struct S *___dst__P2sS_1){
    30     ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ^?{} */);
    31     ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))) /* ^?{} */);
    32     ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))) /* ^?{} */);
     29static inline void ___destructor__F_R2sS_autogen___1(struct S *___dst__R2sS_1){
     30    ((void)((*___dst__R2sS_1).__c__i_1) /* ^?{} */);
     31    ((void)((*___dst__R2sS_1).__b__i_1) /* ^?{} */);
     32    ((void)((*___dst__R2sS_1).__a__i_1) /* ^?{} */);
    3333}
    34 static inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___1(struct S *___dst__P2sS_1, struct S ___src__2sS_1){
     34static inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___1(struct S *___dst__R2sS_1, struct S ___src__2sS_1){
    3535    struct S ___ret__2sS_1;
    36     ((void)((*___dst__P2sS_1).__a__i_1=___src__2sS_1.__a__i_1));
    37     ((void)((*___dst__P2sS_1).__b__i_1=___src__2sS_1.__b__i_1));
    38     ((void)((*___dst__P2sS_1).__c__i_1=___src__2sS_1.__c__i_1));
    39     ((void)___constructor__F_P2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
     36    ((void)((*___dst__R2sS_1).__a__i_1=___src__2sS_1.__a__i_1));
     37    ((void)((*___dst__R2sS_1).__b__i_1=___src__2sS_1.__b__i_1));
     38    ((void)((*___dst__R2sS_1).__c__i_1=___src__2sS_1.__c__i_1));
     39    ((void)___constructor__F_R2sS2sS_autogen___1((&___ret__2sS_1), ___src__2sS_1));
    4040    return ((struct S )___ret__2sS_1);
    4141}
    42 static inline void ___constructor__F_P2sSi_autogen___1(struct S *___dst__P2sS_1, int __a__i_1){
    43     ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=__a__i_1) /* ?{} */);
    44     ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))) /* ?{} */);
    45     ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ?{} */);
     42static inline void ___constructor__F_R2sSi_autogen___1(struct S *___dst__R2sS_1, int __a__i_1){
     43    ((void)((*___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);
     44    ((void)((*___dst__R2sS_1).__b__i_1) /* ?{} */);
     45    ((void)((*___dst__R2sS_1).__c__i_1) /* ?{} */);
    4646}
    47 static inline void ___constructor__F_P2sSii_autogen___1(struct S *___dst__P2sS_1, int __a__i_1, int __b__i_1){
    48     ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=__a__i_1) /* ?{} */);
    49     ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))=__b__i_1) /* ?{} */);
    50     ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))) /* ?{} */);
     47static inline void ___constructor__F_R2sSii_autogen___1(struct S *___dst__R2sS_1, int __a__i_1, int __b__i_1){
     48    ((void)((*___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);
     49    ((void)((*___dst__R2sS_1).__b__i_1=__b__i_1) /* ?{} */);
     50    ((void)((*___dst__R2sS_1).__c__i_1) /* ?{} */);
    5151}
    52 static inline void ___constructor__F_P2sSiii_autogen___1(struct S *___dst__P2sS_1, int __a__i_1, int __b__i_1, int __c__i_1){
    53     ((void)((*((int *)(&(*___dst__P2sS_1).__a__i_1)))=__a__i_1) /* ?{} */);
    54     ((void)((*((int *)(&(*___dst__P2sS_1).__b__i_1)))=__b__i_1) /* ?{} */);
    55     ((void)((*((int *)(&(*___dst__P2sS_1).__c__i_1)))=__c__i_1) /* ?{} */);
     52static inline void ___constructor__F_R2sSiii_autogen___1(struct S *___dst__R2sS_1, int __a__i_1, int __b__i_1, int __c__i_1){
     53    ((void)((*___dst__R2sS_1).__a__i_1=__a__i_1) /* ?{} */);
     54    ((void)((*___dst__R2sS_1).__b__i_1=__b__i_1) /* ?{} */);
     55    ((void)((*___dst__R2sS_1).__c__i_1=__c__i_1) /* ?{} */);
    5656}
    5757__extension__ union U {
     
    6060    __extension__ int __c__i_1;
    6161};
    62 static inline void ___constructor__F_P2uU_autogen___1(union U *___dst__P2uU_1){
     62static inline void ___constructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){
    6363}
    64 static inline void ___constructor__F_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){
    65     ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
     64static inline void ___constructor__F_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1){
     65    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    6666}
    67 static inline void ___destructor__F_P2uU_autogen___1(union U *___dst__P2uU_1){
     67static inline void ___destructor__F_R2uU_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1){
    6868}
    69 static inline union U ___operator_assign__F2uU_P2uU2uU_autogen___1(union U *___dst__P2uU_1, union U ___src__2uU_1){
     69static inline union U ___operator_assign__F2uU_R2uU2uU_autogen___1(union U *___dst__R2uU_1, union U ___src__2uU_1){
    7070    union U ___ret__2uU_1;
    71     ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
    72     ((void)___constructor__F_P2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));
     71    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&___src__2uU_1)), sizeof(union U )));
     72    ((void)___constructor__F_R2uU2uU_autogen___1((&___ret__2uU_1), ___src__2uU_1));
    7373    return ((union U )___ret__2uU_1);
    7474}
    75 static inline void ___constructor__F_P2uUi_autogen___1(union U *___dst__P2uU_1, int __src__i_1){
    76     ((void)__builtin_memcpy(((void *)___dst__P2uU_1), ((const void *)(&__src__i_1)), sizeof(int )));
     75static inline void ___constructor__F_R2uUi_autogen___1(__attribute__ ((unused)) union U *___dst__R2uU_1, int __src__i_1){
     76    ((void)__builtin_memcpy(((void *)___dst__R2uU_1), ((const void *)(&__src__i_1)), sizeof(int )));
    7777}
    7878__extension__ enum E {
     
    102102    ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2)));
    103103    int _tmp_cp_ret0;
    104     ((void)((_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3)) , _tmp_cp_ret0));
    105     ((void)((*((int *)(&_tmp_cp_ret0)))) /* ^?{} */);
     104    ((void)(((void)(_tmp_cp_ret0=__extension__ __fred__Fi_i__1(3))) , _tmp_cp_ret0));
     105    ((void)(_tmp_cp_ret0) /* ^?{} */);
    106106    __extension__ int __mary__Fi_i__2(int __p__i_2){
    107107        __attribute__ ((unused)) int ___retval_mary__i_2;
     
    113113    ((void)(((int )((__extension__ __a__i_2>__extension__ __b__i_2)!=((int )0))) ? __extension__ __c__i_2 : __extension__ __c__i_2));
    114114    ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2)));
    115     ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2));
     115    ((void)(((void)(((void)__extension__ __a__i_2) , __extension__ __b__i_2)) , __extension__ __c__i_2));
    116116}
  • src/tests/.expect/64/gccExtensions.txt

    r54cd58b0 r9236060  
    4343        __extension__ int __c__i_2;
    4444    };
    45     inline void ___constructor__F_P2sS_autogen___2(struct S *___dst__P2sS_2){
    46         ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))) /* ?{} */);
    47         ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))) /* ?{} */);
    48         ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ?{} */);
     45    inline void ___constructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
     46        ((void)((*___dst__R2sS_2).__a__i_2) /* ?{} */);
     47        ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
     48        ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    4949    }
    50     inline void ___constructor__F_P2sS2sS_autogen___2(struct S *___dst__P2sS_2, struct S ___src__2sS_2){
    51         ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=___src__2sS_2.__a__i_2) /* ?{} */);
    52         ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))=___src__2sS_2.__b__i_2) /* ?{} */);
    53         ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=___src__2sS_2.__c__i_2) /* ?{} */);
     50    inline void ___constructor__F_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){
     51        ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2) /* ?{} */);
     52        ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2) /* ?{} */);
     53        ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2) /* ?{} */);
    5454    }
    55     inline void ___destructor__F_P2sS_autogen___2(struct S *___dst__P2sS_2){
    56         ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ^?{} */);
    57         ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))) /* ^?{} */);
    58         ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))) /* ^?{} */);
     55    inline void ___destructor__F_R2sS_autogen___2(struct S *___dst__R2sS_2){
     56        ((void)((*___dst__R2sS_2).__c__i_2) /* ^?{} */);
     57        ((void)((*___dst__R2sS_2).__b__i_2) /* ^?{} */);
     58        ((void)((*___dst__R2sS_2).__a__i_2) /* ^?{} */);
    5959    }
    60     inline struct S ___operator_assign__F2sS_P2sS2sS_autogen___2(struct S *___dst__P2sS_2, struct S ___src__2sS_2){
     60    inline struct S ___operator_assign__F2sS_R2sS2sS_autogen___2(struct S *___dst__R2sS_2, struct S ___src__2sS_2){
    6161        struct S ___ret__2sS_2;
    62         ((void)((*___dst__P2sS_2).__a__i_2=___src__2sS_2.__a__i_2));
    63         ((void)((*___dst__P2sS_2).__b__i_2=___src__2sS_2.__b__i_2));
    64         ((void)((*___dst__P2sS_2).__c__i_2=___src__2sS_2.__c__i_2));
    65         ((void)___constructor__F_P2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));
     62        ((void)((*___dst__R2sS_2).__a__i_2=___src__2sS_2.__a__i_2));
     63        ((void)((*___dst__R2sS_2).__b__i_2=___src__2sS_2.__b__i_2));
     64        ((void)((*___dst__R2sS_2).__c__i_2=___src__2sS_2.__c__i_2));
     65        ((void)___constructor__F_R2sS2sS_autogen___2((&___ret__2sS_2), ___src__2sS_2));
    6666        return ((struct S )___ret__2sS_2);
    6767    }
    68     inline void ___constructor__F_P2sSi_autogen___2(struct S *___dst__P2sS_2, int __a__i_2){
    69         ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=__a__i_2) /* ?{} */);
    70         ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))) /* ?{} */);
    71         ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ?{} */);
     68    inline void ___constructor__F_R2sSi_autogen___2(struct S *___dst__R2sS_2, int __a__i_2){
     69        ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
     70        ((void)((*___dst__R2sS_2).__b__i_2) /* ?{} */);
     71        ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    7272    }
    73     inline void ___constructor__F_P2sSii_autogen___2(struct S *___dst__P2sS_2, int __a__i_2, int __b__i_2){
    74         ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=__a__i_2) /* ?{} */);
    75         ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))=__b__i_2) /* ?{} */);
    76         ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))) /* ?{} */);
     73    inline void ___constructor__F_R2sSii_autogen___2(struct S *___dst__R2sS_2, int __a__i_2, int __b__i_2){
     74        ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
     75        ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
     76        ((void)((*___dst__R2sS_2).__c__i_2) /* ?{} */);
    7777    }
    78     inline void ___constructor__F_P2sSiii_autogen___2(struct S *___dst__P2sS_2, int __a__i_2, int __b__i_2, int __c__i_2){
    79         ((void)((*((int *)(&(*___dst__P2sS_2).__a__i_2)))=__a__i_2) /* ?{} */);
    80         ((void)((*((int *)(&(*___dst__P2sS_2).__b__i_2)))=__b__i_2) /* ?{} */);
    81         ((void)((*((int *)(&(*___dst__P2sS_2).__c__i_2)))=__c__i_2) /* ?{} */);
     78    inline void ___constructor__F_R2sSiii_autogen___2(struct S *___dst__R2sS_2, int __a__i_2, int __b__i_2, int __c__i_2){
     79        ((void)((*___dst__R2sS_2).__a__i_2=__a__i_2) /* ?{} */);
     80        ((void)((*___dst__R2sS_2).__b__i_2=__b__i_2) /* ?{} */);
     81        ((void)((*___dst__R2sS_2).__c__i_2=__c__i_2) /* ?{} */);
    8282    }
    8383    int __i__i_2 = ((int )__extension__ 3);
     
    8585    __extension__ int __b__i_2;
    8686    __extension__ int __c__i_2;
    87     ((void)((__extension__ __a__i_2 , __extension__ __b__i_2) , __extension__ __c__i_2));
     87    ((void)(((void)(((void)__extension__ __a__i_2) , __extension__ __b__i_2)) , __extension__ __c__i_2));
    8888    ((void)(__extension__ __a__i_2=(__extension__ __b__i_2+__extension__ __c__i_2)));
    8989    ((void)(__extension__ __a__i_2=__extension__ (__extension__ __b__i_2+__extension__ __c__i_2)));
     
    101101        int __i__i_2;
    102102    };
    103     inline void ___constructor__F_P3ss2_autogen___2(struct s2 *___dst__P3ss2_2){
    104         ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))) /* ?{} */);
     103    inline void ___constructor__F_R3ss2_autogen___2(struct s2 *___dst__R3ss2_2){
     104        ((void)((*___dst__R3ss2_2).__i__i_2) /* ?{} */);
    105105    }
    106     inline void ___constructor__F_P3ss23ss2_autogen___2(struct s2 *___dst__P3ss2_2, struct s2 ___src__3ss2_2){
    107         ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))=___src__3ss2_2.__i__i_2) /* ?{} */);
     106    inline void ___constructor__F_R3ss23ss2_autogen___2(struct s2 *___dst__R3ss2_2, struct s2 ___src__3ss2_2){
     107        ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2) /* ?{} */);
    108108    }
    109     inline void ___destructor__F_P3ss2_autogen___2(struct s2 *___dst__P3ss2_2){
    110         ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))) /* ^?{} */);
     109    inline void ___destructor__F_R3ss2_autogen___2(struct s2 *___dst__R3ss2_2){
     110        ((void)((*___dst__R3ss2_2).__i__i_2) /* ^?{} */);
    111111    }
    112     inline struct s2 ___operator_assign__F3ss2_P3ss23ss2_autogen___2(struct s2 *___dst__P3ss2_2, struct s2 ___src__3ss2_2){
     112    inline struct s2 ___operator_assign__F3ss2_R3ss23ss2_autogen___2(struct s2 *___dst__R3ss2_2, struct s2 ___src__3ss2_2){
    113113        struct s2 ___ret__3ss2_2;
    114         ((void)((*___dst__P3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2));
    115         ((void)___constructor__F_P3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));
     114        ((void)((*___dst__R3ss2_2).__i__i_2=___src__3ss2_2.__i__i_2));
     115        ((void)___constructor__F_R3ss23ss2_autogen___2((&___ret__3ss2_2), ___src__3ss2_2));
    116116        return ((struct s2 )___ret__3ss2_2);
    117117    }
    118     inline void ___constructor__F_P3ss2i_autogen___2(struct s2 *___dst__P3ss2_2, int __i__i_2){
    119         ((void)((*((int *)(&(*___dst__P3ss2_2).__i__i_2)))=__i__i_2) /* ?{} */);
     118    inline void ___constructor__F_R3ss2i_autogen___2(struct s2 *___dst__R3ss2_2, int __i__i_2){
     119        ((void)((*___dst__R3ss2_2).__i__i_2=__i__i_2) /* ?{} */);
    120120    }
    121121    struct s3 {
    122122        int __i__i_2;
    123123    };
    124     inline void ___constructor__F_P3ss3_autogen___2(struct s3 *___dst__P3ss3_2){
    125         ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))) /* ?{} */);
     124    inline void ___constructor__F_R3ss3_autogen___2(struct s3 *___dst__R3ss3_2){
     125        ((void)((*___dst__R3ss3_2).__i__i_2) /* ?{} */);
    126126    }
    127     inline void ___constructor__F_P3ss33ss3_autogen___2(struct s3 *___dst__P3ss3_2, struct s3 ___src__3ss3_2){
    128         ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))=___src__3ss3_2.__i__i_2) /* ?{} */);
     127    inline void ___constructor__F_R3ss33ss3_autogen___2(struct s3 *___dst__R3ss3_2, struct s3 ___src__3ss3_2){
     128        ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2) /* ?{} */);
    129129    }
    130     inline void ___destructor__F_P3ss3_autogen___2(struct s3 *___dst__P3ss3_2){
    131         ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))) /* ^?{} */);
     130    inline void ___destructor__F_R3ss3_autogen___2(struct s3 *___dst__R3ss3_2){
     131        ((void)((*___dst__R3ss3_2).__i__i_2) /* ^?{} */);
    132132    }
    133     inline struct s3 ___operator_assign__F3ss3_P3ss33ss3_autogen___2(struct s3 *___dst__P3ss3_2, struct s3 ___src__3ss3_2){
     133    inline struct s3 ___operator_assign__F3ss3_R3ss33ss3_autogen___2(struct s3 *___dst__R3ss3_2, struct s3 ___src__3ss3_2){
    134134        struct s3 ___ret__3ss3_2;
    135         ((void)((*___dst__P3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2));
    136         ((void)___constructor__F_P3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));
     135        ((void)((*___dst__R3ss3_2).__i__i_2=___src__3ss3_2.__i__i_2));
     136        ((void)___constructor__F_R3ss33ss3_autogen___2((&___ret__3ss3_2), ___src__3ss3_2));
    137137        return ((struct s3 )___ret__3ss3_2);
    138138    }
    139     inline void ___constructor__F_P3ss3i_autogen___2(struct s3 *___dst__P3ss3_2, int __i__i_2){
    140         ((void)((*((int *)(&(*___dst__P3ss3_2).__i__i_2)))=__i__i_2) /* ?{} */);
     139    inline void ___constructor__F_R3ss3i_autogen___2(struct s3 *___dst__R3ss3_2, int __i__i_2){
     140        ((void)((*___dst__R3ss3_2).__i__i_2=__i__i_2) /* ?{} */);
    141141    }
    142142    struct s3 __x1__3ss3_2;
     
    145145        int __i__i_2;
    146146    };
    147     inline void ___constructor__F_P3ss4_autogen___2(struct s4 *___dst__P3ss4_2){
    148         ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))) /* ?{} */);
     147    inline void ___constructor__F_R3ss4_autogen___2(struct s4 *___dst__R3ss4_2){
     148        ((void)((*___dst__R3ss4_2).__i__i_2) /* ?{} */);
    149149    }
    150     inline void ___constructor__F_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){
    151         ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))=___src__3ss4_2.__i__i_2) /* ?{} */);
     150    inline void ___constructor__F_R3ss43ss4_autogen___2(struct s4 *___dst__R3ss4_2, struct s4 ___src__3ss4_2){
     151        ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2) /* ?{} */);
    152152    }
    153     inline void ___destructor__F_P3ss4_autogen___2(struct s4 *___dst__P3ss4_2){
    154         ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))) /* ^?{} */);
     153    inline void ___destructor__F_R3ss4_autogen___2(struct s4 *___dst__R3ss4_2){
     154        ((void)((*___dst__R3ss4_2).__i__i_2) /* ^?{} */);
    155155    }
    156     inline struct s4 ___operator_assign__F3ss4_P3ss43ss4_autogen___2(struct s4 *___dst__P3ss4_2, struct s4 ___src__3ss4_2){
     156    inline struct s4 ___operator_assign__F3ss4_R3ss43ss4_autogen___2(struct s4 *___dst__R3ss4_2, struct s4 ___src__3ss4_2){
    157157        struct s4 ___ret__3ss4_2;
    158         ((void)((*___dst__P3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));
    159         ((void)___constructor__F_P3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));
     158        ((void)((*___dst__R3ss4_2).__i__i_2=___src__3ss4_2.__i__i_2));
     159        ((void)___constructor__F_R3ss43ss4_autogen___2((&___ret__3ss4_2), ___src__3ss4_2));
    160160        return ((struct s4 )___ret__3ss4_2);
    161161    }
    162     inline void ___constructor__F_P3ss4i_autogen___2(struct s4 *___dst__P3ss4_2, int __i__i_2){
    163         ((void)((*((int *)(&(*___dst__P3ss4_2).__i__i_2)))=__i__i_2) /* ?{} */);
     162    inline void ___constructor__F_R3ss4i_autogen___2(struct s4 *___dst__R3ss4_2, int __i__i_2){
     163        ((void)((*___dst__R3ss4_2).__i__i_2=__i__i_2) /* ?{} */);
    164164    }
    165165    struct s4 __x2__3ss4_2;
     
    184184    __attribute__ ((unused)) int ___retval_main__i_1;
    185185    int _tmp_cp_ret0;
    186     ((void)(___retval_main__i_1=((_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1)) , _tmp_cp_ret0)) /* ?{} */);
    187     ((void)((*((int *)(&_tmp_cp_ret0)))) /* ^?{} */);
     186    ((void)(___retval_main__i_1=(((void)(_tmp_cp_ret0=invoke_main(__argc__i_1, __argv__PPc_1, __envp__PPc_1))) , _tmp_cp_ret0)) /* ?{} */);
     187    ((void)(_tmp_cp_ret0) /* ^?{} */);
    188188    return ((int )___retval_main__i_1);
    189189}
  • src/tests/.expect/castError.txt

    r54cd58b0 r9236060  
    44to:
    55  char
    6 Alternatives are:        Cost ( 1, 0, 0 ): Cast of:
     6Alternatives are:        Cost ( 1, 0, 0, 0 ): Cast of:
    77          Variable Expression: f: function
    88                accepting unspecified arguments
     
    1818        Environment:
    1919
    20         Cost ( 1, 0, 0 ): Cast of:
     20        Cost ( 1, 0, 0, 0 ): Cast of:
    2121          Variable Expression: f: signed int
    2222
     
    2828        Environment:
    2929
    30         Cost ( 1, 0, 0 ): Cast of:
     30        Cost ( 1, 0, 0, 0 ): Cast of:
    3131          Variable Expression: f: double
    3232
  • src/tests/.expect/memberCtors-ERR1.txt

    r54cd58b0 r9236060  
    1 memberCtors.c:71 error: in void ?{}(B *b), field a2 used before being constructed
     1memberCtors.c:71 error: in void ?{}(B &b), field a2 used before being constructed
  • src/tests/.expect/memberCtors.txt

    r54cd58b0 r9236060  
    77constructing int
    88begin construct B
    9 assign b->a2
    10 constructing int
    11 constructing int
    12 begin construct A
    13 construct a->x
     9assign b.a2
     10constructing int
     11constructing int
     12begin construct A
     13construct a.x
    1414constructing int: 1001
    15 assign a->y
    16 assigning int: 0 0
    17 end construct A
    18 copy constructing int: 0
    19 copy constructing int: 0
    20 begin copy construct A
    21 copy construct this->x
    22 copy constructing int: 1001
    23 assign this->y
     15assign a.y
     16assigning int: 0 0
     17end construct A
     18copy constructing int: 0
     19copy constructing int: 0
     20begin copy construct A
     21copy construct this.x
     22copy constructing int: 1001
     23assign this.y
    2424copy constructing int: 0
    2525destructing int: 0
     
    4040copy constructing int: 0
    4141begin copy construct A
    42 copy construct this->x
    43 copy constructing int: 1001
    44 assign this->y
    45 copy constructing int: 0
    46 destructing int: 0
    47 destructing int: 0
    48 end copy construct A
    49 destructing int: 0
    50 destructing int: 0
    51 destructing int: 1001
    52 destructing int: 0
    53 destructing int: 0
    54 destructing int: 1001
    55 construct b->a1
    56 constructing int
    57 constructing int
    58 begin construct A
    59 construct a->x
     42copy construct this.x
     43copy constructing int: 1001
     44assign this.y
     45copy constructing int: 0
     46destructing int: 0
     47destructing int: 0
     48end copy construct A
     49destructing int: 0
     50destructing int: 0
     51destructing int: 1001
     52destructing int: 0
     53destructing int: 0
     54destructing int: 1001
     55construct b.a1
     56constructing int
     57constructing int
     58begin construct A
     59construct a.x
    6060constructing int: 1000
    61 assign a->y
     61assign a.y
    6262assigning int: 0 0
    6363end construct A
     
    7070copy constructing int: 0
    7171begin copy construct A
    72 copy construct this->x
     72copy construct this.x
    7373copy constructing int: 1000
    74 assign this->y
    75 copy constructing int: 0
    76 destructing int: 0
    77 destructing int: 0
    78 end copy construct A
    79 copy constructing int: 0
    80 copy constructing int: 0
    81 begin copy construct A
    82 copy construct this->x
    83 copy constructing int: 1001
    84 assign this->y
    85 copy constructing int: 0
    86 destructing int: 0
    87 destructing int: 0
    88 end copy construct A
    89 copy constructing int: 0
    90 copy constructing int: 0
    91 begin copy construct A
    92 copy construct this->x
    93 copy constructing int: 0
    94 assign this->y
     74assign this.y
     75copy constructing int: 0
     76destructing int: 0
     77destructing int: 0
     78end copy construct A
     79copy constructing int: 0
     80copy constructing int: 0
     81begin copy construct A
     82copy construct this.x
     83copy constructing int: 1001
     84assign this.y
     85copy constructing int: 0
     86destructing int: 0
     87destructing int: 0
     88end copy construct A
     89copy constructing int: 0
     90copy constructing int: 0
     91begin copy construct A
     92copy construct this.x
     93copy constructing int: 0
     94assign this.y
    9595copy constructing int: 0
    9696destructing int: 0
     
    101101constructing int
    102102begin construct A
    103 construct a->x
     103construct a.x
    104104constructing int: 999
    105 assign a->y
    106 assigning int: 0 0
    107 end construct A
    108 copy constructing int: 0
    109 copy constructing int: 0
    110 begin copy construct A
    111 copy construct this->x
    112 copy constructing int: 999
    113 assign this->y
     105assign a.y
     106assigning int: 0 0
     107end construct A
     108copy constructing int: 0
     109copy constructing int: 0
     110begin copy construct A
     111copy construct this.x
     112copy constructing int: 999
     113assign this.y
    114114copy constructing int: 0
    115115destructing int: 0
     
    130130copy constructing int: 0
    131131begin copy construct A
    132 copy construct this->x
    133 copy constructing int: 999
    134 assign this->y
     132copy construct this.x
     133copy constructing int: 999
     134assign this.y
    135135copy constructing int: 0
    136136destructing int: 0
     
    158158constructing int
    159159begin construct A
    160 construct a->x
     160construct a.x
    161161constructing int: 999
    162 assign a->y
    163 assigning int: 0 0
    164 end construct A
    165 copy constructing int: 0
    166 copy constructing int: 0
    167 begin copy construct A
    168 copy construct this->x
    169 copy constructing int: 999
    170 assign this->y
     162assign a.y
     163assigning int: 0 0
     164end construct A
     165copy constructing int: 0
     166copy constructing int: 0
     167begin copy construct A
     168copy construct this.x
     169copy constructing int: 999
     170assign this.y
    171171copy constructing int: 0
    172172destructing int: 0
     
    187187copy constructing int: 0
    188188begin copy construct A
    189 copy construct this->x
    190 copy constructing int: 999
    191 assign this->y
     189copy construct this.x
     190copy constructing int: 999
     191assign this.y
    192192copy constructing int: 0
    193193destructing int: 0
  • src/tests/alloc.c

    r54cd58b0 r9236060  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
     
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // alloc.c -- 
    8 // 
     7// alloc.c --
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Wed Feb  3 07:56:22 2016
     
    1212// Last Modified On : Thu Jul 20 16:01:10 2017
    1313// Update Count     : 318
    14 // 
     14//
    1515
    1616#include <assert.h>
     
    1919#include <stdlib.h>                                                                             // posix_memalign
    2020#include <fstream>
    21 #include <stdlib>                                                                               // access C malloc, realloc
     21#include <stdlib>                                                                                       // access C malloc, realloc
    2222
    2323int * foo( int * p, int c ) { return p; }
     
    2626
    2727int main( void ) {
    28     size_t dim = 10;
    29     int * p;
     28        size_t dim = 10;
     29        int * p;
    3030        char fill = '\1';
    3131
    3232        // allocation, non-array types
    3333
    34     p = (void *)malloc( sizeof(*p) );                                   // C malloc, type unsafe
     34        p = (void *)malloc( sizeof(*p) );                   // C malloc, type unsafe
    3535        *p = 0xdeadbeef;
    3636        printf( "C   malloc %#x\n", *p );
    37     free( p );
    38 
    39     p = malloc();                                                                               // CFA malloc, type safe
     37        free( p );
     38
     39        p = malloc();                                       // CFA malloc, type safe
    4040        *p = 0xdeadbeef;
    4141        printf( "CFA malloc %#x\n", *p );
    42     free( p );
    43 
    44     p = alloc();                                                                                // CFA alloc, type safe
     42        free( p );
     43
     44        p = alloc();                                        // CFA alloc, type safe
    4545        *p = 0xdeadbeef;
    4646        printf( "CFA alloc %#x\n", *p );
    47     free( p );
    48 
    49     p = alloc( fill );                                                                  // CFA alloc, fill
     47        free( p );
     48
     49        p = alloc( fill );                                  // CFA alloc, fill
    5050        printf( "CFA alloc, fill %08x\n", *p );
    5151
     
    5454        printf( "\n" );
    5555
    56     p = calloc( dim, sizeof( *p ) );                                    // C array calloc, type unsafe
     56        p = calloc( dim, sizeof( *p ) );                    // C array calloc, type unsafe
    5757        printf( "C   array calloc, fill 0\n" );
    5858        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
    5959        printf( "\n" );
    60     free( p );
    61 
    62     p = calloc( dim );                                                                  // CFA array calloc, type safe
     60        free( p );
     61
     62        p = calloc( dim );                                  // CFA array calloc, type safe
    6363        printf( "CFA array calloc, fill 0\n" );
    6464        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
    6565        printf( "\n" );
    66     free( p );
    67 
    68     p = alloc( dim );                                                                   // CFA array alloc, type safe
     66        free( p );
     67
     68        p = alloc( dim );                                   // CFA array alloc, type safe
    6969        for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; }
    7070        printf( "CFA array alloc, no fill\n" );
    7171        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
    7272        printf( "\n" );
    73     free( p );
    74 
    75     p = alloc( 2 * dim, fill );                                                 // CFA array alloc, fill
     73        free( p );
     74
     75        p = alloc( 2 * dim, fill );                         // CFA array alloc, fill
    7676        printf( "CFA array alloc, fill %#x\n", fill );
    7777        for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); }
     
    8383        printf( "\n" );
    8484
    85     p = (void *)realloc( p, dim * sizeof(*p) );                 // C realloc
     85        p = (void *)realloc( p, dim * sizeof(*p) );         // C realloc
    8686        for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; }
    8787        printf( "C   realloc\n" );
     
    8989        printf( "\n" );
    9090
    91     p = realloc( p, 2 * dim * sizeof(*p) );                             // CFA realloc
     91        p = realloc( p, 2 * dim * sizeof(*p) );             // CFA realloc
    9292        for ( int i = dim; i < 2 * dim; i += 1 ) { p[i] = 0x1010101; }
    9393        printf( "CFA realloc\n" );
     
    100100        printf( "\n" );
    101101
    102     p = alloc( p, dim );                                                                // CFA resize array alloc
     102        p = alloc( p, dim );                                // CFA resize array alloc
    103103        for ( int i = 0; i < dim; i += 1 ) { p[i] = 0xdeadbeef; }
    104104        printf( "CFA resize alloc\n" );
     
    106106        printf( "\n" );
    107107
    108     p = alloc( p, 2 * dim );                                                    // CFA resize array alloc
     108        p = alloc( p, 2 * dim );                            // CFA resize array alloc
    109109        for ( int i = dim; i < 2 * dim; i += 1 ) { p[i] = 0x1010101; }
    110110        printf( "CFA resize array alloc\n" );
     
    112112        printf( "\n" );
    113113
    114     p = alloc( p, dim );                                                                // CFA array alloc
     114        p = alloc( p, dim );                                // CFA array alloc
    115115        printf( "CFA resize array alloc\n" );
    116116        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
     
    120120        p = 0;
    121121
    122     p = alloc( p, dim, fill );                                                  // CFA array alloc, fill
     122        p = alloc( p, dim, fill );                          // CFA array alloc, fill
    123123        printf( "CFA resize array alloc, fill\n" );
    124124        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] ); }
    125125        printf( "\n" );
    126126
    127     p = alloc( p, 2 * dim, fill );                                              // CFA array alloc, fill
     127        p = alloc( p, 2 * dim, fill );                      // CFA array alloc, fill
    128128        printf( "CFA resize array alloc, fill\n" );
    129129        for ( int i = 0; i < 2 * dim; i += 1 ) { printf( "%#x ", p[i] ); }
    130130        printf( "\n" );
    131131
    132     p = alloc( p, dim, fill );                                                  // CFA array alloc, fill
     132        p = alloc( p, dim, fill );                          // CFA array alloc, fill
    133133        printf( "CFA resize array alloc, fill\n" );
    134134        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x ", p[i] );; }
     
    137137
    138138
    139     struct Struct { int x; double y; };
    140     Struct st, st1, sta[dim], sta1[dim], * stp, * stp1;
     139        struct Struct { int x; double y; };
     140        Struct st, st1, sta[dim], sta1[dim], * stp, * stp1;
    141141
    142142        // alignment, non-array types
     
    144144        enum { Alignment = 128 };
    145145
    146     stp = (memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign
     146        stp = (memalign( Alignment, sizeof( *stp ) ) ){ 42, 42.5 }; // C memalign
    147147        assert( (uintptr_t)stp % Alignment == 0 );
    148148        printf( "C   memalign %d %g\n", stp->x, stp->y );
    149     free( stp );
    150 
    151     stp = (memalign( Alignment )){ 42, 42.5 };                  // CFA memalign
     149        free( stp );
     150
     151        stp = (memalign( Alignment )){ 42, 42.5 };          // CFA memalign
    152152        assert( (uintptr_t)stp % Alignment == 0 );
    153153        printf( "CFA memalign %d %g\n", stp->x, stp->y );
    154     free( stp );
    155 
    156     posix_memalign( (void **)&stp, Alignment, sizeof( *stp ) ); // C posix_memalign
     154        free( stp );
     155
     156        posix_memalign( (void **)&stp, Alignment, sizeof( *stp ) ); // C posix_memalign
    157157        *stp = (Struct){ 42, 42.5 };
    158158        assert( (uintptr_t)stp % Alignment == 0 );
    159159        printf( "CFA posix_memalign %d %g\n", stp->x, stp->y );
    160     free( stp );
    161 
    162     posix_memalign( &stp, Alignment );                                  // CFA posix_memalign
     160        free( stp );
     161
     162        posix_memalign( &stp, Alignment );                  // CFA posix_memalign
    163163        *stp = (Struct){ 42, 42.5 };
    164164        assert( (uintptr_t)stp % Alignment == 0 );
    165165        printf( "CFA posix_memalign %d %g\n", stp->x, stp->y );
    166     free( stp );
    167 
    168     stp = (aligned_alloc( Alignment )){ 42, 42.5 };             // CFA aligned_alloc
     166        free( stp );
     167
     168        stp = (aligned_alloc( Alignment )){ 42, 42.5 };     // CFA aligned_alloc
    169169        assert( (uintptr_t)stp % Alignment == 0 );
    170170        printf( "CFA aligned_alloc %d %g\n", stp->x, stp->y );
    171     free( stp );
    172 
    173     stp = (align_alloc( Alignment )){ 42, 42.5 };               // CFA align_alloc
     171        free( stp );
     172
     173        stp = (align_alloc( Alignment )){ 42, 42.5 };       // CFA align_alloc
    174174        assert( (uintptr_t)stp % Alignment == 0 );
    175175        printf( "CFA align_alloc %d %g\n", stp->x, stp->y );
    176     free( stp );
    177 
    178     stp = align_alloc( Alignment, fill );                               // CFA memalign, fill
     176        free( stp );
     177
     178        stp = align_alloc( Alignment, fill );               // CFA memalign, fill
    179179        assert( (uintptr_t)stp % Alignment == 0 );
    180180        printf( "CFA align_alloc fill %#x %a\n", stp->x, stp->y );
    181     free( stp );
     181        free( stp );
    182182
    183183
     
    185185        printf( "\n" );
    186186
    187     stp = align_alloc( Alignment, dim );                                // CFA array memalign
     187        stp = align_alloc( Alignment, dim );                // CFA array memalign
    188188        assert( (uintptr_t)stp % Alignment == 0 );
    189189        for ( int i = 0; i < dim; i += 1 ) { stp[i] = (Struct){ 42, 42.5 }; }
     
    191191        for ( int i = 0; i < dim; i += 1 ) { printf( "%d %g, ", stp[i].x, stp[i].y ); }
    192192        printf( "\n" );
    193     free( stp );
    194 
    195     stp = align_alloc( Alignment, dim, fill );                  // CFA array memalign, fill
     193        free( stp );
     194
     195        stp = align_alloc( Alignment, dim, fill );          // CFA array memalign, fill
    196196        assert( (uintptr_t)stp % Alignment == 0 );
    197197        printf( "CFA array align_alloc, fill\n" );
    198198        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", stp[i].x, stp[i].y ); }
    199199        printf( "\n" );
    200     free( stp );
     200        free( stp );
    201201
    202202
     
    204204        printf( "\n" );
    205205
    206     memset( &st, fill );                                                                // CFA memset, type safe
     206        memset( &st, fill );                                // CFA memset, type safe
    207207        printf( "CFA memset %#x %a\n", st.x, st.y );
    208     memcpy( &st1, &st );                                                                // CFA memcpy, type safe
     208        memcpy( &st1, &st );                                // CFA memcpy, type safe
    209209        printf( "CFA memcpy %#x %a\n", st1.x, st1.y );
    210210
     
    213213        printf( "\n" );
    214214
    215     memset( sta, dim, fill );                                                   // CFA array memset, type safe
     215        memset( sta, dim, fill );                           // CFA array memset, type safe
    216216        printf( "CFA array memset\n" );
    217217        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", sta[i].x, sta[i].y ); }
    218218        printf( "\n" );
    219219
    220     memcpy( sta1, sta, dim );                                                   // CFA array memcpy, type safe
     220        memcpy( sta1, sta, dim );                           // CFA array memcpy, type safe
    221221        printf( "CFA memcpy\n" );
    222222        for ( int i = 0; i < dim; i += 1 ) { printf( "%#x %a, ", sta1[i].x, sta1[i].y ); }
     
    245245        printf( "\n" );
    246246
    247     float * fp = malloc() + 1;
    248     printf( "pointer arithmetic %d\n", fp == fp - 1 );
    249     free( fp - 1 );
    250 
    251     p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
     247        float * fp = malloc() + 1;
     248        printf( "pointer arithmetic %d\n", fp == fp - 1 );
     249        free( fp - 1 );
     250
     251        p = foo( bar( baz( malloc(), 0 ), 0 ), 0 );
    252252        *p = 0xdeadbeef;
    253253        printf( "CFA deep malloc %#x\n", *p );
    254     free( p );
     254        free( p );
    255255
    256256        stp = malloc();
    257257        printf( "\nSHOULD FAIL\n" );
    258     p = alloc( stp, dim * sizeof(*stp) );
    259     p = memset( stp, 10 );
    260     p = memcpy( &st1, &st );
     258        p = alloc( stp, dim * sizeof(*stp) );
     259        p = memset( stp, 10 );
     260        p = memcpy( &st1, &st );
    261261} // main
    262262
  • src/tests/avltree/avl.h

    r54cd58b0 r9236060  
    2222// forall( otype T, ttype Params | { void ?{}(T *, Params); } ) T * new( Params p );
    2323
    24 forall(dtype T | { void ^?{}(T *); })
     24forall(dtype T | { void ^?{}(T &); })
    2525void delete(T * x);
    2626
     
    5858
    5959forall(otype K | Comparable(K), otype V)
    60 void ?{}(tree(K, V) *t, K key, V value);
     60void ?{}(tree(K, V) &t, K key, V value);
    6161
    6262forall(otype K, otype V)
    63 void ^?{}(tree(K, V) * t);
     63void ^?{}(tree(K, V) & t);
    6464
    6565forall(otype K | Comparable(K), otype V)
  • src/tests/avltree/avl1.c

    r54cd58b0 r9236060  
    33
    44forall(otype K | Comparable(K), otype V)
    5 void ?{}(tree(K, V) *t, K key, V value){
    6   (&t->key) { key };
    7   (&t->value) { value };
    8   t->parent = NULL;
    9   t->left = NULL;
    10   t->right = NULL;
    11   t->balance = 0;
     5void ?{}(tree(K, V) &t, K key, V value){
     6  (t.key) { key };
     7  (t.value) { value };
     8  t.parent = NULL;
     9  t.left = NULL;
     10  t.right = NULL;
     11  t.balance = 0;
    1212}
    1313
    1414forall(otype K, otype V)
    15 void ^?{}(tree(K, V) * t){
    16   delete(t->left);
    17   delete(t->right);
    18   ^(&t->key){};
    19   ^(&t->value){};
     15void ^?{}(tree(K, V) & t){
     16  delete(t.left);
     17  delete(t.right);
     18  ^(t.key){};
     19  ^(t.value){};
    2020}
    2121
     
    2424  // infinite loop trying to resolve ... t = malloc();
    2525  tree(K, V) * t = malloc(sizeof(tree(K,V)));
    26   t { key, value };
     26  (*t){ key, value };
    2727  return t;
    2828}
  • src/tests/coroutine.c

    r54cd58b0 r9236060  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2017 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
    7 // fibonacci.c -- 
    8 // 
     6//
     7// fibonacci.c --
     8//
    99// Author           : Thierry Delisle
    1010// Created On       : Thu Jun  8 07:29:37 2017
     
    1212// Last Modified On : Thu Jun  8 07:37:12 2017
    1313// Update Count     : 5
    14 // 
     14//
    1515
    1616#include <fstream>
     
    2121};
    2222
    23 void ?{}( Fibonacci * this ) {
    24         this->fn = 0;
     23void ?{}( Fibonacci & this ) {
     24        this.fn = 0;
    2525}
    2626
    27 void main( Fibonacci * this ) {
     27void main( Fibonacci & this ) {
    2828        int fn1, fn2;                                   // retained between resumes
    29         this->fn = 0;                                   // case 0
    30         fn1 = this->fn;
     29        this.fn = 0;                                    // case 0
     30        fn1 = this.fn;
    3131        suspend();                                              // return to last resume
    3232
    33         this->fn = 1;                                   // case 1
     33        this.fn = 1;                                    // case 1
    3434        fn2 = fn1;
    35         fn1 = this->fn;
     35        fn1 = this.fn;
    3636        suspend();                                              // return to last resume
    3737
    3838        for ( ;; ) {                                    // general case
    39                 this->fn = fn1 + fn2;
     39                this.fn = fn1 + fn2;
    4040                fn2 = fn1;
    41                 fn1 = this->fn;
     41                fn1 = this.fn;
    4242                suspend();                                      // return to last resume
    4343        } // for
    4444}
    4545
    46 int next( Fibonacci * this ) {
     46int next( Fibonacci & this ) {
    4747        resume( this );                                 // transfer to last suspend
    48         return this->fn;
     48        return this.fn;
    4949}
    5050
     
    5252        Fibonacci f1, f2;
    5353        for ( int i = 1; i <= 10; i += 1 ) {
    54                 sout | next( &f1 ) | ' ' | next( &f2 ) | endl;
     54                sout | next( f1 ) | ' ' | next( f2 ) | endl;
    5555        } // for
    5656}
  • src/tests/dtor-early-exit.c

    r54cd58b0 r9236060  
    2727
    2828// don't want these called
    29 void ?{}(A * a) { assert( false ); }
    30 void ?{}(A * a, const char * name) { a->name = name; sout | "construct " | name | endl; a->x = (int*)malloc(); }
    31 void ?{}(A * a, const char * name, int * ptr) { assert( false ); }
    32 
    33 A ?=?(A * a, A a) {  sout | "assign " | a->name | " " | a.name; return a; }
    34 void ?{}(A * a, A a) { sout | "copy construct " | a.name | endl; a->x = (int*)malloc(); }
    35 void ^?{}(A * a) { sout | "destruct " | a->name | endl; free(a->x); }
     29void ?{}(A & a) { assert( false ); }
     30void ?{}(A & a, const char * name) { a.name = name; sout | "construct " | name | endl; a.x = (int*)malloc(); }
     31void ?{}(A & a, const char * name, int * ptr) { assert( false ); }
     32
     33A ?=?(A & a, A b) {  sout | "assign " | a.name | " " | b.name; return a; }
     34void ?{}(A & a, A b) { sout | "copy construct " | b.name | endl; a.x = (int*)malloc(); }
     35void ^?{}(A & a) { sout | "destruct " | a.name | endl; free(a.x); }
    3636
    3737// test returns
  • src/tests/globals.c

    r54cd58b0 r9236060  
    55};
    66
    7 void ?{}( value_t * this ) { this->value = 22; }
     7void ?{}( value_t & this ) { this.value = 22; }
    88
    99//Standard case
     
    1212};
    1313
    14 void ?{}( g_t * this ) { (&this->val){}; }
     14void ?{}( g_t & this ) { (this.val){}; }
    1515
    1616g_t g;
     
    2525//Inline case
    2626struct gi_t;
    27 void ?{}( gi_t * this );
     27void ?{}( gi_t & this );
    2828
    2929struct gi_t {
     
    3131} gi;
    3232
    33 void ?{}( gi_t * this ) { (&this->val){}; }
     33void ?{}( gi_t & this ) { (this.val){}; }
    3434
    3535//Inline autogen case
     
    4343};
    4444
    45 void ?{}( gs_t * this ) { (&this->val){}; }
     45void ?{}( gs_t & this ) { (this.val){}; }
    4646
    4747static gs_t gs;
     
    5656//Static inline case
    5757struct gsi_t;
    58 void ?{}( gsi_t * this );
     58void ?{}( gsi_t & this );
    5959
    6060static struct gsi_t {
     
    6262} gsi;
    6363
    64 void ?{}( gsi_t * this ) { (&this->val){}; }
     64void ?{}( gsi_t & this ) { (this.val){}; }
    6565
    6666//Static inline autogen case
  • src/tests/init_once.c

    r54cd58b0 r9236060  
    6060        return -1;
    6161}
    62 void ?{}(array * arr) {
    63         memset(arr->elems, 0, sizeof(arr->elems));
    64         arr->length = 0;
     62void ?{}(array & arr) {
     63        memset(arr.elems, 0, sizeof(arr.elems));
     64        arr.length = 0;
    6565}
    6666array constructed;
    6767array destructed;
    6868
    69 void ?{}(init_once * x) {
    70         assert( find( &constructed, x ) == -1 );
    71         remove( &destructed, x );
    72         insert( &constructed, x );
     69void ?{}(init_once & x) {
     70        assert( find( &constructed, &x ) == -1 );
     71        remove( &destructed, &x );
     72        insert( &constructed, &x );
    7373
    74         x->x = malloc(sizeof(int));
     74        x.x = malloc(sizeof(int));
    7575}
    7676
    77 void ?{}(init_once * x, init_once other) {
     77void ?{}(init_once & x, init_once other) {
    7878        x{};  // reuse default ctor
    7979}
    8080
    81 void ^?{}(init_once * x) {
    82         assert( find( &destructed, x ) == -1 );
    83         remove( &constructed, x );
    84         insert( &destructed, x );
     81void ^?{}(init_once & x) {
     82        assert( find( &destructed, &x ) == -1 );
     83        remove( &constructed, &x );
     84        insert( &destructed, &x );
    8585
    86         free(x->x);
     86        free(x.x);
    8787}
    8888//*** end setup
     
    125125                                init_once x;
    126126                                init_once y = x;
    127                                 (&x) {}; // ensure this doesn't execute
     127                                x{}; // ensure this doesn't execute
    128128                                break;
    129129                        }
  • src/tests/memberCtors.c

    r54cd58b0 r9236060  
    33};
    44
    5 void ?{}(WrappedInt * this) {
     5void ?{}(WrappedInt & this) {
    66  printf("constructing int\n");
    7   this->x = 0;
     7  this.x = 0;
    88}
    99
    10 void ?{}(WrappedInt * this, WrappedInt other) {
     10void ?{}(WrappedInt & this, WrappedInt other) {
    1111  printf("copy constructing int: %d\n", other.x);
    12   this->x = other.x;
     12  this.x = other.x;
    1313}
    1414
    15 void ?{}(WrappedInt * this, int x) {
     15void ?{}(WrappedInt & this, int x) {
    1616  printf("constructing int: %d\n", x);
    17   this->x = x;
     17  this.x = x;
    1818}
    1919
    20 void ^?{}(WrappedInt * this) {
    21   printf("destructing int: %d\n", this->x);
     20void ^?{}(WrappedInt & this) {
     21  printf("destructing int: %d\n", this.x);
    2222}
    2323
    24 void ?=?(WrappedInt * this, int x) {
    25   printf("assigning int: %d %d\n", this->x, x);
    26   this->x = x;
     24void ?=?(WrappedInt & this, int x) {
     25  printf("assigning int: %d %d\n", this.x, x);
     26  this.x = x;
    2727}
    2828
     
    3131};
    3232
    33 void ?{}(A * a) {
     33void ?{}(A & a) {
    3434  // currently must define default ctor, since there's no "= default" syntax
    3535}
    3636
    37 void ?{}(A * a, int x) {
     37void ?{}(A & a, int x) {
    3838  printf("begin construct A\n");
    39   printf("construct a->x\n");
    40   (&a->x){ x+999 };
    41   printf("assign a->y\n");
    42   a->y = 0; // not a constructor - default constructor will be inserted
     39  printf("construct a.x\n");
     40  (a.x){ x+999 };
     41  printf("assign a.y\n");
     42  a.y = 0; // not a constructor - default constructor will be inserted
    4343  printf("end construct A\n");
    4444} // z never constructed - will be automatically default constructed
    4545
    46 void ?{}(A * this, A other) {
     46void ?{}(A & this, A other) {
    4747  printf("begin copy construct A\n");
    48   printf("copy construct this->x\n");
    49   (&this->x){ other.x };
    50   printf("assign this->y\n");
    51   this->y = other.y; // not a constructor - copy constructor will be inserted
     48  printf("copy construct this.x\n");
     49  (this.x){ other.x };
     50  printf("assign this.y\n");
     51  this.y = other.y; // not a constructor - copy constructor will be inserted
    5252  printf("end copy construct A\n");
    5353} // z never constructed - will be automatically copy constructed
    5454
    55 A ?=?(A * this, A other) {
     55A ?=?(A & this, A other) {
    5656  printf("begin ?=? A\n");
    57   this->x = other.x;
    58   this->y = other.y;
    59   this->z = other.z;
     57  this.x = other.x;
     58  this.y = other.y;
     59  this.z = other.z;
    6060  printf("end ?=? A\n");
    61   return *this;
     61  return this;
    6262}
    6363
     
    6666};
    6767
    68 void ?{}(B * b) {
     68void ?{}(B & b) {
    6969  printf("begin construct B\n");
    70   printf("assign b->a2\n");
    71   b->a2 = (A) { 2 };
    72   printf("construct b->a1\n");
    73   (&b->a1){ 1 };
     70  printf("assign b.a2\n");
     71  b.a2 = (A) { 2 };
     72  printf("construct b.a1\n");
     73  (b.a1){ 1 };
    7474#ifdef ERR1
    75   (&b->a2){ b->a3 }; // error, b->a2 was used previously but is explicitly constructed
     75  (b.a2){ b.a3 }; // error, b->a2 was used previously but is explicitly constructed
    7676#endif
    7777  printf("end construct B\n");
    7878} // a2, a3 never constructed - will be automatically default constructed
    7979
    80 void ^?{}(B * b) {
    81   b->a2 = (A) { 0 };
    82   ^(&b->a1){};
     80void ^?{}(B & b) {
     81  b.a2 = (A) { 0 };
     82  ^(b.a1){};
    8383} // a2, a3 never destructed - will be automatically destructed
    8484
  • src/tests/monitor.c

    r54cd58b0 r9236060  
    88};
    99
    10 void ?{}(global_t * this) {
    11         this->value = 0;
     10void ?{}(global_t & this) {
     11        this.value = 0;
    1212}
    1313
    1414static global_t global;
    1515
    16 void increment3( global_t * mutex this ) {
    17         this->value += 1;
     16void increment3( global_t & mutex this ) {
     17        this.value += 1;
    1818}
    1919
    20 void increment2( global_t * mutex this ) {
     20void increment2( global_t & mutex this ) {
    2121        increment3( this );
    2222}
    2323
    24 void increment( global_t * mutex this ) {
     24void increment( global_t & mutex this ) {
    2525        increment2( this );
    2626}
     
    2828thread MyThread {};
    2929
    30 void main( MyThread* this ) {
     30void main( MyThread & this ) {
    3131        for(int i = 0; i < 1_000_000; i++) {
    32                 increment( &global );
     32                increment( global );
    3333        }
    3434}
  • src/tests/multi-monitor.c

    r54cd58b0 r9236060  
    1010static monitor_t m1, m2, m3;
    1111
    12 void increment( monitor_t * mutex p1, monitor_t * mutex p2, int * value ) {
    13         *value += 1;
     12void increment( monitor_t & mutex p1, monitor_t & mutex p2, int & value ) {
     13        value += 1;
    1414}
    1515
    16 struct MyThread {
    17         thread_desc __thrd;
     16thread MyThread {
    1817        int target;
    1918};
    2019
    21 DECL_THREAD(MyThread);
    22 
    23 void ?{}( MyThread * this, int target ) {
    24         this->target = target;
     20void ?{}( MyThread & this, int target ) {
     21        this.target = target;
    2522}
    2623
    27 void ^?{}( MyThread * mutex this ) {}
     24void ^?{}( MyThread & mutex this ) {}
    2825
    29 void main( MyThread* this ) {
     26void main( MyThread & this ) {
    3027        for(int i = 0; i < 1000000; i++) {
    31                 choose(this->target) {
    32                         case 0: increment( &m1, &m2, &global12 );
    33                         case 1: increment( &m2, &m3, &global23 );
    34                         case 2: increment( &m1, &m3, &global13 );
     28                choose(this.target) {
     29                        case 0: increment( m1, m2, global12 );
     30                        case 1: increment( m2, m3, global23 );
     31                        case 2: increment( m1, m3, global13 );
    3532                }
    3633        }
     34}
     35
     36forall(dtype T | sized(T) | { void ^?{}(T & mutex); })
     37void delete_mutex(T * x) {
     38        ^(*x){};
     39        free(x);
    3740}
    3841
     
    4043        processor p;
    4144        {
    42                 scoped(MyThread) * f[6];
     45                MyThread * f[6];
    4346                for(int i = 0; i < 6; i++) {
    44                         f[i] = ((scoped(MyThread) *)malloc()){ i % 3 };
     47                        f[i] = new(i % 3);
    4548                }
    4649
    4750                for(int i = 0; i < 6; i++) {
    48                         delete( f[i] );
     51                        delete_mutex( f[i] );
    4952                }
    5053        }
  • src/tests/multiDimension.c

    r54cd58b0 r9236060  
    44};
    55
    6 void ?{}(X * this) {
     6void ?{}(X & this) {
    77  printf("default constructing\n");
    8   (&this->a){ 123 };
    9   this->ptr = malloc(sizeof(int));
     8  (this.a){ 123 };
     9  this.ptr = malloc(sizeof(int));
    1010}
    1111
    12 void ?{}(X * this, X other) {
     12void ?{}(X & this, X other) {
    1313  printf("copy constructing\n");
    14   (&this->a){ other.a };
    15   this->ptr = malloc(sizeof(int));
     14  (this.a){ other.a };
     15  this.ptr = malloc(sizeof(int));
    1616}
    1717
    18 void ?{}(X * this, int a) {
     18void ?{}(X & this, int a) {
    1919  printf("constructing with %d\n", a);
    20   (&this->a){ a };
    21   this->ptr = malloc(sizeof(int));
     20  (this.a){ a };
     21  this.ptr = malloc(sizeof(int));
    2222}
    2323
    24 void ^?{}(X * this) {
     24void ^?{}(X & this) {
    2525  printf("destructing\n");
    26   free(this->ptr);
     26  free(this.ptr);
    2727}
    2828
    29 X ?=?(X * this, X other) {
    30   this->a = other.a;
    31   return *this;
     29X ?=?(X & this, X other) {
     30  this.a = other.a;
     31  return this;
    3232}
    3333
  • src/tests/operators.c

    r54cd58b0 r9236060  
    1111}
    1212
    13 int ?=?( int *a, int b ) {
     13int ?=?( int &a, int b ) {
    1414        return 0;
    1515}
  • src/tests/preempt.c

    r54cd58b0 r9236060  
    1616};
    1717
    18 void ?{}( worker_t * this, int value ) {
    19         this->value = value;
     18void ?{}( worker_t & this, int value ) {
     19        this.value = value;
    2020}
    2121
    22 void main(worker_t * this) {
     22void main(worker_t & this) {
    2323        while(counter < 1000) {
    24                 if( (counter % 7) == this->value ) {
     24                if( (counter % 7) == this.value ) {
    2525                        int next = __atomic_add_fetch_4(&counter, 1, __ATOMIC_SEQ_CST);
    2626                        if( (next % 100) == 0 ) printf("%d\n", next);
  • src/tests/rational.c

    r54cd58b0 r9236060  
    1 // 
     1//
    22// Cforall Version 1.0.0 Copyright (C) 2016 University of Waterloo
    33//
    44// The contents of this file are covered under the licence agreement in the
    55// file "LICENCE" distributed with Cforall.
    6 // 
     6//
    77// rational.c -- test rational number package
    8 // 
     8//
    99// Author           : Peter A. Buhr
    1010// Created On       : Mon Mar 28 08:43:12 2016
     
    1212// Last Modified On : Wed May 17 15:46:35 2017
    1313// Update Count     : 65
    14 // 
     14//
    1515
    1616#include <rational>
     
    2020
    2121// UNNECESSARY, FIX ME
    22 void ?{}( int * this ) { *this = 0; }
    23 void ?{}( int * this, zero_t ) { *this = 0; }
    24 void ?{}( int * this, one_t ) { *this = 1; }
     22void ?{}( int & this ) { this = 0; }
     23void ?{}( int & this, zero_t ) { this = 0; }
     24void ?{}( int & this, one_t ) { this = 1; }
    2525double convert( int i ) { return (double)i; }
    2626int convert( double d ) { return (int)d; }
  • src/tests/sched-int-barge.c

    r54cd58b0 r9236060  
    2828};
    2929
    30 void ?{} ( global_data_t * this ) {
    31         this->done = false;
    32         this->counter = 0;
    33         this->state = BARGE;
     30void ?{} ( global_data_t & this ) {
     31        this.done = false;
     32        this.counter = 0;
     33        this.state = BARGE;
    3434
    35         this->do_signal = 6;
    36         this->do_wait1  = 1;
    37         this->do_wait2  = 3;
     35        this.do_signal = 6;
     36        this.do_wait1  = 1;
     37        this.do_wait2  = 3;
    3838}
    3939
    40 void ^?{} ( global_data_t * this ) {}
     40void ^?{} ( global_data_t & this ) {}
    4141
    4242global_t globalA;
     
    4848thread Threads {};
    4949
    50 bool logicC( global_t * mutex a, global_t * mutex b, global_data_t * mutex c ) {
    51         c->counter++;
     50bool logicC( global_t & mutex a, global_t & mutex b, global_data_t & mutex c ) {
     51        c.counter++;
    5252
    53         if( (c->counter % 1000) == 0 ) sout | c->counter | endl;
     53        if( (c.counter % 1000) == 0 ) sout | c.counter | endl;
    5454
    55         int action = c->counter % 10;
     55        int action = c.counter % 10;
    5656
    5757        if( action == 0 ) {
    58                 c->do_signal = max( ((unsigned)rand48()) % 10, 1);
    59                 c->do_wait1 = ((unsigned)rand48()) % (c->do_signal);
    60                 c->do_wait2 = ((unsigned)rand48()) % (c->do_signal);
     58                c.do_signal = max( ((unsigned)rand48()) % 10, 1);
     59                c.do_wait1 = ((unsigned)rand48()) % (c.do_signal);
     60                c.do_wait2 = ((unsigned)rand48()) % (c.do_signal);
    6161
    62                 if(c->do_wait1 == c->do_wait2) sout | "Same" | endl;
     62                if(c.do_wait1 == c.do_wait2) sout | "Same" | endl;
    6363        }
    6464
    65         if( action == c->do_wait1 || action == c->do_wait2 ) {
    66                 c->state = WAIT;
     65        if( action == c.do_wait1 || action == c.do_wait2 ) {
     66                c.state = WAIT;
    6767                wait( &cond );
    6868
    69                 if(c->state != SIGNAL) {
    70                         sout | "ERROR Barging detected" | c->counter | endl;
     69                if(c.state != SIGNAL) {
     70                        sout | "ERROR Barging detected" | c.counter | endl;
    7171                        abort();
    7272                }
    7373        }
    74         else if( action == c->do_signal ) {
    75                 c->state = SIGNAL;
     74        else if( action == c.do_signal ) {
     75                c.state = SIGNAL;
    7676
    7777                signal( &cond );
     
    7979        }
    8080        else {
    81                 c->state = BARGE;
     81                c.state = BARGE;
    8282        }
    8383
    84         if( c->counter >= N ) c->done = true;
    85         return !c->done;
     84        if( c.counter >= N ) c.done = true;
     85        return !c.done;
    8686}
    8787
    88 bool logicB( global_t * mutex a, global_t * mutex b ) {
    89         return logicC(a, b, &globalC);
     88bool logicB( global_t & mutex a, global_t & mutex b ) {
     89        return logicC(a, b, globalC);
    9090}
    9191
    92 bool logicA( global_t * mutex a ) {
    93         return logicB(a, &globalB);
     92bool logicA( global_t & mutex a ) {
     93        return logicB(a, globalB);
    9494}
    9595
    96 void main( Threads* this ) {
    97         while( logicA(&globalA) ) { yield(); };
     96void main( Threads & this ) {
     97        while( logicA(globalA) ) { yield(); };
    9898}
    9999
     
    101101
    102102int main(int argc, char* argv[]) {
    103         rand48seed(0);
    104         processor p;
    105         {
    106                 Threads t[17];
    107                 the_threads = (thread_desc*)t;
    108         }
     103        rand48seed(0);
     104        processor p;
     105        {
     106                Threads t[17];
     107                the_threads = (thread_desc*)t;
     108        }
    109109}
  • src/tests/sched-int-block.c

    r54cd58b0 r9236060  
    2424};
    2525
    26 void ?{} ( global_data_t * this ) {
    27         this->last_thread = NULL;
    28         this->last_signaller = NULL;
     26void ?{} ( global_data_t & this ) {
     27        this.last_thread = NULL;
     28        this.last_signaller = NULL;
    2929}
    3030
    31 void ^?{} ( global_data_t * this ) {}
     31void ^?{} ( global_data_t & this ) {}
    3232
    3333global_data_t globalA, globalB;
     
    3838
    3939//------------------------------------------------------------------------------
    40 void wait_op( global_data_t * mutex a, global_data_t * mutex b, unsigned i ) {
     40void wait_op( global_data_t & mutex a, global_data_t & mutex b, unsigned i ) {
    4141        wait( &cond, (uintptr_t)this_thread );
    4242
    4343        yield( ((unsigned)rand48()) % 10 );
    4444
    45         if(a->last_thread != a->last_signaller || b->last_thread != b->last_signaller ) {
    46                 sout | "ERROR Barging detected, expected" | a->last_signaller | b->last_signaller | "got" | a->last_thread | b->last_thread | endl;
     45        if(a.last_thread != a.last_signaller || b.last_thread != b.last_signaller ) {
     46                sout | "ERROR Barging detected, expected" | a.last_signaller | b.last_signaller | "got" | a.last_thread | b.last_thread | endl;
    4747                abort();
    4848        }
    4949
    50         a->last_thread = b->last_thread = this_thread;
     50        a.last_thread = b.last_thread = this_thread;
    5151
    5252        yield( ((unsigned)rand48()) % 10 );
     
    5454
    5555thread Waiter {};
    56 void main( Waiter* this ) {
     56void main( Waiter & this ) {
    5757        for( int i = 0; i < N; i++ ) {
    58                 wait_op( &globalA, &globalB, i );
     58                wait_op( globalA, globalB, i );
    5959        }
    6060}
    6161
    6262//------------------------------------------------------------------------------
    63 void signal_op( global_data_t * mutex a, global_data_t * mutex b ) {
     63void signal_op( global_data_t & mutex a, global_data_t & mutex b ) {
    6464        yield( ((unsigned)rand48()) % 10 );
    6565
    66         a->last_thread = b->last_thread = a->last_signaller = b->last_signaller = this_thread;
     66        [a.last_thread, b.last_thread, a.last_signaller, b.last_signaller] = this_thread;
    6767
    6868        if( !is_empty( &cond ) ) {
     
    7777                yield( ((unsigned)rand48()) % 10 );
    7878
    79                 if(a->last_thread != next || b->last_thread != next) {
    80                         sout | "ERROR Barging detected, expected" | next | "got" | a->last_thread | b->last_thread | endl;
     79                if(a.last_thread != next || b.last_thread != next) {
     80                        sout | "ERROR Barging detected, expected" | next | "got" | a.last_thread | b.last_thread | endl;
    8181                        abort();
    8282                }
     
    8686
    8787thread Signaller {};
    88 void main( Signaller* this ) {
     88void main( Signaller & this ) {
    8989        while( !done ) {
    90                 signal_op( &globalA, &globalB );
     90                signal_op( globalA, globalB );
    9191        }
    9292}
    9393
    9494//------------------------------------------------------------------------------
    95 void barge_op( global_data_t * mutex a ) {
    96         a->last_thread = this_thread;
     95void barge_op( global_data_t & mutex a ) {
     96        a.last_thread = this_thread;
    9797}
    9898
    9999thread Barger {};
    100 void main( Barger* this ) {
     100void main( Barger & this ) {
    101101        for( unsigned i = 0; !done; i++ ) {
    102102                //Choose some monitor to barge into with some irregular pattern
    103103                bool choose_a = (i % 13) > (i % 17);
    104                 barge_op( choose_a ? &globalA : &globalB );
     104                if ( choose_a ) barge_op( globalA );
     105                else barge_op( globalB );
    105106        }
    106107}
  • src/tests/sched-int-disjoint.c

    r54cd58b0 r9236060  
    2020
    2121monitor global_data_t;
    22 void ?{}( global_data_t * this );
    23 void ^?{} ( global_data_t * this );
     22void ?{}( global_data_t & this );
     23void ^?{} ( global_data_t & this );
    2424
    2525monitor global_data_t {
     
    3232volatile bool all_done;
    3333
    34 void ?{}( global_data_t * this ) {
    35         this->counter == 0;
    36         this->state = BARGE;
     34void ?{}( global_data_t & this ) {
     35        this.counter == 0;
     36        this.state = BARGE;
    3737}
    3838
    39 void ^?{} ( global_data_t * this ) {}
     39void ^?{} ( global_data_t & this ) {}
    4040
    4141//------------------------------------------------------------------------------
    4242// Barging logic
    43 void barge( global_data_t * mutex d ) {
    44         d->state = BARGE;
     43void barge( global_data_t & mutex d ) {
     44        d.state = BARGE;
    4545}
    4646
    4747thread Barger {};
    4848
    49 void main( Barger * this ) {
     49void main( Barger & this ) {
    5050        while( !all_done ) {
    51                 barge( &data );
     51                barge( data );
    5252                yield();
    5353        }
     
    5656//------------------------------------------------------------------------------
    5757// Waiting logic
    58 bool wait( global_t * mutex m, global_data_t * mutex d ) {
     58bool wait( global_t & mutex m, global_data_t & mutex d ) {
    5959        wait( &cond );
    60         if( d->state != SIGNAL ) {
     60        if( d.state != SIGNAL ) {
    6161                sout | "ERROR barging!" | endl;
    6262        }
    6363
    64         d->counter++;
     64        d.counter++;
    6565
    66         if( (d->counter % 1000) == 0 ) sout | d->counter | endl;
     66        if( (d.counter % 1000) == 0 ) sout | d.counter | endl;
    6767
    68         return d->counter < N;
     68        return d.counter < N;
    6969}
    7070
    7171thread Waiter {};
    7272
    73 void main( Waiter * this ) {
    74         while( wait( &mut, &data ) ) { yield(); }
     73void main( Waiter & this ) {
     74        while( wait( mut, data ) ) { yield(); }
    7575}
    7676
     
    7878//------------------------------------------------------------------------------
    7979// Signalling logic
    80 void signal( condition * cond, global_t * mutex a, global_data_t * mutex b ) {
    81         b->state = SIGNAL;
     80void signal( condition * cond, global_t & mutex a, global_data_t & mutex b ) {
     81        b.state = SIGNAL;
    8282        signal( cond );
    8383}
    8484
    85 void logic( global_t * mutex a ) {
    86         signal( &cond, a, &data );
     85void logic( global_t & mutex a ) {
     86        signal( &cond, a, data );
    8787
    8888        yield( (unsigned)rand48() % 10 );
     
    9797thread Signaller {};
    9898
    99 void main( Signaller * this ) {
     99void main( Signaller & this ) {
    100100        while( !all_done ) {
    101                 logic( &mut );
     101                logic( mut );
    102102                yield();
    103103        }
  • src/tests/sched-int-wait.c

    r54cd58b0 r9236060  
    3333//----------------------------------------------------------------------------------------------------
    3434// Tools
    35 void signal( condition * cond, global_t * mutex a, global_t * mutex b ) {
     35void signal( condition * cond, global_t & mutex a, global_t & mutex b ) {
    3636        signal( cond );
    3737}
    3838
    39 void signal( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) {
     39void signal( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
    4040        signal( cond );
    4141}
    4242
    43 void wait( condition * cond, global_t * mutex a, global_t * mutex b ) {
     43void wait( condition * cond, global_t & mutex a, global_t & mutex b ) {
    4444        wait( cond );
    4545}
    4646
    47 void wait( condition * cond, global_t * mutex a, global_t * mutex b, global_t * mutex c ) {
     47void wait( condition * cond, global_t & mutex a, global_t & mutex b, global_t & mutex c ) {
    4848        wait( cond );
    4949}
     
    5151//----------------------------------------------------------------------------------------------------
    5252// Signaler
    53 void main( Signaler* this ) {
     53void main( Signaler & this ) {
    5454
    5555        while( waiter_left != 0 ) {
     
    5757                switch( action ) {
    5858                        case 0:
    59                                 signal( &condABC, &globalA, &globalB, &globalC );
     59                                signal( &condABC, globalA, globalB, globalC );
    6060                                break;
    6161                        case 1:
    62                                 signal( &condAB , &globalA, &globalB );
     62                                signal( &condAB , globalA, globalB );
    6363                                break;
    6464                        case 2:
    65                                 signal( &condBC , &globalB, &globalC );
     65                                signal( &condBC , globalB, globalC );
    6666                                break;
    6767                        case 3:
    68                                 signal( &condAC , &globalA, &globalC );
     68                                signal( &condAC , globalA, globalC );
    6969                                break;
    7070                        default:
     
    7878//----------------------------------------------------------------------------------------------------
    7979// Waiter ABC
    80 void main( WaiterABC* this ) {
     80void main( WaiterABC & this ) {
    8181        for( int i = 0; i < N; i++ ) {
    82                 wait( &condABC, &globalA, &globalB, &globalC );
     82                wait( &condABC, globalA, globalB, globalC );
    8383        }
    8484
     
    8888//----------------------------------------------------------------------------------------------------
    8989// Waiter AB
    90 void main( WaiterAB* this ) {
     90void main( WaiterAB & this ) {
    9191        for( int i = 0; i < N; i++ ) {
    92                 wait( &condAB , &globalA, &globalB );
     92                wait( &condAB , globalA, globalB );
    9393        }
    9494
     
    9898//----------------------------------------------------------------------------------------------------
    9999// Waiter AC
    100 void main( WaiterAC* this ) {
     100void main( WaiterAC & this ) {
    101101        for( int i = 0; i < N; i++ ) {
    102                 wait( &condAC , &globalA, &globalC );
     102                wait( &condAC , globalA, globalC );
    103103        }
    104104
     
    108108//----------------------------------------------------------------------------------------------------
    109109// Waiter BC
    110 void main( WaiterBC* this ) {
     110void main( WaiterBC & this ) {
    111111        for( int i = 0; i < N; i++ ) {
    112                 wait( &condBC , &globalB, &globalC );
     112                wait( &condBC , globalB, globalC );
    113113        }
    114114
  • src/tests/test.py

    r54cd58b0 r9236060  
    3131# parses the Makefile to find the machine type (32-bit / 64-bit)
    3232def getMachineType():
    33         sh('echo "void ?{}(int*a,int b){}int main(){return 0;}" > .dummy.c')
     33        sh('echo "void ?{}(int&a,int b){}int main(){return 0;}" > .dummy.c')
    3434        ret, out = sh("make .dummy -s", print2stdout=True)
    3535
  • src/tests/thread.c

    r54cd58b0 r9236060  
    77thread Second { semaphore* lock; };
    88
    9 void ?{}( First * this, semaphore* lock ) { this->lock = lock; }
    10 void ?{}( Second * this, semaphore* lock ) { this->lock = lock; }
     9void ?{}( First & this, semaphore & lock ) { this.lock = &lock; }
     10void ?{}( Second & this, semaphore & lock ) { this.lock = &lock; }
    1111
    12 void main(First* this) {
     12void main(First& this) {
    1313        for(int i = 0; i < 10; i++) {
    1414                sout | "First : Suspend No." | i + 1 | endl;
    1515                yield();
    1616        }
    17         V(this->lock);
     17        V(this.lock);
    1818}
    1919
    20 void main(Second* this) {
    21         P(this->lock);
     20void main(Second& this) {
     21        P(this.lock);
    2222        for(int i = 0; i < 10; i++) {
    2323                sout | "Second : Suspend No." | i + 1 | endl;
     
    3333                processor p;
    3434                {
    35                         First  f = { &lock };
    36                         Second s = { &lock };
     35                        First  f = { lock };
     36                        Second s = { lock };
    3737                }
    3838        }
  • src/tests/tupleAssign.c

    r54cd58b0 r9236060  
    4848                        int z;
    4949                } x;
    50                 X ?=?(X * x, double d) {}
     50                X ?=?(X & x, double d) {}
    5151                [int, double, int] t;
    5252
  • src/tests/tupleMember.c

    r54cd58b0 r9236060  
    3434} v;
    3535
    36 lvalue V h() {
     36V & h() {
    3737        static V local = { 111, { 222, 333 }, 444.5 };
    3838        return local;
  • src/tests/tupleVariadic.c

    r54cd58b0 r9236060  
    2929}
    3030
    31 forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } )
     31forall( dtype T, ttype Params | sized(T) | { void ?{}(T &, Params); } )
    3232T * new(Params p);
    3333
     
    3838
    3939// xxx - eventually this will be collapsed...x
    40 void ?{}(array * a) {
    41         a->size = 0;
    42         a->data = 0;
     40void ?{}(array & a) {
     41        a.size = 0;
     42        a.data = 0;
    4343        printf("called ?{} with no a\n");
    4444}
    4545
    46 void ?{}(array * a, int a0) {
    47         a->size = 1;
    48         a->data = (int*)malloc(sizeof(int)*a->size);
    49         a->data[0] = a0;
     46void ?{}(array & a, int a0) {
     47        a.size = 1;
     48        a.data = (int*)malloc(sizeof(int)*a.size);
     49        a.data[0] = a0;
    5050        printf("called ?{} with a: %d\n", a0);
    5151}
    5252
    53 void ?{}(array * a, int a0, int a1) {
    54         a->size = 2;
    55         a->data = (int*)malloc(sizeof(int)*a->size);
    56         a->data[0] = a0;
    57         a->data[1] = a1;
     53void ?{}(array & a, int a0, int a1) {
     54        a.size = 2;
     55        a.data = (int*)malloc(sizeof(int)*a.size);
     56        a.data[0] = a0;
     57        a.data[1] = a1;
    5858        printf("called ?{} with a: %d %d\n", a0, a1);
    5959}
    6060
    61 void ?{}(array * a, int a0, int a1, int a2) {
    62         a->size = 3;
    63         a->data = (int*)malloc(sizeof(int)*a->size);
    64         a->data[0] = a0;
    65         a->data[1] = a1;
    66         a->data[2] = a2;
     61void ?{}(array & a, int a0, int a1, int a2) {
     62        a.size = 3;
     63        a.data = (int*)malloc(sizeof(int)*a.size);
     64        a.data[0] = a0;
     65        a.data[1] = a1;
     66        a.data[2] = a2;
    6767        printf("called ?{} with a: %d %d %d\n", a0, a1, a2);
    6868}
    6969
    7070// test use of a tuple argument
    71 [void] ?{}(array * a, [int, int, int, int] args) {
     71[void] ?{}(array & a, [int, int, int, int] args) {
    7272        int a0, a1, a2, a3;
    7373        [a0, a1, a2, a3] = args;
    74         a->size = 4;
    75         a->data = malloc(sizeof(int)*a->size);
    76         a->data[0] = a0;
    77         a->data[1] = a1;
    78         a->data[2] = a2;
    79         a->data[3] = a3;
     74        a.size = 4;
     75        a.data = malloc(sizeof(int)*a.size);
     76        a.data[0] = a0;
     77        a.data[1] = a1;
     78        a.data[2] = a2;
     79        a.data[3] = a3;
    8080        printf("called ?{} with a: %d %d %d %d\n", a0, a1, a2, a3);
    8181}
  • src/tests/vector/array.h

    r54cd58b0 r9236060  
    2121// element has index 0.
    2222trait array( otype array_type, otype elt_type ) {
    23         lvalue elt_type ?[?]( array_type, int );
     23        elt_type & ?[?]( array_type, int );
    2424};
    2525
  • src/tests/vector/vector_int.c

    r54cd58b0 r9236060  
    2020#define DEFAULT_CAPACITY 20
    2121
    22 void ?{}( vector_int * vec ) {
     22void ?{}( vector_int & vec ) {
    2323        vec { DEFAULT_CAPACITY };
    2424}
    2525
    26 void ?{}( vector_int * vec, int reserve ) {
    27         vec->last = -1;
    28         vec->capacity = reserve;
    29         vec->data = malloc( sizeof( int ) * reserve );
     26void ?{}( vector_int & vec, int reserve ) {
     27        vec.last = -1;
     28        vec.capacity = reserve;
     29        vec.data = malloc( sizeof( int ) * reserve );
    3030}
    3131
    32 void ?{}( vector_int * vec, vector_int other ) {
    33         vec->last = other.last;
    34         vec->capacity = other.capacity;
    35         vec->data = malloc( sizeof( int ) * other.capacity );
    36         for (int i = 0; i < vec->last; i++) {
    37                 vec->data[i] = other.data[i];
     32void ?{}( vector_int & vec, vector_int other ) {
     33        vec.last = other.last;
     34        vec.capacity = other.capacity;
     35        vec.data = malloc( sizeof( int ) * other.capacity );
     36        for (int i = 0; i < vec.last; i++) {
     37                vec.data[i] = other.data[i];
    3838        }
    3939}
    4040
    41 void ^?{}( vector_int * vec ) {
    42         free( vec->data );
     41void ^?{}( vector_int & vec ) {
     42        free( vec.data );
    4343}
    4444
     
    6161// implement bounded_array
    6262
    63 lvalue int ?[?]( vector_int * vec, int index ) {
     63int & ?[?]( vector_int * vec, int index ) {
    6464        return vec->data[ index ];
    6565}
  • src/tests/vector/vector_int.h

    r54cd58b0 r9236060  
    2424} vector_int;
    2525
    26 void ?{}( vector_int * );                                                               // allocate vector with default capacity
    27 void ?{}( vector_int *, int reserve );                                  // allocate vector with specified capacity
    28 void ?{}( vector_int * vec, vector_int other );                 // copy constructor
    29 void ^?{}( vector_int * );                                                              // deallocate vector's storage
     26void ?{}( vector_int & );                                                               // allocate vector with default capacity
     27void ?{}( vector_int &, int reserve );                                  // allocate vector with specified capacity
     28void ?{}( vector_int & vec, vector_int other );     // copy constructor
     29void ^?{}( vector_int & );                // deallocate vector's storage
    3030
    3131void reserve( vector_int *vec, int reserve );                   // reserve more capacity
     
    3434// implement bounded_array
    3535
    36 lvalue int ?[?]( vector_int * vec, int index );                 // access to arbitrary element (does not resize)
    37 int last( vector_int * vec );                                                   // return last element
     36int & ?[?]( vector_int * vec, int index );                              // access to arbitrary element (does not resize)
     37int last( vector_int * vec );             // return last element
    3838
    3939// Local Variables: //
Note: See TracChangeset for help on using the changeset viewer.