Changeset 5465377c


Ignore:
Timestamp:
Nov 12, 2020, 1:25:42 PM (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:
3746f777
Parents:
1d379b5
Message:

fix array_dim problem in old ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/InitTweak/GenInit.cc

    r1d379b5 r5465377c  
    202202                        }
    203203                        // don't need to hoist dimension if it's definitely pure - only need to if there's potential for side effects.
    204                         // xxx - hoisting has no side effects anyways, so don't skip since we delay resolve     
    205                         // only skip in the most trivial case, which does not require resolve
    206                         if (dynamic_cast<ConstantExpr *>(arrayType->dimension)) return;
    207                         // if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return;
     204                        // xxx - hoisting has no side effects anyways, so don't skip since we delay resolve
     205                        // still try to detect constant expressions
     206                        if ( ! Tuples::maybeImpure( arrayType->dimension ) ) return;
    208207
    209208                        ObjectDecl * arrayDimension = new ObjectDecl( dimensionName.newName(), storageClasses, LinkageSpec::C, 0, Validate::SizeType->clone(), new SingleInit( arrayType->get_dimension() ) );
Note: See TracChangeset for help on using the changeset viewer.