Changeset 2f26687a for src/InitTweak


Ignore:
Timestamp:
Mar 14, 2017, 3:17:20 PM (8 years ago)
Author:
Rob Schluntz <rschlunt@…>
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:
1fbab5a
Parents:
88d1066 (diff), 4da6a6c (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:/u/cforall/software/cfa/cfa-cc

Location:
src/InitTweak
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixGlobalInit.cc

    r88d1066 r2f26687a  
    1010// Created On       : Mon May 04 15:14:56 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Mar  6 23:14:19 2017
    13 // Update Count     : 14
     12// Last Modified On : Mon Mar 13 23:58:27 2017
     13// Update Count     : 16
    1414//
    1515
     
    8787                        dtorParameters.push_back( new ConstantExpr( Constant::from_int( 102 ) ) );
    8888                }
    89                 initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
     89                initFunction = new FunctionDecl( "_init_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
    9090                initFunction->get_attributes().push_back( new Attribute( "constructor", ctorParameters ) );
    91                 destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::StaticClass ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
     91                destroyFunction = new FunctionDecl( "_destroy_" + fixedName, DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
    9292                destroyFunction->get_attributes().push_back( new Attribute( "destructor", dtorParameters ) );
    9393        }
     
    143143// compile-command: "make install" //
    144144// End: //
    145 
  • src/InitTweak/FixInit.cc

    r88d1066 r2f26687a  
    1010// Created On       : Wed Jan 13 16:29:30 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar  7 07:51:40 2017
    13 // Update Count     : 59
     12// Last Modified On : Tue Mar 14 08:05:28 2017
     13// Update Count     : 63
    1414//
    1515
     
    678678                                assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
    679679                                if ( Statement * ctor = ctorInit->get_ctor() ) {
    680                                         if ( objDecl->get_storageClasses()[ DeclarationNode::Static ] ) {
     680                                        if ( objDecl->get_storageClasses().is_static ) {
    681681                                                // originally wanted to take advantage of gcc nested functions, but
    682682                                                // we get memory errors with this approach. To remedy this, the static
     
    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::StaticClass ), LinkageSpec::Cforall, 0, boolType, boolInitExpr );
     706                                                ObjectDecl * isUninitializedVar = new ObjectDecl( objDecl->get_mangleName() + "_uninitialized", DeclarationNode::StorageClasses( DeclarationNode::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::StaticClass ), LinkageSpec::C, new FunctionType( Type::Qualifiers(), false ), new CompoundStmt( noLabels ) );
     733                                                        FunctionDecl * dtorCaller = new FunctionDecl( objDecl->get_mangleName() + dtorCallerNamer.newName(), DeclarationNode::StorageClasses( DeclarationNode::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::StaticClass ), 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(), DeclarationNode::StorageClasses( DeclarationNode::Static ), LinkageSpec::Cforall, 0, new PointerType( Type::Qualifiers(), new VoidType( Type::Qualifiers() ) ), 0, std::list< Attribute * >{ new Attribute("unused") } );
    767767                                                        return dummy;
    768768                                                }
     
    821821                void InsertDtors::visit( ObjectDecl * objDecl ) {
    822822                        // remember non-static destructed objects so that their destructors can be inserted later
    823                         if ( ! objDecl->get_storageClasses()[ DeclarationNode::Static ] ) {
     823                        if ( ! objDecl->get_storageClasses().is_static ) {
    824824                                if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
    825825                                        // a decision should have been made by the resolver, so ctor and init are not both non-NULL
  • src/InitTweak/GenInit.cc

    r88d1066 r2f26687a  
    1010// Created On       : Mon May 18 07:44:20 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Mar  7 07:51:38 2017
    13 // Update Count     : 179
     12// Last Modified On : Mon Mar 13 23:59:09 2017
     13// Update Count     : 180
    1414//
    1515
     
    186186                // C doesn't allow variable sized arrays at global scope or for static variables, so don't hoist dimension.
    187187                if ( ! inFunction ) return;
    188                 if ( storageClasses[ DeclarationNode::StaticClass] ) return;
     188                if ( storageClasses.is_static ) return;
    189189
    190190                if ( ArrayType * arrayType = dynamic_cast< ArrayType * >( type ) ) {
  • src/InitTweak/InitTweak.cc

    r88d1066 r2f26687a  
    260260                        (objDecl->get_init() == NULL ||
    261261                                ( objDecl->get_init() != NULL && objDecl->get_init()->get_maybeConstructed() ))
    262                         && ! objDecl->get_storageClasses()[ DeclarationNode::Extern ];
     262                        && ! objDecl->get_storageClasses().is_extern;
    263263        }
    264264
Note: See TracChangeset for help on using the changeset viewer.