Changeset 6f71276 for src


Ignore:
Timestamp:
Apr 3, 2017, 2:29:11 PM (9 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
bbc9b64
Parents:
8396044 (diff), 7444113 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg2:software/cfa/cfa-cc

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/InstantiateGeneric.cc

    r8396044 r6f71276  
    255255                }
    256256
    257                 assert( baseParam == baseParams.end() && param == params.end() && "Type parameters should match type variables" );
     257                assertf( baseParam == baseParams.end() && param == params.end(), "Type parameters should match type variables" );
    258258                return gt;
    259259        }
  • src/ResolvExpr/PtrsCastable.cc

    r8396044 r6f71276  
    6868                return 1;
    6969        }
     70        int functionCast( Type *src, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
     71                return -1 * objectCast( src, env, indexer );  // reverse the sense of objectCast
     72        }
    7073
    7174        int ptrsCastable( Type *src, Type *dest, const TypeEnvironment &env, const SymTab::Indexer &indexer ) {
     
    106109
    107110        void PtrsCastable::visit(FunctionType *functionType) {
    108                 result = -1;
     111                // result = -1;
     112                result = functionCast( dest, env, indexer );
    109113        }
    110114
     
    136140
    137141        void PtrsCastable::visit(TypeInstType *inst) {
    138                 result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1;
     142                //result = objectCast( inst, env, indexer ) > 0 && objectCast( dest, env, indexer ) > 0 ? 1 : -1;
     143                result = objectCast( inst, env, indexer ) == objectCast( dest, env, indexer ) ? 1 : -1;
    139144        }
    140145
  • src/ResolvExpr/Unify.cc

    r8396044 r6f71276  
    134134                  case TypeDecl::Ftype:
    135135                        return isFtype( type, indexer );
    136                         case TypeDecl::Ttype:
     136                  case TypeDecl::Ttype:
    137137                        // ttype unifies with any tuple type
    138138                        return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );
     
    592592                for ( ; it != params.end() && jt != otherParams.end(); ++it, ++jt ) {
    593593                        TypeExpr *param = dynamic_cast< TypeExpr* >(*it);
    594                         assert(param && "Aggregate parameters should be type expressions");
     594                        assertf(param, "Aggregate parameters should be type expressions");
    595595                        TypeExpr *otherParam = dynamic_cast< TypeExpr* >(*jt);
    596                         assert(otherParam && "Aggregate parameters should be type expressions");
    597 
    598                         if ( ! unifyExact( param->get_type(), otherParam->get_type(), env, needAssertions, haveAssertions, openVars, WidenMode(false, false), indexer ) ) {
     596                        assertf(otherParam, "Aggregate parameters should be type expressions");
     597                       
     598                        Type* paramTy = param->get_type();
     599                        Type* otherParamTy = otherParam->get_type();
     600
     601                        bool tupleParam = Tuples::isTtype( paramTy );
     602                        bool otherTupleParam = Tuples::isTtype( otherParamTy );
     603
     604                        if ( tupleParam && otherTupleParam ) {
     605                                ++it; ++jt;  // skip ttype parameters for break
     606                        } else if ( tupleParam ) {
     607                                // bundle other parameters into tuple to match
     608                                TupleType* binder = new TupleType{ paramTy->get_qualifiers() };
     609
     610                                do {
     611                                        binder->get_types().push_back( otherParam->get_type()->clone() );
     612                                        ++jt;
     613
     614                                        if ( jt == otherParams.end() ) break;
     615
     616                                        otherParam = dynamic_cast< TypeExpr* >(*jt);
     617                                        assertf(otherParam, "Aggregate parameters should be type expressions");
     618                                } while (true);
     619
     620                                otherParamTy = binder;
     621                                ++it;  // skip ttype parameter for break
     622                        } else if ( otherTupleParam ) {
     623                                // bundle parameters into tuple to match other
     624                                TupleType* binder = new TupleType{ otherParamTy->get_qualifiers() };
     625
     626                                do {
     627                                        binder->get_types().push_back( param->get_type()->clone() );
     628                                        ++it;
     629
     630                                        if ( it == params.end() ) break;
     631
     632                                        param = dynamic_cast< TypeExpr* >(*it);
     633                                        assertf(param, "Aggregate parameters should be type expressions");
     634                                } while (true);
     635
     636                                paramTy = binder;
     637                                ++jt;  // skip ttype parameter for break
     638                        }
     639
     640                        if ( ! unifyExact( paramTy, otherParamTy, env, needAssertions, haveAssertions, openVars, WidenMode(false, false), indexer ) ) {
    599641                                result = false;
    600642                                return;
    601643                        }
     644
     645                        // ttype parameter should be last
     646                        if ( tupleParam || otherTupleParam ) break;
    602647                }
    603648                result = ( it == params.end() && jt == otherParams.end() );
  • src/libcfa/startup.h

    r8396044 r6f71276  
    1818#define STARTUP_H
    1919
     20#if GCC_VERSION > 50000
    2021extern "C" {
    2122        enum {
     
    2627        };
    2728}
     29#else
     30#define STARTUP_PRIORITY_CORE       101
     31#define STARTUP_PRIORITY_KERNEL     102
     32#define STARTUP_PRIORITY_MEMORY     103
     33#define STARTUP_PRIORITY_IOSTREAM   104
     34#endif
    2835
    2936#endif //STARTUP_H
Note: See TracChangeset for help on using the changeset viewer.