Skip to content

Commit

Permalink
- Fixed continue->match optimization for uniontype patterns
Browse files Browse the repository at this point in the history
  - Added a testcase for this


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@7614 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Jan 1, 2011
1 parent 5fcca70 commit 9233756
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Compiler/FrontEnd/Patternm.mo
Expand Up @@ -641,11 +641,17 @@ algorithm
case (DAE.PAT_CALL_TUPLE(ps1),DAE.PAT_CALL_TUPLE(ps2))
then patternListsDoNotOverlap(ps1,ps2);

case (DAE.PAT_CALL(name1,ix1,{}),DAE.PAT_CALL(name2,ix2,{}))
equation
res = ix1 == ix2;
res = Debug.bcallret2(res, Absyn.pathEqual, name1, name2, res);
then not res;

case (DAE.PAT_CALL(name1,ix1,ps1),DAE.PAT_CALL(name2,ix2,ps2))
equation
res = ix1 == ix2;
res = Debug.bcallret2(res, Absyn.pathEqual, name1, name2, res);
res = Debug.bcallret2(res, patternListsDoNotOverlap, ps1, ps2, res);
res = Debug.bcallret2(res, patternListsDoNotOverlap, ps1, ps2, not res);
then res;

// TODO: PAT_CALLED_NAMED?
Expand Down

0 comments on commit 9233756

Please sign in to comment.