Skip to content

Commit

Permalink
Only run SMFlatten if the model uses SMs
Browse files Browse the repository at this point in the history
The state machine handling is slow and always runs. This disables that
code unless the model actually contains a state machine.
  • Loading branch information
sjoelund committed Oct 17, 2016
1 parent c9f67a8 commit 7efbde0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Compiler/FrontEnd/StateMachineFlatten.mo
Expand Up @@ -116,6 +116,11 @@ algorithm
assert(listLength(elementLst) == 1, "Internal compiler error: Handling of elementLst != 1 not supported\n");
DAE.COMP(ident, dAElist, source, comment) := listHead(elementLst);

if not List.exist(dAElist, isFlatSm) then
outDAElist := inDAElist;
return;
end if;

(flatSmLst, otherLst) := List.extractOnTrue(dAElist, isFlatSm);
elementLst2 := List.fold2(flatSmLst, flatSmToDataFlow, NONE(), NONE(), {});

Expand Down
2 changes: 1 addition & 1 deletion common
Submodule common updated 1 files
+27 −12 m4/qmake.m4

0 comments on commit 7efbde0

Please sign in to comment.