Changeset f072892
- Timestamp:
- Jul 30, 2018, 4:43:47 PM (5 years ago)
- 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)
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/InitTweak/FixGlobalInit.cc
r1be845b rf072892 102 102 if ( ConstructorInit * ctorInit = dynamic_cast< ConstructorInit * >( objDecl->get_init() ) ) { 103 103 // 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 ); 105 105 106 Statement * dtor = ctorInit-> get_dtor();106 Statement * dtor = ctorInit->dtor; 107 107 if ( dtor && ! isIntrinsicSingleArgCallStmt( dtor ) ) { 108 108 // don't need to call intrinsic dtor, because it does nothing, but 109 109 // non-intrinsic dtors must be called 110 110 destroyStatements.push_front( dtor ); 111 ctorInit-> set_dtor( NULL );111 ctorInit->dtor = nullptr; 112 112 } // if 113 if ( Statement * ctor = ctorInit-> get_ctor()) {113 if ( Statement * ctor = ctorInit->ctor ) { 114 114 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; 120 120 } else { 121 121 // no constructor and no initializer, which is okay 122 objDecl-> set_init( NULL );122 objDecl->init = nullptr; 123 123 } // if 124 124 delete ctorInit; -
src/InitTweak/InitTweak.cc
r1be845b rf072892 408 408 return allofCtorDtor( stmt, []( Expression * callExpr ){ 409 409 if ( ApplicationExpr * appExpr = isIntrinsicCallExpr( callExpr ) ) { 410 FunctionType *funcType = GenPoly::getFunctionType( appExpr-> get_function()->get_result());410 FunctionType *funcType = GenPoly::getFunctionType( appExpr->function->result ); 411 411 assert( funcType ); 412 412 return funcType->get_parameters().size() == 1; -
src/ResolvExpr/CurrentObject.cc
r1be845b rf072892 139 139 ArrayIterator( ArrayType * at ) : array( at ) { 140 140 PRINT( std::cerr << "Creating array iterator: " << at << std::endl; ) 141 base = at-> get_base();141 base = at->base; 142 142 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 ); 145 145 } 146 146 -
src/SymTab/Validate.cc
r1be845b rf072892 1232 1232 void ArrayLength::previsit( ObjectDecl * objDecl ) { 1233 1233 if ( ArrayType * at = dynamic_cast< ArrayType * >( objDecl->type ) ) { 1234 if ( at-> get_dimension()) return;1234 if ( at->dimension ) return; 1235 1235 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() ) ); 1237 1237 } 1238 1238 }
Note: See TracChangeset
for help on using the changeset viewer.