Changeset 7100384 in OpenModelica
- Timestamp:
- 2016-04-04T08:50:36+02:00 (8 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 0aff3d1
- Parents:
- f49dbc4
- git-author:
- Martin Sjölund <martin.sjolund@…> (04/04/16 08:50:36)
- git-committer:
- hudson <openmodelica@…> (04/04/16 08:50:36)
- Location:
- Compiler
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/FrontEnd/Inline.mo
rf49dbc4 r7100384 692 692 case (e,fns,source) 693 693 equation 694 (e_1,_) = Expression. Expression.traverseExpBottomUp(e,function forceInlineCall(fns=fns),{});694 (e_1,_) = Expression.traverseExpBottomUp(e,function forceInlineCall(fns=fns),{}); 695 695 false = referenceEq(e, e_1); 696 696 source = DAEUtil.addSymbolicTransformation(source,DAE.OP_INLINE(DAE.PARTIAL_EQUATION(e),DAE.PARTIAL_EQUATION(e_1))); … … 822 822 // MSL 3.2.1 need GenerateEvents to disable this 823 823 newExp = Expression.addNoEventToRelationsAndConds(newExp); 824 (newExp,(_,_,true)) = Expression. Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true));824 (newExp,(_,_,true)) = Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true)); 825 825 // for inlinecalls in functions 826 (newExp1,assrtLst) = Expression. Expression.traverseExpBottomUp(newExp,function inlineCall(fns=fns),assrtLst);826 (newExp1,assrtLst) = Expression.traverseExpBottomUp(newExp,function inlineCall(fns=fns),assrtLst); 827 827 else // normal Modelica 828 828 // get inputs, body and output … … 843 843 generateEvents = hasGenerateEventsAnnotation(comment); 844 844 newExp = if not generateEvents then Expression.addNoEventToRelationsAndConds(newExp) else newExp; 845 (newExp,(_,_,true)) = Expression. Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true));845 (newExp,(_,_,true)) = Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true)); 846 846 // for inlinecalls in functions 847 (newExp1,assrtLst) = Expression. Expression.traverseExpBottomUp(newExp,function inlineCall(fns=fns),assrtLst);847 (newExp1,assrtLst) = Expression.traverseExpBottomUp(newExp,function inlineCall(fns=fns),assrtLst); 848 848 else // assert detected 849 849 true = listLength(assrtStmts) == 1; … … 860 860 generateEvents = hasGenerateEventsAnnotation(comment); 861 861 newExp = if not generateEvents then Expression.addNoEventToRelationsAndConds(newExp) else newExp; 862 (newExp,(_,_,true)) = Expression. Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true));862 (newExp,(_,_,true)) = Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true)); 863 863 assrt = inlineAssert(assrt,fns,argmap,checkcr); 864 864 // for inlinecalls in functions 865 (newExp1,assrtLst) = Expression. Expression.traverseExpBottomUp(newExp,function inlineCall(fns=fns),assrt::assrtLst);865 (newExp1,assrtLst) = Expression.traverseExpBottomUp(newExp,function inlineCall(fns=fns),assrt::assrtLst); 866 866 end if; 867 867 end if; … … 887 887 algorithm 888 888 DAE.STMT_ASSERT(cond=cond, msg=msg, level=level, source=source) := assrtIn; 889 (cond,_,_,_) := inlineExp(cond,fns,source); 890 (cond,(_,_,true)) := Expression.Expression.traverseExpBottomUp(cond,replaceArgs,(argmap,checkcr,true)); 889 (cond,(_,_,true)) := Expression.traverseExpBottomUp(cond,replaceArgs,(argmap,checkcr,true)); 891 890 //print("ASSERT inlined: "+ExpressionDump.printExpStr(cond)+"\n"); 892 (msg,_,_,_) := inlineExp(msg,fns,source); 893 (msg,(_,_,true)) := Expression.Expression.traverseExpBottomUp(msg,replaceArgs,(argmap,checkcr,true)); 891 (msg,(_,_,true)) := Expression.traverseExpBottomUp(msg,replaceArgs,(argmap,checkcr,true)); 892 // These clear checkcr/repl and need to be performed last 893 // (cond,_,_,_) := inlineExp(cond,fns,source); 894 // (msg,_,_,_) := inlineExp(msg,fns,source); 894 895 assrtOut := DAE.STMT_ASSERT(cond, msg, level, source); 895 896 end inlineAssert; … … 966 967 generateEvents = hasGenerateEventsAnnotation(comment); 967 968 newExp = if not generateEvents then Expression.addNoEventToRelationsAndConds(newExp) else newExp; 968 (newExp,(_,_,true)) = Expression. Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true));969 (newExp,(_,_,true)) = Expression.traverseExpBottomUp(newExp,replaceArgs,(argmap,checkcr,true)); 969 970 // for inlinecalls in functions 970 971 (newExp1,assrtLst) = Expression.traverseExpBottomUp(newExp,function forceInlineCall(fns=fns),assrtLst); … … 1600 1601 case DAE.PARTIAL_EQUATION(e) 1601 1602 equation 1602 (e_1,_) = Expression. Expression.traverseExpBottomUp(e,fn,{});1603 (e_1,_) = Expression.traverseExpBottomUp(e,fn,{}); 1603 1604 changed = not referenceEq(e, e_1); 1604 1605 eq2 = DAE.PARTIAL_EQUATION(e_1); … … 1608 1609 case DAE.RESIDUAL_EXP(e) 1609 1610 equation 1610 (e_1,_) = Expression. Expression.traverseExpBottomUp(e,fn,{});1611 (e_1,_) = Expression.traverseExpBottomUp(e,fn,{}); 1611 1612 changed = not referenceEq(e, e_1); 1612 1613 eq2 = DAE.RESIDUAL_EXP(e_1); … … 1616 1617 case DAE.EQUALITY_EXPS(e1,e2) 1617 1618 equation 1618 (e1_1,_) = Expression. Expression.traverseExpBottomUp(e1,fn,{});1619 (e2_1,_) = Expression. Expression.traverseExpBottomUp(e2,fn,{});1619 (e1_1,_) = Expression.traverseExpBottomUp(e1,fn,{}); 1620 (e2_1,_) = Expression.traverseExpBottomUp(e2,fn,{}); 1620 1621 changed = not (referenceEq(e1, e1_1) and referenceEq(e2, e2_1)); 1621 1622 eq2 = DAE.EQUALITY_EXPS(e1_1,e2_1); -
Compiler/Util/BaseHashTable.mo
rcd37dee6 r7100384 649 649 Key key; 650 650 array<Option<HashEntry>> vae; 651 constant Boolean workaroundForBug=true "TODO: Make it impossible to update a value by not updating n (fully mutable HT instead of this hybrid)"; 652 constant Boolean debug=false; 651 653 algorithm 652 654 (hv, (vs, ve, vae), bs, ft as (hashFunc,_,_,_)) := ht; … … 655 657 case SOME((key,_)) 656 658 algorithm 657 hash_idx := hashFunc(key, bs) + 1; 658 arrayUpdate(hv, hash_idx, {}); 659 if not workaroundForBug then 660 hash_idx := hashFunc(key, bs) + 1; 661 arrayUpdate(hv, hash_idx, {}); 662 end if; 659 663 arrayUpdate(vae, i, NONE()); 660 664 then (); 661 665 else 662 666 algorithm 663 return;667 if not workaroundForBug then return; end if; 664 668 then (); 665 669 end match; 666 670 end for; 671 if debug then 672 for i in vae loop 673 if isSome(i) then 674 print("vae not empty\n"); 675 break; 676 end if; 677 end for; 678 end if; 679 if workaroundForBug then 680 for i in 1:arrayLength(hv) loop 681 if not listEmpty(arrayGet(hv,i)) then 682 if debug then print("hv not empty\n"); end if; 683 arrayUpdate(hv,i,{}); 684 end if; 685 end for; 686 end if; 667 687 end clearAssumeNoDelete; 668 688
Note: See TracChangeset
for help on using the changeset viewer.