@@ -2937,7 +2937,7 @@ algorithm
29372937 // @adrpo: if Evaluate=true make the parameter a structural parameter
29382938 // only make it a structural parameter if is not constant, duh!, 1071 regressions :)
29392939 if c. attributes. variability == Variability . PARAMETER and Component . getEvaluateAnnotation(c) then
2940- InstNode . updateComponent( Component . setVariability( Variability . STRUCTURAL_PARAMETER , c) , node);
2940+ markStructuralParamsComp(c , node);
29412941 end if ;
29422942
29432943 for dim in c. dimensions loop
@@ -3013,13 +3013,7 @@ algorithm
30133013 comp := InstNode . component(node);
30143014
30153015 if Component . variability(comp) == Variability . PARAMETER then
3016- comp := Component . setVariability(Variability . STRUCTURAL_PARAMETER , comp);
3017- InstNode . updateComponent(comp, node);
3018-
3019- binding := Binding . untypedExp(Component . getBinding(comp));
3020- if isSome(binding) then
3021- markStructuralParamsExp(Util . getOption(binding));
3022- end if ;
3016+ markStructuralParamsComp(comp, node);
30233017 end if ;
30243018 end if ;
30253019 then
@@ -3029,6 +3023,22 @@ algorithm
30293023 end match;
30303024end markStructuralParamsExp_traverser;
30313025
3026+ function markStructuralParamsComp
3027+ input Component component;
3028+ input InstNode node;
3029+ protected
3030+ Component comp;
3031+ Option < Expression > binding;
3032+ algorithm
3033+ comp := Component . setVariability(Variability . STRUCTURAL_PARAMETER , component);
3034+ InstNode . updateComponent(comp, node);
3035+
3036+ binding := Binding . untypedExp(Component . getBinding(comp));
3037+ if isSome(binding) then
3038+ markStructuralParamsExp(Util . getOption(binding));
3039+ end if ;
3040+ end markStructuralParamsComp;
3041+
30323042function markStructuralParamsExpSize
30333043 input Expression exp;
30343044algorithm
0 commit comments