Changes in / [c029f4d:a16a7ec]


Ignore:
Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    rc029f4d ra16a7ec  
    855855                        DeclarationWithType *adapteeDecl = adapterType->get_parameters().front();
    856856                        adapteeDecl->set_name( "_adaptee" );
    857                         // do not carry over attributes to real type parameters/return values
    858                         for ( DeclarationWithType * dwt : realType->parameters ) {
    859                                 deleteAll( dwt->get_type()->attributes );
    860                                 dwt->get_type()->attributes.clear();
    861                         }
    862                         for ( DeclarationWithType * dwt : realType->returnVals ) {
    863                                 deleteAll( dwt->get_type()->attributes );
    864                                 dwt->get_type()->attributes.clear();
    865                         }
    866857                        ApplicationExpr *adapteeApp = new ApplicationExpr( new CastExpr( new VariableExpr( adapteeDecl ), new PointerType( Type::Qualifiers(), realType ) ) );
    867858                        Statement *bodyStmt;
  • src/Parser/TypeData.cc

    rc029f4d ra16a7ec  
    792792
    793793
    794 NamedTypeDecl * buildSymbolic( const TypeData * td, std::list< Attribute * > attributes, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {
     794NamedTypeDecl * buildSymbolic( const TypeData * td, const string & name, Type::StorageClasses scs, LinkageSpec::Spec linkage ) {
    795795        assert( td->kind == TypeData::Symbolic );
    796796        NamedTypeDecl * ret;
     
    803803        buildList( td->symbolic.params, ret->get_parameters() );
    804804        buildList( td->symbolic.assertions, ret->get_assertions() );
    805         ret->base->attributes.splice( ret->base->attributes.end(), attributes );
    806805        return ret;
    807806} // buildSymbolic
     
    867866                return buildEnum( td, attributes, linkage );
    868867        } else if ( td->kind == TypeData::Symbolic ) {
    869                 return buildSymbolic( td, attributes, name, scs, linkage );
     868                return buildSymbolic( td, name, scs, linkage );
    870869        } else {
    871870                return (new ObjectDecl( name, scs, linkage, bitfieldWidth, typebuild( td ), init, attributes ))->set_asmName( asmName );
  • src/SymTab/Autogen.cc

    rc029f4d ra16a7ec  
    372372                                continue;
    373373                        }
    374                         // do not carry over field's attributes to parameter type
    375                         Type * paramType = field->get_type()->clone();
    376                         deleteAll( paramType->attributes );
    377                         paramType->attributes.clear();
    378                         // add a parameter corresponding to this field
    379                         memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType, nullptr ) );
     374                        memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 ) );
    380375                        FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting );
    381376                        makeFieldCtorBody( aggregateDecl->members.begin(), aggregateDecl->members.end(), ctor );
     
    508503                                break;
    509504                        }
    510                         // do not carry over field's attributes to parameter type
    511                         Type * paramType = field->get_type()->clone();
    512                         deleteAll( paramType->attributes );
    513                         paramType->attributes.clear();
    514                         // add a parameter corresponding to this field
    515                         memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType, nullptr ) );
     505                        memCtorType->parameters.push_back( new ObjectDecl( field->name, Type::StorageClasses(), LinkageSpec::Cforall, nullptr, field->get_type()->clone(), nullptr ) );
    516506                        FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting );
    517507                        ObjectDecl * srcParam = strict_dynamic_cast<ObjectDecl *>( ctor->type->parameters.back() );
  • src/SymTab/Validate.cc

    rc029f4d ra16a7ec  
    201201                Declaration * postmutate( TraitDecl * contextDecl );
    202202
    203                 void premutate( FunctionType * ftype );
    204 
    205203          private:
    206204                template<typename AggDecl>
     
    216214                TypeDeclMap typedeclNames;
    217215                int scopeLevel;
    218                 bool inFunctionType = false;
    219216        };
    220217
     
    728725                        Type *ret = def->second.first->base->clone();
    729726                        ret->get_qualifiers() |= typeInst->get_qualifiers();
    730                         // attributes are not carried over from typedef to function parameters/return values
    731                         if ( ! inFunctionType ) {
    732                                 ret->attributes.splice( ret->attributes.end(), typeInst->attributes );
    733                         } else {
    734                                 deleteAll( ret->attributes );
    735                                 ret->attributes.clear();
    736                         }
    737727                        // place instance parameters on the typedef'd type
    738728                        if ( ! typeInst->parameters.empty() ) {
     
    911901        Declaration *EliminateTypedef::postmutate( TraitDecl * traitDecl ) {
    912902                return handleAggregate( traitDecl );
    913         }
    914 
    915         void EliminateTypedef::premutate( FunctionType * ) {
    916                 GuardValue( inFunctionType );
    917                 inFunctionType = true;
    918903        }
    919904
  • src/tests/polymorphism.c

    rc029f4d ra16a7ec  
    8989                // ensure that the size of aggregates with polymorphic members
    9090                // matches the size of the aggregates in a monomorphic context
    91                 size_t ssz = struct_size(x, y);
    92                 size_t usz = union_size(x, y);
    93                 assertf( ssz == sizeof(S), "struct size differs in polymorphic context: %zd / %zd", ssz, sizeof(S));
    94                 assertf( usz == sizeof(U), "union size differs in polymorphic context: %zd / %zd", usz, sizeof(U));
     91                assertf( struct_size(x, y) == sizeof(S), "struct size differs in polymorphic context." );
     92                assertf( union_size(x, y) == sizeof(U), "union size differs in polymorphic context." );
    9593
    9694                y_type ?=?(y_type & this, zero_t) {
Note: See TracChangeset for help on using the changeset viewer.