Changeset f072892


Ignore:
Timestamp:
Jul 30, 2018, 4:43:47 PM (6 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, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
Children:
4934ea3
Parents:
1be845b
git-author:
Rob Schluntz <rschlunt@…> (07/26/18 15:01:42)
git-committer:
Rob Schluntz <rschlunt@…> (07/30/18 16:43:47)
Message:

Minor cleanup

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/FixGlobalInit.cc

    r1be845b rf072892  
    102102                if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) {
    103103                        // a decision should have been made by the resolver, so ctor and init are not both non-NULL
    104                         assert( ! ctorInit->get_ctor() || ! ctorInit->get_init() );
     104                        assert( ! ctorInit->ctor || ! ctorInit->init );
    105105
    106                         Statement * dtor = ctorInit->get_dtor();
     106                        Statement * dtor = ctorInit->dtor;
    107107                        if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) {
    108108                                // don't need to call intrinsic dtor, because it does nothing, but
    109109                                // non-intrinsic dtors must be called
    110110                                destroyStatements.push_front( dtor );
    111                                 ctorInit->set_dtor( NULL );
     111                                ctorInit->dtor = nullptr;
    112112                        } // if
    113                         if ( Statement * ctor = ctorInit->get_ctor() ) {
     113                        if ( Statement * ctor = ctorInit->ctor ) {
    114114                                initStatements.push_back( ctor );
    115                                 objDecl->set_init( NULL );
    116                                 ctorInit->set_ctor( NULL );
    117                         } else if ( Initializer * init = ctorInit->get_init() ) {
    118                                 objDecl->set_init( init );
    119                                 ctorInit->set_init( NULL );
     115                                objDecl->init = nullptr;
     116                                ctorInit->ctor = nullptr;
     117                        } else if ( Initializer * init = ctorInit->init ) {
     118                                objDecl->init = init;
     119                                ctorInit->init = nullptr;
    120120                        } else {
    121121                                // no constructor and no initializer, which is okay
    122                                 objDecl->set_init( NULL );
     122                                objDecl->init = nullptr;
    123123                        } // if
    124124                        delete ctorInit;
  • src/InitTweak/InitTweak.cc

    r1be845b rf072892  
    408408                return allofCtorDtor( stmt, []( Expression * callExpr ){
    409409                        if ( ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) {
    410                                 FunctionType *funcType = GenPoly::getFunctionType( appExpr->get_function()->get_result() );
     410                                FunctionType *funcType = GenPoly::getFunctionType( appExpr->function->result );
    411411                                assert( funcType );
    412412                                return funcType->get_parameters().size() == 1;
  • src/ResolvExpr/CurrentObject.cc

    r1be845b rf072892  
    139139                ArrayIterator( ArrayType * at ) : array( at ) {
    140140                        PRINT( std::cerr << "Creating array iterator: " << at << std::endl; )
    141                         base = at->get_base();
     141                        base = at->base;
    142142                        memberIter = createMemberIterator( base );
    143                         if ( at->isVarLen ) SemanticError( at, "VLA initialization does not support @=" );
    144                         setSize( at->get_dimension() );
     143                        if ( at->isVarLen ) SemanticError( at, "VLA initialization does not support @=: " );
     144                        setSize( at->dimension );
    145145                }
    146146
  • src/SymTab/Validate.cc

    r1be845b rf072892  
    12321232        void ArrayLength::previsit( ObjectDecl * objDecl ) {
    12331233                if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->type ) ) {
    1234                         if ( at->get_dimension() ) return;
     1234                        if ( at->dimension ) return;
    12351235                        if ( ListInit * init = dynamic_cast< ListInit * >( objDecl->init ) ) {
    1236                                 at->set_dimension( new ConstantExpr( Constant::from_ulong( init->initializers.size() ) ) );
     1236                                at->dimension = new ConstantExpr( Constant::from_ulong( init->initializers.size() ) );
    12371237                        }
    12381238                }
Note: See TracChangeset for help on using the changeset viewer.