Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r18e683b r3c89751  
    12261226                const ast::StaticAssertDecl * previsit( const ast::StaticAssertDecl * );
    12271227
    1228                 void previsit( const ast::ArrayType * );
    1229                 void previsit( const ast::PointerType * );
     1228                const ast::ArrayType * previsit( const ast::ArrayType * );
     1229                const ast::PointerType * previsit( const ast::PointerType * );
    12301230
    12311231                const ast::ExprStmt *        previsit( const ast::ExprStmt * );
     
    13341334
    13351335        template< typename PtrType >
    1336         void handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) {
    1337                 #warning unimplemented; needs support for new Validate::SizeType global
    1338                 (void)type; (void)symtab;
    1339                 assert( false );
    1340         }
    1341 
    1342         void Resolver_new::previsit( const ast::ArrayType * at ) {
    1343                 handlePtrType( at, symtab );
    1344         }
    1345 
    1346         void Resolver_new::previsit( const ast::PointerType * pt ) {
    1347                 handlePtrType( pt, symtab );
     1336        const PtrType * handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) {
     1337                if ( type->dimension ) {
     1338                        #warning should use new equivalent to Validate::SizeType rather than sizeType here
     1339                        ast::ptr< ast::Type > sizeType = new ast::BasicType{ ast::BasicType::LongUnsignedInt };
     1340                        ast::mutate_field(
     1341                                type, &PtrType::dimension,
     1342                                findSingleExpression( type->dimension, sizeType, symtab ) );
     1343                }
     1344                return type;
     1345        }
     1346
     1347        const ast::ArrayType * Resolver_new::previsit( const ast::ArrayType * at ) {
     1348                return handlePtrType( at, symtab );
     1349        }
     1350
     1351        const ast::PointerType * Resolver_new::previsit( const ast::PointerType * pt ) {
     1352                return handlePtrType( pt, symtab );
    13481353        }
    13491354
Note: See TracChangeset for help on using the changeset viewer.