Changeset 64b6913 for src/GenPoly/Box.cc


Ignore:
Timestamp:
Mar 16, 2017, 8:19:39 AM (7 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:
26ba208
Parents:
6e8bd43
Message:

move type StorageClasses? from DeclarationNode? to Type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    r6e8bd43 r64b6913  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 14 07:45:29 2017
    13 // Update Count     : 334
     12// Last Modified On : Thu Mar 16 08:06:05 2017
     13// Update Count     : 337
    1414//
    1515
     
    289289                        TypeInstType paramType( Type::Qualifiers(), (*param)->get_name(), *param );
    290290                        std::string paramName = mangleType( &paramType );
    291                         layoutFnType->get_parameters().push_back( new ObjectDecl( sizeofName( paramName ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );
    292                         layoutFnType->get_parameters().push_back( new ObjectDecl( alignofName( paramName ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );
     291                        layoutFnType->get_parameters().push_back( new ObjectDecl( sizeofName( paramName ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );
     292                        layoutFnType->get_parameters().push_back( new ObjectDecl( alignofName( paramName ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );
    293293                }
    294294        }
     
    299299                // because each unit generates copies of the default routines for each aggregate.
    300300                FunctionDecl *layoutDecl = new FunctionDecl( layoutofName( typeDecl ),
    301                                                                                                          functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::Static ),
     301                                                                                                         functionNesting > 0 ? Type::StorageClasses() : Type::StorageClasses( Type::Static ),
    302302                                                                                                         LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ),
    303303                                                                                                         std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::Inline ) );
     
    368368                PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType );
    369369
    370                 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
     370                ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
    371371                layoutFnType->get_parameters().push_back( sizeParam );
    372                 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     372                ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    373373                layoutFnType->get_parameters().push_back( alignParam );
    374                 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     374                ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    375375                layoutFnType->get_parameters().push_back( offsetParam );
    376376                addOtypeParams( layoutFnType, otypeParams );
     
    429429                PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType );
    430430
    431                 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
     431                ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
    432432                layoutFnType->get_parameters().push_back( sizeParam );
    433                 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     433                ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), Type::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    434434                layoutFnType->get_parameters().push_back( alignParam );
    435435                addOtypeParams( layoutFnType, otypeParams );
     
    537537                                        if ( adapters.find( mangleName ) == adapters.end() ) {
    538538                                                std::string adapterName = makeAdapterName( mangleName );
    539                                                 adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) );
     539                                                adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) );
    540540                                        } // if
    541541                                } // for
     
    656656
    657657                ObjectDecl *Pass1::makeTemporary( Type *type ) {
    658                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, 0 );
     658                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, type, 0 );
    659659                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    660660                        return newObj;
     
    765765                                        Type * newType = param->clone();
    766766                                        if ( env ) env->apply( newType );
    767                                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, newType, 0 );
     767                                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, newType, 0 );
    768768                                        newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
    769769                                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
     
    831831                                makeRetParm( adapter );
    832832                        } // if
    833                         adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
     833                        adapter->get_parameters().push_front( new ObjectDecl( "", Type::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
    834834                        return adapter;
    835835                }
     
    912912                        adapterBody->get_kids().push_back( bodyStmt );
    913913                        std::string adapterName = makeAdapterName( mangleName );
    914                         return new FunctionDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, adapterType, adapterBody );
     914                        return new FunctionDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, adapterType, adapterBody );
    915915                }
    916916
     
    12731273                                if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
    12741274                                        std::string adapterName = makeAdapterName( mangleName );
    1275                                         paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
     1275                                        paramList.push_front( new ObjectDecl( adapterName, Type::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
    12761276                                        adaptersDone.insert( adaptersDone.begin(), mangleName );
    12771277                                }
     
    13791379                        std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin();
    13801380                        std::list< DeclarationWithType *> inferredParams;
    1381                         ObjectDecl newObj( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
    1382                         ObjectDecl newPtr( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0,
     1381                        ObjectDecl newObj( "", Type::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
     1382                        ObjectDecl newPtr( "", Type::StorageClasses(), LinkageSpec::C, 0,
    13831383                                           new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 );
    13841384                        for ( Type::ForallList::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) {
     
    16341634
    16351635                ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) {
    1636                         ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, init );
     1636                        ObjectDecl *newObj = new ObjectDecl( name, Type::StorageClasses(), LinkageSpec::C, 0, type, init );
    16371637                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    16381638                        return newObj;
     
    18181818                                                        memberDecl = origMember->clone();
    18191819                                                } else {
    1820                                                         memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, offsetType->clone(), 0 );
     1820                                                        memberDecl = new ObjectDecl( (*member)->get_name(), Type::StorageClasses(), LinkageSpec::Cforall, 0, offsetType->clone(), 0 );
    18211821                                                }
    18221822                                                inits.push_back( new SingleInit( new OffsetofExpr( ty->clone(), memberDecl ) ) );
Note: See TracChangeset for help on using the changeset viewer.