Ignore:
Timestamp:
Nov 10, 2020, 3:15:56 AM (4 years ago)
Author:
Fangren Yu <f37yu@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
1b5c3d60, cdacb73
Parents:
0dd9a5e
Message:

restore ArrayLength? as it seems to serve other purposes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/SymTab/Validate.cc

    r0dd9a5e r3ff4c1e  
    282282
    283283                void previsit( ObjectDecl * objDecl );
    284                 // void previsit( ArrayType * arrayType );
     284                void previsit( ArrayType * arrayType );
    285285        };
    286286
     
    13461346        }
    13471347
    1348         // xxx - this seems to be in HoistArrayDimension now.
    1349 
    1350         /*
    13511348        void ArrayLength::previsit( ArrayType * type ) {
    1352                 if ( type->dimension ) {
    1353                         // need to resolve array dimensions early so that constructor code can correctly determine
    1354                         // if a type is a VLA (and hence whether its elements need to be constructed)
    1355                         ResolvExpr::findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer );
    1356 
    1357                         // must re-evaluate whether a type is a VLA, now that more information is available
    1358                         // (e.g. the dimension may have been an enumerator, which was unknown prior to this step)
    1359                         type->isVarLen = ! InitTweak::isConstExpr( type->dimension );
    1360                 }
    1361         }
    1362         */
     1349                if (!useNewAST) {
     1350                        if ( type->dimension ) {
     1351                                // need to resolve array dimensions early so that constructor code can correctly determine
     1352                                // if a type is a VLA (and hence whether its elements need to be constructed)
     1353                                ResolvExpr::findSingleExpression( type->dimension, Validate::SizeType->clone(), indexer );
     1354
     1355                                // must re-evaluate whether a type is a VLA, now that more information is available
     1356                                // (e.g. the dimension may have been an enumerator, which was unknown prior to this step)
     1357                                type->isVarLen = ! InitTweak::isConstExpr( type->dimension );
     1358                        }
     1359                }
     1360        }
    13631361
    13641362        struct LabelFinder {
Note: See TracChangeset for help on using the changeset viewer.