Ignore:
Timestamp:
Mar 16, 2017, 8:23:42 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
git-author:
Peter A. Buhr <pabuhr@…> (03/16/17 08:19:39)
git-committer:
Peter A. Buhr <pabuhr@…> (03/16/17 08:23:42)
Message:

move type StorageClasses? from DeclarationNode? to Type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixInit.cc

    r6e8bd43 r68fe077a  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar 14 08:05:28 2017
    13 // Update Count     : 63
     12// Last Modified On : Thu Mar 16 08:08:04 2017
     13// Update Count     : 67
    1414//
    1515
     
    437437                        result = result->clone();
    438438                        env->apply( result );
    439                         ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, result, 0 );
     439                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    440440                        tmp->get_type()->set_isConst( false );
    441441
     
    483483                                result = result->clone();
    484484                                env->apply( result );
    485                                 ObjectDecl * ret = new ObjectDecl( retNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, result, 0 );
     485                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    486486                                ret->get_type()->set_isConst( false );
    487487                                impCpCtorExpr->get_returnDecls().push_back( ret );
     
    506506                                result = result->clone();
    507507                                env->apply( result );
    508                                 ObjectDecl * ret = new ObjectDecl( retNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, 0, result, 0 );
     508                                ObjectDecl * ret = new ObjectDecl( retNamer.newName(), Type::StorageClasses(), LinkageSpec::C, 0, result, 0 );
    509509                                ret->get_type()->set_isConst( false );
    510510                                stmtExpr->get_returnDecls().push_front( ret );
     
    538538                        } else {
    539539                                // expr isn't a call expr, so create a new temporary variable to use to hold the value of the unique expression
    540                                 unqExpr->set_object( new ObjectDecl( toString("_unq_expr_", unqExpr->get_id()), DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) );
     540                                unqExpr->set_object( new ObjectDecl( toString("_unq_expr_", unqExpr->get_id()), Type::StorageClasses(), LinkageSpec::C, nullptr, unqExpr->get_result()->clone(), nullptr ) );
    541541                                unqExpr->set_var( new VariableExpr( unqExpr->get_object() ) );
    542542                        }
     
    704704                                                BasicType * boolType = new BasicType( Type::Qualifiers(), BasicType::Bool );
    705705                                                SingleInit * boolInitExpr = new SingleInit( new ConstantExpr( Constant( boolType->clone(), "1" ) ), noDesignators );
    706                                                 ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, boolType, boolInitExpr );
     706                                                ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", Type::StorageClasses( Type::Static ), LinkageSpec::Cforall, 0, boolType, boolInitExpr );
    707707                                                isUninitializedVar->fixUniqueId();
    708708
     
    731731
    732732                                                        // void __objName_dtor_atexitN(...) {...}
    733                                                         FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
     733                                                        FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), Type::StorageClasses( Type::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
    734734                                                        dtorCaller->fixUniqueId();
    735735                                                        dtorCaller->get_statements()->push_back( dtorStmt );
     
    764764                                                        // create a new object which is never used
    765765                                                        static UniqueName dummyNamer( "_dummy" );
    766                                                         ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
     766                                                        ObjectDecl * dummy = new ObjectDecl( dummyNamer.newName(), Type::StorageClasses( Type::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
    767767                                                        return dummy;
    768768                                                }
     
    11181118
    11191119                        // xxx - ideally we would reuse the temporary generated from the copy constructor passes from within firstArg if it exists and not generate a temporary if it's unnecessary.
    1120                         ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), DeclarationNode::StorageClasses(), LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );
     1120                        ObjectDecl * tmp = new ObjectDecl( tempNamer.newName(), Type::StorageClasses(), LinkageSpec::C, nullptr, ctorExpr->get_result()->clone(), nullptr );
    11211121                        addDeclaration( tmp );
    11221122
Note: See TracChangeset for help on using the changeset viewer.