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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Autogen.cc

    r7fe2498 ra7c90d4  
    1010// Created On       : Thu Mar 03 15:45:56 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  3 22:00:55 2017
    13 // Update Count     : 30
     12// Last Modified On : Tue Mar  7 07:42:44 2017
     13// Update Count     : 51
    1414//
    1515
     
    125125        FunctionType * genDefaultType( Type * paramType ) {
    126126                FunctionType *ftype = new FunctionType( Type::Qualifiers(), false );
    127                 ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr );
     127                ObjectDecl *dstParam = new ObjectDecl( "_dst", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), paramType->clone() ), nullptr );
    128128                ftype->get_parameters().push_back( dstParam );
    129129
     
    134134        FunctionType * genCopyType( Type * paramType ) {
    135135                FunctionType *ftype = genDefaultType( paramType );
    136                 ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
     136                ObjectDecl *srcParam = new ObjectDecl( "_src", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
    137137                ftype->get_parameters().push_back( srcParam );
    138138                return ftype;
     
    142142        FunctionType * genAssignType( Type * paramType ) {
    143143                FunctionType *ftype = genCopyType( paramType );
    144                 ObjectDecl *returnVal = new ObjectDecl( "_ret", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
     144                ObjectDecl *returnVal = new ObjectDecl( "_ret", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, paramType->clone(), nullptr );
    145145                ftype->get_returnVals().push_back( returnVal );
    146146                return ftype;
     
    161161                // Routines at global scope marked "static" to prevent multiple definitions in separate translation units
    162162                // because each unit generates copies of the default routines for each aggregate.
    163                 DeclarationNode::StorageClass sc = functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static;
     163//              DeclarationNode::StorageClass sc = functionNesting > 0 ? DeclarationNode::NoStorageClass : DeclarationNode::Static;
     164                DeclarationNode::StorageClasses scs = functionNesting > 0 ? DeclarationNode::StorageClasses() : DeclarationNode::StorageClasses( DeclarationNode::StaticClass );
    164165                LinkageSpec::Spec spec = isIntrinsic ? LinkageSpec::Intrinsic : LinkageSpec::AutoGen;
    165                 FunctionDecl * decl = new FunctionDecl( fname, sc, spec, ftype, new CompoundStmt( noLabels ),
    166                                                                                                 std::list< Attribute * >(), DeclarationNode::FuncSpecifier( DeclarationNode::InlineSpec ) );
     166                FunctionDecl * decl = new FunctionDecl( fname, scs, spec, ftype, new CompoundStmt( noLabels ),
     167                                                                                                std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) );
    167168                decl->fixUniqueId();
    168169                return decl;
     
    459460                                        continue;
    460461                                }
    461                                 memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) );
     462                                memCtorType->get_parameters().push_back( new ObjectDecl( member->get_name(), DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, member->get_type()->clone(), 0 ) );
    462463                                FunctionDecl * ctor = genFunc( "?{}", memCtorType->clone(), functionNesting );
    463464                                makeStructFieldCtorBody( aggregateDecl->get_members().begin(), aggregateDecl->get_members().end(), ctor, isDynamicLayout );
     
    539540                for ( Declaration * member : aggregateDecl->get_members() ) {
    540541                        if ( DeclarationWithType * field = dynamic_cast< DeclarationWithType * >( member ) ) {
    541                                 ObjectDecl * srcParam = new ObjectDecl( "src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 );
     542                                ObjectDecl * srcParam = new ObjectDecl( "src", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, field->get_type()->clone(), 0 );
    542543
    543544                                FunctionType * memCtorType = ctorType->clone();
     
    604605                TypeInstType *typeInst = new TypeInstType( Type::Qualifiers(), typeDecl->get_name(), false );
    605606                typeInst->set_baseType( typeDecl );
    606                 ObjectDecl *src = new ObjectDecl( "_src", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, typeInst->clone(), nullptr );
    607                 ObjectDecl *dst = new ObjectDecl( "_dst", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), typeInst->clone() ), nullptr );
     607                ObjectDecl *src = new ObjectDecl( "_src", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, typeInst->clone(), nullptr );
     608                ObjectDecl *dst = new ObjectDecl( "_dst", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, nullptr, new PointerType( Type::Qualifiers(), typeInst->clone() ), nullptr );
    608609
    609610                std::list< Statement * > stmts;
     
    617618                } // if
    618619                FunctionType *type = new FunctionType( Type::Qualifiers(), false );
    619                 type->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, typeInst, 0 ) );
     620                type->get_returnVals().push_back( new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, typeInst, 0 ) );
    620621                type->get_parameters().push_back( dst );
    621622                type->get_parameters().push_back( src );
     
    716717                        if ( TypeInstType * ty = dynamic_cast< TypeInstType * >( t ) ) {
    717718                                if ( ! done.count( ty->get_baseType() ) ) {
    718                                         TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), DeclarationNode::NoStorageClass, nullptr, TypeDecl::Any );
     719                                        TypeDecl * newDecl = new TypeDecl( ty->get_baseType()->get_name(), DeclarationNode::StorageClasses(), nullptr, TypeDecl::Any );
    719720                                        TypeInstType * inst = new TypeInstType( Type::Qualifiers(), newDecl->get_name(), newDecl );
    720                                         newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genAssignType( inst ), nullptr,
    721                                                                                                                                                    std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) );
    722                                         newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genDefaultType( inst ), nullptr,
    723                                                                                                                                                    std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) );
    724                                         newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genCopyType( inst ), nullptr,
    725                                                                                                                                                    std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) );
    726                                         newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, genDefaultType( inst ), nullptr,
    727                                                                                                                                                    std::list< Attribute * >(), DeclarationNode::FuncSpec( DeclarationNode::InlineSpec ) ) );
     721                                        newDecl->get_assertions().push_back( new FunctionDecl( "?=?", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genAssignType( inst ), nullptr,
     722                                                                                                                                                   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
     723                                        newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr,
     724                                                                                                                                                   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
     725                                        newDecl->get_assertions().push_back( new FunctionDecl( "?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genCopyType( inst ), nullptr,
     726                                                                                                                                                   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
     727                                        newDecl->get_assertions().push_back( new FunctionDecl( "^?{}", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, genDefaultType( inst ), nullptr,
     728                                                                                                                                                   std::list< Attribute * >(), DeclarationNode::FuncSpecifiers( DeclarationNode::InlineSpec ) ) );
    728729                                        typeParams.push_back( newDecl );
    729730                                        done.insert( ty->get_baseType() );
Note: See TracChangeset for help on using the changeset viewer.