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/Validate.cc

    r7fe2498 ra7c90d4  
    1010// Created On       : Sun May 17 21:50:04 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  3 21:02:23 2017
    13 // Update Count     : 332
     12// Last Modified On : Tue Mar  7 07:51:36 2017
     13// Update Count     : 349
    1414//
    1515
     
    9797        class ReturnTypeFixer final : public Visitor {
    9898          public:
    99 
    10099                typedef Visitor Parent;
    101100                using Parent::visit;
     
    104103
    105104                virtual void visit( FunctionDecl * functionDecl );
    106 
    107105                virtual void visit( FunctionType * ftype );
    108106        };
     
    161159          private:
    162160                virtual void visit( FunctionDecl * functionDecl );
    163 
    164161                virtual void visit( ReturnStmt * returnStmt );
    165162
     
    211208
    212209        class CompoundLiteral final : public GenPoly::DeclMutator {
    213                 DeclarationNode::StorageClass storageclass = DeclarationNode::NoStorageClass;
     210                DeclarationNode::StorageClasses storageClasses;
    214211
    215212                using GenPoly::DeclMutator::mutate;
     
    694691                if ( FunctionType *funtype = dynamic_cast<FunctionType *>( ret->get_type() ) ) { // function type?
    695692                        // replace the current object declaration with a function declaration
    696                         FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClass(), ret->get_linkage(), funtype, 0, objDecl->get_attributes(), ret->get_funcSpec() );
     693                        FunctionDecl * newDecl = new FunctionDecl( ret->get_name(), ret->get_storageClasses(), ret->get_linkage(), funtype, 0, objDecl->get_attributes(), ret->get_funcSpec() );
    697694                        objDecl->get_attributes().clear();
    698695                        objDecl->set_type( nullptr );
     
    757754                                type = new EnumInstType( Type::Qualifiers(), newDeclEnumDecl->get_name() );
    758755                        } // if
    759                         TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), DeclarationNode::NoStorageClass, type ) );
     756                        TypedefDeclPtr tyDecl( new TypedefDecl( aggDecl->get_name(), DeclarationNode::StorageClasses(), type ) );
    760757                        typedefNames[ aggDecl->get_name() ] = std::make_pair( std::move( tyDecl ), scopeLevel );
    761758                } // if
     
    811808
    812809        DeclarationWithType * CompoundLiteral::mutate( ObjectDecl *objectDecl ) {
    813                 storageclass = objectDecl->get_storageClass();
     810                storageClasses = objectDecl->get_storageClasses();
    814811                DeclarationWithType * temp = Mutator::mutate( objectDecl );
    815                 storageclass = DeclarationNode::NoStorageClass;
    816812                return temp;
    817813        }
     
    822818                static UniqueName indexName( "_compLit" );
    823819
    824                 ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageclass, LinkageSpec::C, 0, compLitExpr->get_type(), compLitExpr->get_initializer() );
     820                ObjectDecl *tempvar = new ObjectDecl( indexName.newName(), storageClasses, LinkageSpec::C, 0, compLitExpr->get_type(), compLitExpr->get_initializer() );
    825821                compLitExpr->set_type( 0 );
    826822                compLitExpr->set_initializer( 0 );
     
    861857                        TupleType * tupleType = safe_dynamic_cast< TupleType * >( ResolvExpr::extractResultType( ftype ) );
    862858                        // ensure return value is not destructed by explicitly creating an empty ListInit node wherein maybeConstruct is false.
    863                         ObjectDecl * newRet = new ObjectDecl( "", DeclarationNode::NoStorageClass, LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );
     859                        ObjectDecl * newRet = new ObjectDecl( "", DeclarationNode::StorageClasses(), LinkageSpec::Cforall, 0, tupleType, new ListInit( std::list<Initializer*>(), noDesignators, false ) );
    864860                        deleteAll( retVals );
    865861                        retVals.clear();
Note: See TracChangeset for help on using the changeset viewer.