Changes in / [cf0b892:e39647e]


Ignore:
Location:
src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • src/MakeLibCfa.cc

    rcf0b892 re39647e  
    7575                  case CodeGen::OT_POSTFIXASSIGN:
    7676                  case CodeGen::OT_INFIXASSIGN:
    77                   case CodeGen::OT_CTOR:
    78                   case CodeGen::OT_DTOR:
    7977                                funcDecl->get_statements()->get_kids().push_back( new ReturnStmt( std::list< Label >(), newExpr ) );
    8078                                break;
     79                  case CodeGen::OT_CTOR:
     80                        // ctors don't return a value
     81                        if ( funcDecl->get_functionType()->get_parameters().size() == 1 ) {
     82                                // intrinsic default constructors should do nothing
     83                                // delete newExpr;
     84                                break;
     85                        } else {
     86                                assert( funcDecl->get_functionType()->get_parameters().size() == 2 );
     87                                // anything else is a single parameter constructor that is effectively a C-style assignment
     88                                // delete newExpr->get_function();
     89                                assert(newExpr->get_args().size()==2);
     90                                newExpr->set_function( new NameExpr( "?=?" ) );
     91                                funcDecl->get_statements()->get_kids().push_back( new ExprStmt( std::list< Label >(), newExpr ) );
     92                        }
     93                        break;
     94                  case CodeGen::OT_DTOR:
     95                        // intrinsic destructors should do nothing
     96                        // delete newExpr;
     97                        break;
    8198                  case CodeGen::OT_CONSTANT:
    8299                  case CodeGen::OT_LABELADDRESS:
  • src/ResolvExpr/AlternativeFinder.cc

    rcf0b892 re39647e  
    627627                TypeEnvironment resultEnv;
    628628                makeUnifiableVars( funcType, openVars, resultNeed );
    629                 resultEnv.add( funcType->get_forall() ); // add all type variables as open variables now so that those not used in the parameter list are still considered open
    630629                AltList instantiatedActuals; // filled by instantiate function
    631630                if ( targetType && ! targetType->isVoid() && ! funcType->get_returnVals().empty() ) {
  • src/ResolvExpr/CastCost.cc

    rcf0b892 re39647e  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // CastCost.cc --
     7// CastCost.cc -- 
    88//
    99// Author           : Richard C. Bilson
     
    2626          public:
    2727                CastCost( Type *dest, const SymTab::Indexer &indexer, const TypeEnvironment &env );
    28 
     28 
    2929                virtual void visit( BasicType *basicType );
    3030                virtual void visit( PointerType *pointerType );
     
    3636                        NamedTypeDecl *namedType;
    3737                        if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
    38                                 if ( eqvClass.type ) {
    39                                         return castCost( src, eqvClass.type, indexer, env );
    40                                 } else {
    41                                         return Cost::infinity;
    42                                 }
     38                                return castCost( src, eqvClass.type, indexer, env );
    4339                        } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
    4440                                TypeDecl *type = dynamic_cast< TypeDecl* >( namedType );
  • src/ResolvExpr/ConversionCost.cc

    rcf0b892 re39647e  
    3030///     std::cout << "type inst " << destAsTypeInst->get_name();
    3131                        if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
    32                                 if ( eqvClass.type ) {
    33                                         return conversionCost( src, eqvClass.type, indexer, env );
    34                                 } else {
    35                                         return Cost::infinity;
    36                                 }
     32                                return conversionCost( src, eqvClass.type, indexer, env );
    3733                        } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
    3834///       std::cout << " found" << std::endl;
  • src/ResolvExpr/Resolver.cc

    rcf0b892 re39647e  
    124124                        } // if
    125125#endif
    126                         assertf( finder.get_alternatives().size() == 1, "findSingleExpression: must have exactly one alternative at the end." );
     126                        assert( finder.get_alternatives().size() == 1 );
    127127                        Alternative &choice = finder.get_alternatives().front();
    128128                        Expression *newExpr = choice.expr->clone();
     
    397397                        // //   cerr << type << endl;
    398398                        // // } // for
    399 
     399                       
    400400                        // // O(N^2) checks of d-types with f-types
    401401                        // // find the minimum cost
  • src/ResolvExpr/Unify.cc

    rcf0b892 re39647e  
    344344                std::cerr << "unifyInexact type 1 is ";
    345345                type1->print( std::cerr );
    346                 std::cerr << " type 2 is ";
     346                std::cerr << "type 2 is ";
    347347                type2->print( std::cerr );
    348348                std::cerr << std::endl;
     
    595595                        TypeExpr *otherParam = dynamic_cast< TypeExpr* >(*jt);
    596596                        assertf(otherParam, "Aggregate parameters should be type expressions");
    597 
     597                       
    598598                        Type* paramTy = param->get_type();
    599599                        Type* otherParamTy = otherParam->get_type();
  • src/SymTab/FixFunction.cc

    rcf0b892 re39647e  
    2424
    2525        DeclarationWithType * FixFunction::mutate(FunctionDecl *functionDecl) {
    26                 ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClasses(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type() ), 0, functionDecl->get_attributes() );
     26                ObjectDecl *pointer = new ObjectDecl( functionDecl->get_name(), functionDecl->get_storageClasses(), functionDecl->get_linkage(), 0, new PointerType( Type::Qualifiers(), functionDecl->get_type()->clone() ), 0, functionDecl->get_attributes() );
    2727                functionDecl->get_attributes().clear();
    28                 // can't delete function type because it may contain assertions, but can't transfer ownership without a clone since set_type checks for nullptr
    29                 functionDecl->set_type( functionDecl->get_type()->clone() );
    3028                delete functionDecl;
    3129                return pointer;
  • src/Tuples/TupleExpansion.cc

    rcf0b892 re39647e  
    332332        TypeInstType * isTtype( Type * type ) {
    333333                if ( TypeInstType * inst = dynamic_cast< TypeInstType * >( type ) ) {
    334                         if ( inst->get_baseType() && inst->get_baseType()->get_kind() == TypeDecl::Ttype ) {
     334                        if ( inst->get_baseType()->get_kind() == TypeDecl::Ttype ) {
    335335                                return inst;
    336336                        }
  • src/prelude/prelude.cf

    rcf0b892 re39647e  
    309309// forall( dtype DT ) signed int ?!=?( const volatile void *, const volatile DT * );
    310310
    311 // forall( dtype DT ) signed int ?==?( const volatile DT *, zero_t );
    312 // forall( dtype DT ) signed int ?==?( zero_t, const volatile DT * );
    313 // forall( ftype FT ) signed int ?==?( FT *, zero_t );
    314 // forall( ftype FT ) signed int ?==?( zero_t, FT * );
    315 // forall( dtype DT ) signed int ?!=?( const volatile DT *, zero_t );
    316 // forall( dtype DT ) signed int ?!=?( zero_t, const volatile DT * );
    317 // forall( ftype FT ) signed int ?!=?( FT *, zero_t );
    318 // forall( ftype FT ) signed int ?!=?( zero_t, FT * );
     311// forall( dtype DT ) signed int ?==?( const volatile DT *, forall( dtype DT2 )const DT2 * );
     312// forall( dtype DT ) signed int ?==?( forall( dtype DT2 )const DT2 *, const volatile DT * );
     313// forall( ftype FT ) signed int ?==?( FT *, forall( ftype FT2 )FT2 * );
     314// forall( ftype FT ) signed int ?==?( forall( ftype FT2 )FT2 *, FT * );
     315// forall( dtype DT ) signed int ?!=?( const volatile DT *, forall( dtype DT2 )const DT2 * );
     316// forall( dtype DT ) signed int ?!=?( forall( dtype DT2 )const DT2 *, const volatile DT * );
     317// forall( ftype FT ) signed int ?!=?( FT *, forall( ftype FT2 )FT2 * );
     318// forall( ftype FT ) signed int ?!=?( forall( ftype FT2 )FT2 *, FT * );
    319319
    320320// ------------------------------------------------------------
     
    447447const volatile void *   ?=?( const volatile void * volatile *, const volatile void * );
    448448
    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 );
     449//forall( dtype DT ) DT *                       ?=?(                DT *          *, forall( dtype DT2 ) const DT2 * );
     450//forall( dtype DT ) DT *                       ?=?(                DT * volatile *, forall( dtype DT2 ) const DT2 * );
     451forall( dtype DT ) const DT *           ?=?( const          DT *          *, forall( dtype DT2 ) const DT2 * );
     452forall( dtype DT ) const DT *           ?=?( const          DT * volatile *, forall( dtype DT2 ) const DT2 * );
     453//forall( dtype DT ) volatile DT *      ?=?( volatile       DT *          *, forall( dtype DT2 ) const DT2 * );
     454//forall( dtype DT ) volatile DT *      ?=?( volatile       DT * volatile *, forall( dtype DT2 ) const DT2 * );
     455forall( dtype DT ) const volatile DT *  ?=?( const volatile DT *          *, forall( dtype DT2 ) const DT2 * );
     456forall( dtype DT ) const volatile DT *  ?=?( const volatile DT * volatile *, forall( dtype DT2 ) const DT2 * );
     457
     458forall( ftype FT ) FT *                 ?=?( FT *          *, forall( ftype FT2 ) FT2 * );
     459forall( ftype FT ) FT *                 ?=?( FT * volatile *, forall( ftype FT2 ) FT2 * );
    460460
    461461forall( dtype T | sized(T) ) T *                        ?+=?(                T *          *, ptrdiff_t );
     
    799799void    ?{}( const volatile void *          *, const volatile void * );
    800800
    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 );
     801//forall( dtype DT ) void ?{}(              DT *          *, forall( dtype DT2 ) const DT2 * );
     802//forall( dtype DT ) void ?{}(              DT * volatile *, forall( dtype DT2 ) const DT2 * );
     803forall( dtype DT ) void ?{}( const          DT *          *, forall( dtype DT2 ) const DT2 * );
     804//forall( dtype DT ) void ?{}( volatile     DT *          *, forall( dtype DT2 ) const DT2 * );
     805//forall( dtype DT ) void ?{}( volatile     DT * volatile *, forall( dtype DT2 ) const DT2 * );
     806forall( dtype DT ) void ?{}( const volatile DT *          *, forall( dtype DT2 ) const DT2 * );
     807
     808forall( ftype FT ) void ?{}( FT *          *, forall( ftype FT2 ) FT2 * );
    809809
    810810// default ctors
  • src/tests/test.py

    rcf0b892 re39647e  
    253253        # for each test to run
    254254        try :
    255                 results = pool.map_async(partial(run_test_worker, generate=generate, dry_run=dry_run, debug=debug), tests, chunksize = 1 ).get(3600)
     255                results = pool.map_async(partial(run_test_worker, generate=generate, dry_run=dry_run, debug=debug), tests ).get(3600)
    256256        except KeyboardInterrupt:
    257257                pool.terminate()
Note: See TracChangeset for help on using the changeset viewer.