Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/Box.cc

    ra7c90d4 r3a5131ed  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar  6 23:45:59 2017
    13 // Update Count     : 330
     12// Last Modified On : Thu Feb 16 14:57:16 2017
     13// Update Count     : 297
    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 ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );
     292                        layoutFnType->get_parameters().push_back( new ObjectDecl( alignofName( paramName ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignType.clone(), 0 ) );
    293293                }
    294294        }
     
    298298                // Routines at global scope marked "static" to prevent multiple definitions is separate translation units
    299299                // because each unit generates copies of the default routines for each aggregate.
    300                 FunctionDecl *layoutDecl = new FunctionDecl( layoutofName( typeDecl ),
    301                                                                                                          functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::StaticClass ),
    302                                                                                                          LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ),
    303                                                                                                          std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) );
     300                FunctionDecl *layoutDecl = new FunctionDecl(
     301                        layoutofName( typeDecl ), functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ), true, false );
    304302                layoutDecl->fixUniqueId();
    305303                return layoutDecl;
     
    368366                PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType );
    369367
    370                 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
     368                ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
    371369                layoutFnType->get_parameters().push_back( sizeParam );
    372                 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     370                ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    373371                layoutFnType->get_parameters().push_back( alignParam );
    374                 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     372                ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    375373                layoutFnType->get_parameters().push_back( offsetParam );
    376374                addOtypeParams( layoutFnType, otypeParams );
     
    429427                PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType );
    430428
    431                 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
     429                ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
    432430                layoutFnType->get_parameters().push_back( sizeParam );
    433                 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     431                ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    434432                layoutFnType->get_parameters().push_back( alignParam );
    435433                addOtypeParams( layoutFnType, otypeParams );
     
    537535                                        if ( adapters.find( mangleName ) == adapters.end() ) {
    538536                                                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 ) ) );
     537                                                adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) );
    540538                                        } // if
    541539                                } // for
     
    656654
    657655                ObjectDecl *Pass1::makeTemporary( Type *type ) {
    658                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, 0 );
     656                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, 0 );
    659657                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    660658                        return newObj;
     
    765763                                        Type * newType = param->clone();
    766764                                        if ( env ) env->apply( newType );
    767                                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, newType, 0 );
     765                                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, newType, 0 );
    768766                                        newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
    769767                                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
     
    831829                                makeRetParm( adapter );
    832830                        } // if
    833                         adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
     831                        adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
    834832                        return adapter;
    835833                }
     
    912910                        adapterBody->get_kids().push_back( bodyStmt );
    913911                        std::string adapterName = makeAdapterName( mangleName );
    914                         return new FunctionDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, adapterType, adapterBody );
     912                        return new FunctionDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, adapterType, adapterBody, false, false );
    915913                }
    916914
     
    12731271                                if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
    12741272                                        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 ) );
     1273                                        paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
    12761274                                        adaptersDone.insert( adaptersDone.begin(), mangleName );
    12771275                                }
     
    13791377                        std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin();
    13801378                        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,
     1379                        ObjectDecl newObj( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
     1380                        ObjectDecl newPtr( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0,
    13831381                                           new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 );
    13841382                        for ( Type::ForallList::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) {
     
    16341632
    16351633                ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) {
    1636                         ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, init );
     1634                        ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, init );
    16371635                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    16381636                        return newObj;
     
    18181816                                                        memberDecl = origMember->clone();
    18191817                                                } else {
    1820                                                         memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, offsetType->clone(), 0 );
     1818                                                        memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, offsetType->clone(), 0 );
    18211819                                                }
    18221820                                                inits.push_back( new SingleInit( new OffsetofExpr( ty->clone(), memberDecl ) ) );
Note: See TracChangeset for help on using the changeset viewer.