Changeset a7c90d4 for src/GenPoly


Ignore:
Timestamp:
Mar 7, 2017, 8:33:43 AM (8 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:
64cb860, c3396e0
Parents:
7fe2498
Message:

change StorageClass? to bitset, support _Thread_local as separate storage-class

Location:
src/GenPoly
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/GenPoly/Box.cc

    r7fe2498 ra7c90d4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  3 21:57:15 2017
    13 // Update Count     : 310
     12// Last Modified On : Mon Mar  6 23:45:59 2017
     13// Update Count     : 330
    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::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 ) );
     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 ) );
    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(
    301                         layoutofName( typeDecl ), functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static, LinkageSpec::AutoGen, layoutFnType, new CompoundStmt( noLabels ),
    302                         std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) );
     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 ) );
    303304                layoutDecl->fixUniqueId();
    304305                return layoutDecl;
     
    367368                PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType );
    368369
    369                 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
     370                ObjectDecl *sizeParam = new ObjectDecl( sizeofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
    370371                layoutFnType->get_parameters().push_back( sizeParam );
    371                 ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     372                ObjectDecl *alignParam = new ObjectDecl( alignofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    372373                layoutFnType->get_parameters().push_back( alignParam );
    373                 ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     374                ObjectDecl *offsetParam = new ObjectDecl( offsetofName( structDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    374375                layoutFnType->get_parameters().push_back( offsetParam );
    375376                addOtypeParams( layoutFnType, otypeParams );
     
    428429                PointerType *sizeAlignOutType = new PointerType( Type::Qualifiers(), sizeAlignType );
    429430
    430                 ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
     431                ObjectDecl *sizeParam = new ObjectDecl( sizeofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType, 0 );
    431432                layoutFnType->get_parameters().push_back( sizeParam );
    432                 ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
     433                ObjectDecl *alignParam = new ObjectDecl( alignofName( unionDecl->get_name() ), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, sizeAlignOutType->clone(), 0 );
    433434                layoutFnType->get_parameters().push_back( alignParam );
    434435                addOtypeParams( layoutFnType, otypeParams );
     
    536537                                        if ( adapters.find( mangleName ) == adapters.end() ) {
    537538                                                std::string adapterName = makeAdapterName( mangleName );
    538                                                 adapters.insert( std::pair< std::string, DeclarationWithType *>( mangleName, new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, nullptr, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), nullptr ) ) );
     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 ) ) );
    539540                                        } // if
    540541                                } // for
     
    655656
    656657                ObjectDecl *Pass1::makeTemporary( Type *type ) {
    657                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, 0 );
     658                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, 0 );
    658659                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    659660                        return newObj;
     
    764765                                        Type * newType = param->clone();
    765766                                        if ( env ) env->apply( newType );
    766                                         ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, 0, newType, 0 );
     767                                        ObjectDecl *newObj = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, newType, 0 );
    767768                                        newObj->get_type()->get_qualifiers() = Type::Qualifiers(); // TODO: is this right???
    768769                                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
     
    830831                                makeRetParm( adapter );
    831832                        } // if
    832                         adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
     833                        adapter->get_parameters().push_front( new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), new FunctionType( Type::Qualifiers(), true ) ), 0 ) );
    833834                        return adapter;
    834835                }
     
    911912                        adapterBody->get_kids().push_back( bodyStmt );
    912913                        std::string adapterName = makeAdapterName( mangleName );
    913                         return new FunctionDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, adapterType, adapterBody );
     914                        return new FunctionDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, adapterType, adapterBody );
    914915                }
    915916
     
    12721273                                if ( adaptersDone.find( mangleName ) == adaptersDone.end() ) {
    12731274                                        std::string adapterName = makeAdapterName( mangleName );
    1274                                         paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
     1275                                        paramList.push_front( new ObjectDecl( adapterName, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new PointerType( Type::Qualifiers(), makeAdapterType( *funType, scopeTyVars ) ), 0 ) );
    12751276                                        adaptersDone.insert( adaptersDone.begin(), mangleName );
    12761277                                }
     
    13781379                        std::list< DeclarationWithType *>::iterator last = funcType->get_parameters().begin();
    13791380                        std::list< DeclarationWithType *> inferredParams;
    1380                         ObjectDecl newObj( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
    1381                         ObjectDecl newPtr( "", DeclarationNode::NoStorageClass, LinkageSpec::C, 0,
     1381                        ObjectDecl newObj( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0, new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ), 0 );
     1382                        ObjectDecl newPtr( "", DeclarationNode::StorageClasses(), LinkageSpec::C, 0,
    13821383                                           new PointerType( Type::Qualifiers(), new BasicType( Type::Qualifiers(), BasicType::LongUnsignedInt ) ), 0 );
    13831384                        for ( Type::ForallList::const_iterator tyParm = funcType->get_forall().begin(); tyParm != funcType->get_forall().end(); ++tyParm ) {
     
    16331634
    16341635                ObjectDecl *PolyGenericCalculator::makeVar( const std::string &name, Type *type, Initializer *init ) {
    1635                         ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::NoStorageClass, LinkageSpec::C, 0, type, init );
     1636                        ObjectDecl *newObj = new ObjectDecl( name, DeclarationNode::StorageClasses(), LinkageSpec::C, 0, type, init );
    16361637                        stmtsToAdd.push_back( new DeclStmt( noLabels, newObj ) );
    16371638                        return newObj;
     
    18171818                                                        memberDecl = origMember->clone();
    18181819                                                } else {
    1819                                                         memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, offsetType->clone(), 0 );
     1820                                                        memberDecl = new ObjectDecl( (*member)->get_name(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, offsetType->clone(), 0 );
    18201821                                                }
    18211822                                                inits.push_back( new SingleInit( new OffsetofExpr( ty->clone(), memberDecl ) ) );
  • TabularUnified src/GenPoly/Specialize.cc

    r7fe2498 ra7c90d4  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  3 21:54:45 2017
    13 // Update Count     : 28
     12// Last Modified On : Mon Mar  6 23:13:00 2017
     13// Update Count     : 30
    1414//
    1515
     
    155155                } // if
    156156                // create new thunk with same signature as formal type (C linkage, empty body)
    157                 FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::NoStorageClass, LinkageSpec::C, newType, new CompoundStmt( noLabels ) );
     157                FunctionDecl *thunkFunc = new FunctionDecl( thunkNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, newType, new CompoundStmt( noLabels ) );
    158158                thunkFunc->fixUniqueId();
    159159
Note: See TracChangeset for help on using the changeset viewer.